/* SoundShare Royalties - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Mono:wght@300;400;500&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

:root {
  --bg:         #0a0a0f;
  --bg-card:    #111118;
  --bg-raised:  #18181f;
  --border:     rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);

  --ink:        #f0eff8;
  --ink-muted:  #8888a8;
  --ink-faint:  #44445a;

  --accent:     #7c5cfc;
  --accent-glow:#7c5cfc44;
  --accent-soft:#2a1f5e;
  --gold:       #e8c96a;
  --gold-soft:  #e8c96a20;
  --green:      #4ade80;
  --green-soft: #4ade8020;
  --red:        #f87171;
  --red-soft:   #f8717120;
  --amber:      #fbbf24;
  --amber-soft: #fbbf2420;

  --radius:     12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --shadow:     0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:  0 12px 48px rgba(0,0,0,0.7);

  --font-head:  'Syne', sans-serif;
  --font-body:  'DM Sans', sans-serif;
  --font-mono:  'DM Mono', monospace;

  --sidebar-w: 260px;
  --topbar-h:  64px;
}

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

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Layout ─────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-brand .logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: 18px;
  box-shadow: 0 0 20px var(--accent-glow);
}
.sidebar-brand .brand-name {
  font-family: var(--font-head); font-weight: 700; font-size: 15px;
  line-height: 1.2;
}
.sidebar-brand .brand-sub { color: var(--ink-muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-section-label {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; padding: 8px 10px 6px;
  font-family: var(--font-mono);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--ink-muted); text-decoration: none;
  font-size: 14px; font-weight: 400; margin-bottom: 2px;
  transition: all 0.15s ease;
  position: relative;
}
.nav-item svg { opacity: 0.7; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-raised); color: var(--ink); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 500;
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.nav-badge {
  margin-left: auto; background: var(--red);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 20px;
  font-family: var(--font-mono);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  cursor: pointer; text-decoration: none;
  transition: background 0.15s;
}
.sidebar-user:hover { background: var(--bg-raised); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-soft); border: 1.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 12px; font-weight: 700;
  color: var(--accent); flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.sidebar-user-info .name { font-size: 13px; font-weight: 500; color: var(--ink); }
.sidebar-user-info .role {
  font-size: 10px; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
}
.topbar-title { font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-body { padding: 32px; flex: 1; }

/* ── Cards ─────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-sm { padding: 18px; border-radius: var(--radius); }

/* ── Stat Cards ─────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative; overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.stat-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent-glow);
  transform: translate(30px, -30px);
  pointer-events: none;
}
.stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-muted); font-family: var(--font-mono); margin-bottom: 10px;
}
.stat-value {
  font-family: var(--font-head); font-size: 28px; font-weight: 800;
  line-height: 1; margin-bottom: 8px;
}
.stat-sub { font-size: 12px; color: var(--ink-muted); }
.stat-icon {
  position: absolute; top: 20px; right: 20px;
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.stat-icon.purple { background: var(--accent-soft); color: var(--accent); }
.stat-icon.gold   { background: var(--gold-soft);   color: var(--gold); }
.stat-icon.green  { background: var(--green-soft);  color: var(--green); }
.stat-icon.red    { background: var(--red-soft);    color: var(--red); }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 9px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; text-decoration: none;
  transition: all 0.15s ease; line-height: 1;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover { background: #6a4de8; box-shadow: 0 0 20px var(--accent-glow); }
.btn-ghost { background: transparent; color: var(--ink-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-raised); color: var(--ink); border-color: var(--border-hover); }
.btn-danger { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-soft); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-soft); }
.btn-success:hover { background: var(--green); color: #0a0a0f; }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn svg { flex-shrink: 0; }

/* ── Forms ─────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--ink-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.07em;
  font-family: var(--font-mono);
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--ink);
  font-family: var(--font-body); font-size: 14px;
  padding: 11px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none; appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--ink-faint); }
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238888a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; cursor: pointer; }
.form-select option { background: var(--bg-card); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: var(--ink-faint); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Tables ─────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  padding: 11px 14px; text-align: left;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-muted); font-family: var(--font-mono); font-weight: 500;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 13px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--bg-raised); }
.td-mono { font-family: var(--font-mono); font-size: 13px; }

/* ── Badges / Tags ─────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.badge-green  { background: var(--green-soft); color: var(--green); }
.badge-red    { background: var(--red-soft);   color: var(--red); }
.badge-amber  { background: var(--amber-soft); color: var(--amber); }
.badge-purple { background: var(--accent-soft);color: var(--accent); }
.badge-muted  { background: var(--bg-raised);  color: var(--ink-muted); }
.badge-gold   { background: var(--gold-soft);  color: var(--gold); }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ── Modals ─────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  padding: 20px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px;
  width: 100%; max-width: 520px;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-family: var(--font-head); font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--ink-muted); cursor: pointer; font-size: 18px;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--red-soft); color: var(--red); border-color: var(--red-soft); }

/* ── Alerts ─────────────────────────────── */
.alert {
  padding: 13px 16px; border-radius: 9px; font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px;
}
.alert-error   { background: var(--red-soft);   color: var(--red);   border: 1px solid var(--red); }
.alert-success { background: var(--green-soft);  color: var(--green); border: 1px solid var(--green); }
.alert-warning { background: var(--amber-soft);  color: var(--amber); border: 1px solid var(--amber); }
.alert-info    { background: var(--accent-soft); color: var(--accent);border: 1px solid var(--accent); }

/* ── Auth Pages ─────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, var(--accent-soft) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(232,201,106,0.06) 0%, transparent 40%);
}
.auth-box {
  width: 100%; max-width: 440px; padding: 20px;
}
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 40px;
}
.auth-logo {
  text-align: center; margin-bottom: 32px;
}
.auth-logo .mark {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent); margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: 24px;
  box-shadow: 0 0 32px var(--accent-glow);
}
.auth-logo h1 { font-family: var(--font-head); font-size: 22px; font-weight: 800; }
.auth-logo p { color: var(--ink-muted); font-size: 13px; margin-top: 4px; }

/* ── Section Headers ─────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-family: var(--font-head); font-size: 17px; font-weight: 700;
}
.section-sub { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

/* ── Misc Utilities ─────────────────────── */
.text-gold   { color: var(--gold); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--ink-muted); }
.text-mono   { font-family: var(--font-mono); }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.fw-700 { font-weight: 700; }
.gap-12 { display: flex; gap: 12px; }
.gap-8  { display: flex; gap: 8px; align-items: center; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--ink-muted);
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }

@media (max-width: 900px) {
  .two-col, .three-col { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .page-body { padding: 20px; }
}

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ── Loading Spinner ─────────────────────── */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ─────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px 18px;
  font-size: 13.5px; color: var(--ink);
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease;
  max-width: 320px;
  display: flex; align-items: center; gap: 10px;
}
.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--red); }
@keyframes toast-in {
  from { opacity:0; transform: translateX(20px); }
  to   { opacity:1; transform: translateX(0); }
}
