:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3efe9;
  --ink: #1c1917;
  --ink-2: #57534e;
  --ink-3: #a8a29e;
  --line: #e7e0d8;
  --accent: #b45309;
  --accent-ink: #ffffff;
  --accent-soft: #fdf0e0;
  --good: #15803d;
  --good-soft: #e8f5ec;
  --warn: #b91c1c;
  --warn-soft: #fdeaea;
  --chip: #ece7df;
}
[data-theme="dark"] {
  --bg: #171412;
  --surface: #211d1a;
  --surface-2: #2a2521;
  --ink: #f0ece7;
  --ink-2: #b8b0a7;
  --ink-3: #746c63;
  --line: #383129;
  --accent: #e8913a;
  --accent-ink: #1c1408;
  --accent-soft: #3a2c1a;
  --good: #4ade80;
  --good-soft: #1c3325;
  --warn: #f87171;
  --warn-soft: #3b1f1f;
  --chip: #332d27;
}
* { box-sizing: border-box; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
button { font: inherit; }
a { color: var(--accent); }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.logo .mark {
  width: 24px; height: 24px; border-radius: 6px; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}
.ver { font-size: 11px; color: var(--ink-3); font-weight: 400; }
nav { display: flex; gap: 2px; }
nav button { padding: 6px 11px; border-radius: 7px; color: var(--ink-2); background: none; border: none; font-size: 13px; cursor: pointer; }
nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
select.artist-select {
  font: 13px inherit; font-weight: 600; padding: 6px 10px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 190px;
}
.iconbtn { background: none; border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; cursor: pointer; color: var(--ink-2); font-size: 13px; }

/* ---- growth strip ---- */
.growth {
  display: flex; align-items: baseline; gap: 22px; padding: 12px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.growth .big { font-size: 21px; font-weight: 700; }
.growth .lbl { font-size: 11.5px; color: var(--ink-2); }
.growth .delta { font-weight: 600; font-size: 13px; }
.growth .delta.up { color: var(--good); }
.growth .delta.down { color: var(--warn); }
.growth .goal { margin-left: auto; font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.goalbar { width: 130px; height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.goalbar i { display: block; height: 100%; background: var(--accent); }
.growth .src { flex-basis: 100%; font-size: 10.5px; color: var(--ink-3); margin-top: -4px; }

main { padding: 18px 16px 60px; max-width: 1100px; margin: 0 auto; }
h2 { font-size: 15px; margin-bottom: 12px; }
h2 small { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.h-row { display: flex; align-items: center; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.h-row h2 { margin-bottom: 0; }
.h-row .spacer { flex: 1; }
.empty { color: var(--ink-3); padding: 30px 0; text-align: center; font-size: 13px; }

/* ---- release cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 9px; }
.card .head { display: flex; align-items: center; gap: 8px; }
.type { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; background: var(--chip); color: var(--ink-2); white-space: nowrap; }
.card .title { font-weight: 700; font-size: 14.5px; }
.card .date { margin-left: auto; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.card .artist-tag { font-size: 11.5px; color: var(--ink-2); }
.pitchline { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.pitchline.urgent { background: var(--warn-soft); color: var(--warn); }
.pitchline.ok { background: var(--good-soft); color: var(--good); }
.pitchline.muted { background: var(--surface-2); color: var(--ink-2); font-weight: 500; }
.prog { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); }
.progbar { flex: 1; height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.progbar i { display: block; height: 100%; background: var(--good); }
.card .foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.applied { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }

.btn { font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { border: none; color: var(--ink-2); background: none; }
.btn.danger { color: var(--warn); }
.btn:disabled { opacity: .5; cursor: default; }

/* ---- checklist ---- */
.checklist { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; }
.checklist .item { display: flex; gap: 8px; font-size: 12.5px; align-items: baseline; }
.checklist .item.done { color: var(--ink-3); text-decoration: line-through; }
.checklist .due { margin-left: auto; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }

/* ---- modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 14px; overflow-y: auto;
}
.modal { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal .m-head { padding: 15px 18px 4px; }
.modal h3 { font-size: 15px; }
.modal .m-sub { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.m-body { padding: 12px 18px; display: flex; flex-direction: column; gap: 10px; }
.m-row { display: flex; gap: 10px; flex-wrap: wrap; }
.field { flex: 1; min-width: 140px; }
.field label { display: block; font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px;
  font: 13px inherit; background: var(--surface); color: var(--ink);
}
.preview-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; border-top: 1px solid var(--line); }
.preview-tbl td { padding: 7px 6px; border-bottom: 1px solid var(--line); }
.preview-tbl td.off { color: var(--ink-3); white-space: nowrap; width: 1%; padding-right: 10px; }
.preview-tbl td.dt { text-align: right; color: var(--ink-2); white-space: nowrap; }
.preview-tbl tr.hot td { background: var(--accent-soft); font-weight: 600; }
.m-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 13px 18px; border-top: 1px solid var(--line); background: var(--surface-2); align-items: center; border-radius: 0 0 12px 12px; }
.m-foot .note { margin-right: auto; font-size: 11.5px; color: var(--ink-3); }

/* ---- calendar ---- */
.cal { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-grid .dow { padding: 6px 8px; font-size: 10.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.cal-grid .day { min-height: 74px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 5px 6px; font-size: 11px; color: var(--ink-3); }
.cal-grid .day:nth-child(7n) { border-right: none; }
.cal-grid .day.today { background: var(--surface-2); }
.evt { margin-top: 4px; padding: 3px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 600; background: var(--chip); border-left: 3px solid var(--artist-color, var(--ink-3)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt.release { background: var(--accent-soft); color: var(--accent); }
.evt.done { text-decoration: line-through; opacity: .6; }
.agenda { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.agenda .row { display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; align-items: center; }
.agenda .row:last-child { border-bottom: none; }
.agenda .d { width: 58px; font-weight: 700; color: var(--ink-2); font-size: 11.5px; flex-shrink: 0; }
.artist-chip { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--chip); border-left: 3px solid var(--artist-color, var(--ink-3)); white-space: nowrap; }
.agenda .done { color: var(--ink-3); text-decoration: line-through; }
@media (max-width: 640px) { .cal-grid { display: none; } }

/* ---- tables ---- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.status.planned { background: var(--accent-soft); color: var(--accent); }
.status.pitched, .status.awaiting { background: var(--chip); color: var(--ink-2); }
.status.added { background: var(--good-soft); color: var(--good); }
.status.passed { background: var(--warn-soft); color: var(--warn); }
.verdict { font-weight: 700; }
.verdict.kill { color: var(--warn); }
.verdict.scale { color: var(--good); }
.verdict.pending { color: var(--ink-3); font-weight: 400; }
@media (max-width: 640px) { .hide-phone { display: none; } }

/* ---- toast / footer ---- */
#toast {
  position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px;
  font-size: 13px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw;
}
#toast.show { opacity: 1; }
footer.app-foot {
  position: fixed; bottom: 0; left: 0; right: 0; padding: 8px 16px;
  border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3);
  display: flex; justify-content: space-between; background: var(--surface);
}

/* ---- login ---- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 26px 24px; display: flex; flex-direction: column; gap: 12px;
}
.login-hint { font-size: 12.5px; color: var(--ink-2); }
.login-error { font-size: 12.5px; color: var(--warn); font-weight: 600; }
.login-card input { border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; font: 13px inherit; background: var(--surface); color: var(--ink); }
.login-ver { font-size: 11px; color: var(--ink-3); text-align: center; }
