/* SongVault UI – dark theme. Tailwind utilities handle layout; components live here. */
:root {
  --ground: #141416;
  --surface: #1c1c21;
  --raised: #26262d;
  --line: #34343c;
  --text: #ececf1;
  --muted: #9c9ca8;
  --green: #2bd576;
  --green-ink: #06210f;
  --violet: #9b8cff;
  --danger: #ff6b7d;
  --amber: #f5b84a;
  --radius-panel: 14px;
  --radius-control: 9px;
}

html { background: var(--ground); color-scheme: dark; }
body {
  background: var(--ground);
  color: var(--text);
  font-family: 'Figtree', ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.num, .tabular { font-variant-numeric: tabular-nums; }
a { color: inherit; }
a.link { color: var(--green); text-decoration: none; }
a.link:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
[x-cloak] { display: none !important; }

h1.page-title { font-size: 1.9rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
h2.section-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 1.25rem; }
.panel-flat { background: var(--surface); border-radius: var(--radius-panel); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem 1rem; border-radius: 999px; font-weight: 600; font-size: .9rem;
  border: 1px solid var(--line); background: var(--raised); color: var(--text);
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: #30303a; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--green); color: var(--green-ink); border-color: var(--green); }
.btn-primary:hover { background: #4be08c; }
.btn-sign { background: var(--violet); color: #120c33; border-color: var(--violet); }
.btn-sign:hover { background: #b0a4ff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--raised); color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(255,107,125,.4); color: var(--danger); }
.btn-danger:hover { background: rgba(255,107,125,.1); }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-icon { width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 999px; }

/* Forms */
.label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.input, .select, .textarea {
  width: 100%; background: var(--ground); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-control); padding: .55rem .75rem; font: inherit; font-size: .92rem;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(43,213,118,.15); }
.textarea { min-height: 7rem; resize: vertical; }
.textarea.lyrics { min-height: 18rem; font-size: .95rem; line-height: 1.7; }
.select[multiple] { min-height: 8rem; }
.field-error { color: var(--danger); font-size: .8rem; margin-top: .25rem; }
.input.has-error, .select.has-error, .textarea.has-error { border-color: var(--danger); }
.help { color: var(--muted); font-size: .8rem; margin-top: .25rem; }
.check { display: inline-flex; gap: .5rem; align-items: center; font-size: .9rem; cursor: pointer; }
.check input { accent-color: var(--green); width: 1rem; height: 1rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .65rem .75rem; border-bottom: 1px solid #26262d; vertical-align: middle; }
.table tr:hover td { background: rgba(255,255,255,.02); }
.table .r { text-align: right; }
.table-wrap { overflow-x: auto; }

/* Tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 1.5rem; }
.tab { padding: .7rem .95rem; color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--green); }
.tab.rights.active { border-bottom-color: var(--violet); }

/* Sidebar */
.sidebar a.nav { display: flex; gap: .7rem; align-items: center; padding: .55rem .8rem; border-radius: 9px; color: var(--muted); font-weight: 600; text-decoration: none; font-size: .93rem; }
.sidebar a.nav:hover { color: var(--text); background: var(--raised); }
.sidebar a.nav.active { color: var(--text); background: var(--raised); }
.sidebar a.nav svg { width: 1.15rem; height: 1.15rem; flex: none; }

/* Artwork */
.art { background: linear-gradient(135deg, #2a2a33, #1d1d23); border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #4a4a55; flex: none; }
.art { position: relative; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.art-xl { width: 220px; height: 220px; border-radius: 14px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.7); }
.art-md { width: 64px; height: 64px; }
.art-sm { width: 44px; height: 44px; border-radius: 7px; }

/* Stats */
.stat { padding: 1rem 1.1rem; background: var(--surface); border-radius: 12px; }
.stat .value { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .caption { color: var(--muted); font-size: .85rem; }

/* Flash */
.flash { border-radius: 10px; padding: .7rem 1rem; font-size: .92rem; border: 1px solid; }
.flash-success { background: rgba(43,213,118,.08); border-color: rgba(43,213,118,.35); }
.flash-error { background: rgba(255,107,125,.08); border-color: rgba(255,107,125,.4); }
.flash-info { background: rgba(155,140,255,.08); border-color: rgba(155,140,255,.35); }

/* Checklist */
.check-row { display: flex; gap: .7rem; align-items: flex-start; padding: .5rem 0; }
.dot { width: 1.25rem; height: 1.25rem; border-radius: 999px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 800; margin-top: .1rem; }
.dot-ok { background: var(--green); color: var(--green-ink); }
.dot-no { border: 2px solid var(--line); }

/* Split bar */
.splitbar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--raised); }
.splitbar span { display: block; height: 100%; }

/* Upload slots */
.slot { border: 1px dashed var(--line); border-radius: 12px; padding: 1rem; }
.slot.has-file { border-style: solid; }
.progress { height: 6px; background: var(--raised); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--green); transition: width .2s; }

/* Player */
.player-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(20,20,22,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.play-btn { width: 2.75rem; height: 2.75rem; border-radius: 999px; background: var(--green); color: var(--green-ink); display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; flex: none; }
.play-btn:hover { background: #4be08c; }
.play-btn svg { width: 1.2rem; height: 1.2rem; }
.mini-play { width: 2.1rem; height: 2.1rem; border-radius: 999px; background: var(--raised); color: var(--text); border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.mini-play:hover { background: var(--green); color: var(--green-ink); }
.mini-play svg { width: .95rem; height: .95rem; }
.seg { display: inline-flex; background: var(--raised); border-radius: 99px; padding: 3px; }
.seg button, .seg a { text-decoration: none; padding: .25rem .7rem; border-radius: 99px; font-size: .78rem; font-weight: 600; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.seg button.on, .seg a.on { background: var(--text); color: var(--ground); }

/* Chips */
.chip { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 99px; font-size: .78rem; background: var(--raised); color: #cfcfd8; }
.chip-violet { background: rgba(155,140,255,.14); color: #cbc3ff; }
.chip-green { background: rgba(43,213,118,.12); color: #8ff0b8; }

/* Simple bar chart */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.bars > div { flex: 1; background: var(--green); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bars > div.zero { background: var(--raised); opacity: 1; }

/* Public hero */
.hero-wash { background: radial-gradient(1200px 400px at 10% -10%, rgba(43,213,118,.10), transparent 60%), radial-gradient(900px 400px at 100% 0%, rgba(155,140,255,.10), transparent 60%); }

/* Lyrics */
.lyrics-view { white-space: pre-wrap; font-size: 1.05rem; line-height: 1.8; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
