:root {
  --brand: #0f172a;
  --brand-2: #7c3aed;
  --accent: #f59e0b;
  --ink: #0b1220;
  --muted: #6b7280;
  --bg: #f7f7fb;
  --card-shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px rgba(15,23,42,.06);
}
html,body { background: var(--bg); color: var(--ink); font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.app-navbar {
  background: linear-gradient(135deg, #0b1220 0%, #1a2036 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.app-navbar .navbar-brand,
.app-navbar .nav-link,
.app-navbar .navbar-toggler,
.app-navbar .dropdown-toggle { color: #fff !important; }
.app-navbar .nav-link:hover { color: var(--accent) !important; }
.app-navbar .navbar-toggler { border-color: rgba(255,255,255,.3); }
.app-navbar .navbar-toggler-icon { filter: invert(1); }
.brand-badge {
  display:inline-block;background: var(--accent); color:#111; font-weight:700; font-size:.75rem; padding:.15rem .45rem; border-radius:.35rem; letter-spacing:.5px; margin-right:.35rem;
}
.page-title { font-weight:700; letter-spacing:-.01em; }
.card { border: 0; box-shadow: var(--card-shadow); border-radius: .75rem; background: #fff; }
.card .card-header { background: transparent; border-bottom: 1px solid #eef; font-weight: 600; }
.stat-card { background: #fff; border-radius: .75rem; padding: 1.15rem 1.25rem; box-shadow: var(--card-shadow); }
.stat-card .stat-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; margin-top: .15rem; }
.stat-card .stat-hint { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.btn-primary { background: var(--brand-2); border-color: var(--brand-2); }
.btn-primary:hover { background: #6d28d9; border-color: #6d28d9; }
.btn-outline-primary { color: var(--brand-2); border-color: var(--brand-2); }
.btn-outline-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.app-foot { color: #64748b; }

.avatar-sm { width:34px; height:34px; border-radius:50%; object-fit:cover; }
.avatar-lg { width:96px; height:96px; border-radius:50%; object-fit:cover; }
.placeholder-avatar { display:inline-flex; align-items:center; justify-content:center; background:#e5e7fb; color:#4f46e5; font-weight:700; }
.avatar-sm.placeholder-avatar { font-size:.9rem; }
.avatar-lg.placeholder-avatar { font-size:2rem; }

.stmt-amount { font-size: 2.4rem; font-weight: 700; color: var(--brand-2); }

.breakdown-table td { padding: 0.55rem 0.75rem; }
.breakdown-table tr.table-active td { background: #f6f4ff; }
.breakdown-table tr.table-success td { background: #ecfdf5; }

.upload-progress .progress { height: 20px; border-radius: 10px; background: #eef1ff; }
.upload-progress .progress-bar { background: linear-gradient(90deg, #7c3aed 0%, #f59e0b 100%); font-size:.75rem; line-height: 20px; }

/* AUTH page */
.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124,58,237,.25), transparent 60%),
    radial-gradient(1200px 600px at 110% 110%, rgba(245,158,11,.2), transparent 60%),
    #0b1220;
  display:flex; align-items:center; justify-content:center; padding: 2rem 1rem;
}
.auth-shell { width: 100%; max-width: 440px; }
.auth-brand { text-align:center; color:#fff; margin-bottom: 1.5rem; }
.auth-logo { display:inline-block; background:#f59e0b; color:#111; font-weight:800; padding:.35rem .6rem; border-radius:.4rem; font-size:1.2rem; letter-spacing:.5px; }
.auth-title { font-size: 1.25rem; font-weight: 700; margin-top: .4rem; }
.auth-sub { color:#9aa5c7; font-size:.85rem; }
.auth-card { background:#fff; border-radius: .9rem; padding: 1.75rem; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-foot { text-align:center; color:#7a89ad; margin-top: 1.25rem; font-size:.8rem; }

.auth-lang { color: #cbd5e1; }
.auth-lang-link {
  color: #94a3b8; padding: 0.15rem 0.5rem; border-radius: 0.35rem;
  font-size: 0.85rem; margin: 0 0.15rem; text-decoration: none;
}
.auth-lang-link.active { background: rgba(255,255,255,.15); color: #fff; }
.auth-lang-link:hover { color: #fff; }

.table th { font-weight: 600; color: #111; }
.badge.bg-warning { color: #111; }

/* Analytics bars */
.analytics-list { display: grid; gap: 0.6rem; }
.analytics-row { padding: 0.15rem 0; }
.analytics-bar {
  height: 6px; background: #eef1ff; border-radius: 3px; overflow: hidden; margin-top: 4px;
}
.analytics-fill {
  height: 100%; background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 100%); border-radius: 3px;
}

.chart-canvas { width: 100%; }

.dropdown-form { margin: 0; padding: 0; }
.dropdown-form .dropdown-item { border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; padding: .25rem 1rem; }
.dropdown-form .dropdown-item:hover { background: #f3f4f6; }
.dropdown-form .dropdown-item.active { background: #ede9fe; color: #4c1d95; font-weight: 600; }

.text-warning { color: #b45309 !important; }
.stat-value.text-warning { color: #b45309 !important; }

.finance-breakdown { list-style: none; padding: 0; margin: 0; }
.finance-breakdown li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.35rem 0; border-top: 1px dashed #eef;
  font-size: 0.88rem;
}
.finance-breakdown li:first-child { border-top: 0; }
.stat-value.text-success { color: #059669 !important; }

/* =========== APP SHELL (sidebar + main) =========== */
.app-shell {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 56px);
}

.has-sidebar .app-sidebar {
  flex: 0 0 240px;
  width: 240px;
  max-width: 20vw;
  min-width: 220px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  box-shadow: 1px 0 0 rgba(15,23,42,.02), 4px 0 24px rgba(15,23,42,.03);
  padding: 1.25rem .75rem 1.5rem;
  position: sticky;
  top: 56px;
  align-self: flex-start;
  height: calc(100vh - 56px);
  overflow-y: auto;
  z-index: 900;
  transition: transform .22s ease;
}

.app-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.app-main {
  flex: 1 1 auto;
  padding: 1.6rem 1.9rem 2rem;
}
.app-foot {
  border-top: 1px solid #e5e7eb;
  padding: 0.9rem 1.9rem;
  color: #64748b;
  font-size: .82rem;
  text-align: center;
  background: #ffffff;
}

/* Sidebar user card */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .55rem .85rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid #f1f5f9;
}
.sidebar-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%);
  color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 38px; overflow: hidden;
  box-shadow: 0 2px 6px rgba(124,58,237,.25);
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-avatar span { font-size: 1rem; }
.sidebar-user-meta { line-height: 1.15; min-width: 0; }
.sidebar-user-name { font-weight: 600; color: #0f172a; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: #94a3b8; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }

.sidebar-section-label {
  color: #94a3b8;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 700;
  margin: 1rem .6rem .4rem;
}
.sidebar-section-label:first-of-type { margin-top: .25rem; }

.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav > li { margin: 0 0 .15rem; }
.sidebar-nav > li > a {
  display: flex; align-items: center; gap: .7rem;
  color: #475569;
  padding: .55rem .7rem;
  border-radius: .55rem;
  font-size: .9rem;
  text-decoration: none;
  transition: background .15s, color .15s, transform .1s;
  position: relative;
}
.sidebar-nav > li > a > i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  color: #94a3b8;
  transition: color .15s;
}
.sidebar-nav > li > a > span { flex: 1 1 auto; }
.sidebar-nav > li > a:hover {
  background: #f8fafc;
  color: #0f172a;
}
.sidebar-nav > li > a:hover > i { color: #7c3aed; }
.sidebar-nav > li > a.active {
  background: linear-gradient(90deg, rgba(124,58,237,.12) 0%, rgba(124,58,237,.04) 100%);
  color: #4c1d95;
  font-weight: 600;
}
.sidebar-nav > li > a.active > i { color: #7c3aed; }
.sidebar-nav > li > a.active::before {
  content: "";
  position: absolute;
  left: -.75rem;
  top: 6px; bottom: 6px;
  width: 3px;
  background: #7c3aed;
  border-radius: 0 3px 3px 0;
}

.sidebar-scrim {
  position: fixed; inset: 56px 0 0 0;
  background: rgba(15,23,42,.4);
  z-index: 800;
  display: none;
}
.sidebar-scrim.show { display: block; }
.sidebar-toggle {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.25);
  padding: .2rem .5rem;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.1); color:#fff; }

@media (max-width: 991.98px) {
  .app-shell { display: block; }
  .has-sidebar .app-sidebar {
    position: fixed;
    top: 56px; left: 0; bottom: 0;
    width: 260px;
    max-width: 82vw;
    height: auto;
    transform: translateX(-105%);
    box-shadow: 6px 0 24px rgba(15,23,42,.15);
  }
  .has-sidebar .app-sidebar.open { transform: translateX(0); }
  .app-main { padding: 1rem 1rem 2rem; }
  .app-foot { padding: .8rem 1rem; }
}

/* Catalog cards */
.catalog-type-card {
  border: 1px solid #e5e7eb; border-radius: .75rem; padding: 1.25rem; background:#fff;
  transition: box-shadow .15s, transform .15s, border-color .15s;
  height: 100%;
  display: flex; flex-direction: column;
}
.catalog-type-card:hover { box-shadow: var(--card-shadow); border-color: var(--brand-2); }
.catalog-type-card .icon-lg { font-size: 2rem; color: var(--brand-2); }
.catalog-status-badge { font-size: .72rem; padding: .3rem .55rem; border-radius: .35rem; }
.badge-status-draft { background: #f1f5f9; color: #64748b; }
.badge-status-submitted { background: #fef3c7; color: #92400e; }
.badge-status-approved { background: #d1fae5; color: #065f46; }
.badge-status-released { background: #dbeafe; color: #1e40af; }
.track-row { border-top: 1px dashed #e5e7eb; padding: .6rem 0; }
.track-row:first-child { border-top: 0; }

/* Track detail card (admin catalog review) */
.track-detail {
  padding: 1rem 1.15rem;
  border-top: 1px solid #eef1f5;
}
.track-detail:first-child { border-top: 0; }
.track-detail:hover { background: #fafbff; }
.track-head {
  display: flex; align-items: center; gap: .85rem;
  margin-bottom: .75rem;
}
.track-num {
  flex: 0 0 34px; width: 34px; height: 34px;
  border-radius: 50%;
  background: #ede9fe;
  color: #4c1d95;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem;
}
.track-title-wrap { flex: 1 1 auto; min-width: 0; }
.track-title { font-weight: 600; color: #0f172a; font-size: 1rem; }
.track-artists { font-size: .82rem; color: #64748b; margin-top: 2px; }
.track-actions { flex: 0 0 auto; }
.track-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .6rem .9rem;
  padding: .25rem .25rem 0 3.35rem; /* align under title */
}
.track-meta-item { min-width: 0; }
.track-meta-label {
  font-size: .68rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  margin-bottom: 2px;
}
.track-meta-value {
  font-size: .88rem;
  color: #0f172a;
  word-break: break-word;
}
.track-lyrics {
  margin: .75rem 0 0 3.35rem;
  border: 1px solid #eef1f5;
  border-radius: .5rem;
  background: #fafbff;
}
.track-lyrics > summary {
  cursor: pointer;
  padding: .5rem .8rem;
  font-size: .85rem;
  font-weight: 600;
  color: #4c1d95;
  list-style: none;
}
.track-lyrics > summary::-webkit-details-marker { display:none; }
.track-lyrics > summary::before {
  content: "▶";
  display: inline-block;
  margin-right: .4rem;
  color: #94a3b8;
  font-size: .7rem;
  transition: transform .15s;
}
.track-lyrics[open] > summary::before { transform: rotate(90deg); }
.lyrics-body {
  margin: 0;
  padding: .6rem .9rem .9rem 1.75rem;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: .88rem;
  color: #334155;
  border-top: 1px solid #eef1f5;
}
@media (max-width: 575.98px) {
  .track-meta-grid { padding-left: 0; }
  .track-lyrics { margin-left: 0; }
}
