/* Promo Tracker VPS rebuild — soft claymorphism.
   10 themes (Forest Gold = forest, default), each with light + dark.
   Theme ids: sunset ocean grape mango berry navy charcoal teal wine forest */

* { box-sizing: border-box; }
:root {
  --radius: 20px;
  --radius-sm: 14px;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .3s, color .3s;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ---------- themes: light ---------- */
body[data-theme="forest"]  { --bg:#eef3e6; --surface:#ffffff; --surface2:#f4f7ee; --text:#1f2a1e; --muted:#5c6b58; --accent:#2e7d32; --accent2:#c9a227; --border:#d8e2cf; --shadow:0 10px 24px rgba(46,125,50,.16); --hero1:#2e7d32; --hero2:#c9a227; }
body[data-theme="sunset"]  { --bg:#fff1e6; --surface:#ffffff; --surface2:#fff7ef; --text:#33231a; --muted:#7a5c4a; --accent:#e8590c; --accent2:#f59f00; --border:#f3d9c2; --shadow:0 10px 24px rgba(232,89,12,.16); --hero1:#e8590c; --hero2:#f59f00; }
body[data-theme="ocean"]   { --bg:#e6f2f8; --surface:#ffffff; --surface2:#f0f7fb; --text:#17324a; --muted:#52708a; --accent:#1971c2; --accent2:#22b8cf; --border:#cfe3ef; --shadow:0 10px 24px rgba(25,113,194,.16); --hero1:#1971c2; --hero2:#22b8cf; }
body[data-theme="grape"]   { --bg:#f3e8fd; --surface:#ffffff; --surface2:#faf3ff; --text:#2d2140; --muted:#6b5a86; --accent:#7048e8; --accent2:#ae3ec9; --border:#e2d2f7; --shadow:0 10px 24px rgba(112,72,232,.16); --hero1:#7048e8; --hero2:#ae3ec9; }
body[data-theme="mango"]   { --bg:#fff4d6; --surface:#ffffff; --surface2:#fffaf0; --text:#3a2c12; --muted:#7a6a45; --accent:#f08c00; --accent2:#e8590c; --border:#f0dfae; --shadow:0 10px 24px rgba(240,140,0,.16); --hero1:#f08c00; --hero2:#e8590c; }
body[data-theme="berry"]   { --bg:#ffeef2; --surface:#ffffff; --surface2:#fff5f7; --text:#3d1a26; --muted:#7d5563; --accent:#c2255c; --accent2:#e64980; --border:#f6cfda; --shadow:0 10px 24px rgba(194,37,92,.16); --hero1:#c2255c; --hero2:#e64980; }
body[data-theme="navy"]    { --bg:#e8edf5; --surface:#ffffff; --surface2:#f1f4fa; --text:#1a2436; --muted:#55627c; --accent:#1c3f72; --accent2:#4dabf7; --border:#d2dbe8; --shadow:0 10px 24px rgba(28,63,114,.16); --hero1:#1c3f72; --hero2:#4dabf7; }
body[data-theme="charcoal"]{ --bg:#ececec; --surface:#ffffff; --surface2:#f5f5f5; --text:#212529; --muted:#5c636a; --accent:#343a40; --accent2:#868e96; --border:#dcdcdc; --shadow:0 10px 24px rgba(52,58,64,.16); --hero1:#343a40; --hero2:#868e96; }
body[data-theme="teal"]    { --bg:#e6fcf5; --surface:#ffffff; --surface2:#f0fdf9; --text:#123f31; --muted:#4d7265; --accent:#087f5b; --accent2:#12b886; --border:#c8ece0; --shadow:0 10px 24px rgba(8,127,91,.16); --hero1:#087f5b; --hero2:#12b886; }
body[data-theme="wine"]    { --bg:#fbeff0; --surface:#ffffff; --surface2:#fdf6f4; --text:#381c26; --muted:#74525f; --accent:#862e4b; --accent2:#c2255c; --border:#eecfd8; --shadow:0 10px 24px rgba(134,46,75,.16); --hero1:#862e4b; --hero2:#c2255c; }

/* ---------- themes: dark ---------- */
body[data-mode="dark"][data-theme="forest"]  { --bg:#141d15; --surface:#1e2b22; --surface2:#26382a; --text:#e8efe6; --muted:#9db39b; --accent:#69b578; --accent2:#d4af37; --border:#33463a; --shadow:0 10px 24px rgba(0,0,0,.45); --hero1:#2e7d32; --hero2:#c9a227; }
body[data-mode="dark"][data-theme="sunset"]  { --bg:#221610; --surface:#2e2019; --surface2:#3a2a1e; --text:#fbeadd; --muted:#c4a48d; --accent:#ff8c42; --accent2:#ffc078; --border:#4a3527; --shadow:0 10px 24px rgba(0,0,0,.45); --hero1:#e8590c; --hero2:#f59f00; }
body[data-mode="dark"][data-theme="ocean"]   { --bg:#0f1c26; --surface:#182a38; --surface2:#1f3648; --text:#dcedf7; --muted:#8fb0c7; --accent:#63a4dd; --accent2:#66d9e8; --border:#2a4256; --shadow:0 10px 24px rgba(0,0,0,.45); --hero1:#1971c2; --hero2:#22b8cf; }
body[data-mode="dark"][data-theme="grape"]   { --bg:#1b1426; --surface:#261d38; --surface2:#302547; --text:#ece4fa; --muted:#b3a3d1; --accent:#a78bfa; --accent2:#da77f2; --border:#3d3254; --shadow:0 10px 24px rgba(0,0,0,.45); --hero1:#7048e8; --hero2:#ae3ec9; }
body[data-mode="dark"][data-theme="mango"]   { --bg:#241c0d; --surface:#332912; --surface2:#40351a; --text:#fdf0d0; --muted:#c9b183; --accent:#fab005; --accent2:#ff8c42; --border:#524423; --shadow:0 10px 24px rgba(0,0,0,.45); --hero1:#f08c00; --hero2:#e8590c; }
body[data-mode="dark"][data-theme="berry"]   { --bg:#26121a; --surface:#351c26; --surface2:#452533; --text:#fbe3ea; --muted:#c99aad; --accent:#f06595; --accent2:#faa2c1; --border:#54303f; --shadow:0 10px 24px rgba(0,0,0,.45); --hero1:#c2255c; --hero2:#e64980; }
body[data-mode="dark"][data-theme="navy"]    { --bg:#101825; --surface:#182334; --surface2:#202e44; --text:#dde7f5; --muted:#93a5c2; --accent:#6ea8fe; --accent2:#74c0fc; --border:#2b3a52; --shadow:0 10px 24px rgba(0,0,0,.45); --hero1:#1c3f72; --hero2:#4dabf7; }
body[data-mode="dark"][data-theme="charcoal"]{ --bg:#16181a; --surface:#212427; --surface2:#2c3034; --text:#e9ecef; --muted:#adb5bd; --accent:#ced4da; --accent2:#868e96; --border:#383d41; --shadow:0 10px 24px rgba(0,0,0,.5); --hero1:#343a40; --hero2:#868e96; }
body[data-mode="dark"][data-theme="teal"]    { --bg:#0d1f19; --surface:#142e26; --surface2:#1b3d32; --text:#dcf5ea; --muted:#8fbfae; --accent:#38d9a9; --accent2:#63e6be; --border:#25483c; --shadow:0 10px 24px rgba(0,0,0,.45); --hero1:#087f5b; --hero2:#12b886; }
body[data-mode="dark"][data-theme="wine"]    { --bg:#221016; --surface:#301a22; --surface2:#3e222c; --text:#f8e3e9; --muted:#c29aa7; --accent:#e599af; --accent2:#f06595; --border:#4e2c38; --shadow:0 10px 24px rgba(0,0,0,.45); --hero1:#862e4b; --hero2:#c2255c; }

/* ---------- shared bits ---------- */
.btn-primary, .btn-secondary {
  border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 700; font-size: 16px;
  box-shadow: var(--shadow);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 6px; }
.panel-x {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 14px; line-height: 1;
}
.info-i {
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border-radius: 50%; border: 1px solid currentColor; font-size: 11px; font-style: normal;
  opacity: .35; cursor: pointer; vertical-align: middle; margin-left: 4px; flex: none;
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-weight: 600; z-index: 90; box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}

/* ---------- login / lamp ---------- */
.login-view { min-height: 100vh; }
.brick-wall {
  min-height: 100vh; position: relative; overflow: hidden;
  background-color: #16233f;
  background-image:
    radial-gradient(ellipse 90% 70% at 50% 38%, transparent 55%, rgba(0,0,0,.38) 100%),
    linear-gradient(rgba(255,255,255,.07) 0 2px, transparent 2px),
    linear-gradient(90deg, rgba(255,255,255,.07) 0 2px, transparent 2px),
    linear-gradient(rgba(6,12,26,.55) 3px, transparent 3px),
    linear-gradient(90deg, rgba(6,12,26,.55) 3px, transparent 3px),
    linear-gradient(rgba(6,12,26,.55) 3px, transparent 3px),
    linear-gradient(90deg, rgba(6,12,26,.55) 3px, transparent 3px);
  background-size: 100% 100%, 100px 36px, 100px 36px, 100px 36px, 100px 36px, 100px 36px, 100px 36px;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 50px 18px, 50px 18px;
  transition: background-color .6s;
}
.brick-wall.lit { background-color: #2a4f80; }
.lamp-wrap { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 120px; height: 150px; pointer-events: none; }
.lamp-cord { width: 4px; height: 46px; background: #0d1526; margin: 0 auto; }
.lamp-shade {
  width: 110px; height: 52px; margin: 0 auto; border-radius: 0 0 55px 55px / 0 0 52px 52px;
  background: linear-gradient(180deg, #3a5a86, #22385c); border: 2px solid #101d33;
}
.lamp-bulb {
  width: 34px; height: 34px; border-radius: 50%; margin: -6px auto 0;
  background: #4a4a4a; border: 2px solid #101d33; transition: background .4s, box-shadow .4s;
}
.brick-wall.lit .lamp-bulb { background: #ffe9a8; box-shadow: 0 0 42px 18px rgba(255, 214, 120, .75); }
.lamp-glow {
  position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: radial-gradient(ellipse 60% 42% at 50% 0%, rgba(255, 214, 120, .45), transparent 70%);
}
.brick-wall.lit .lamp-glow { opacity: 1; }
.rope {
  position: absolute; top: 150px; left: calc(50% + 52px); background: none; border: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; touch-action: none; cursor: grab;
}
.rope-line { display: block; width: 3px; height: 74px; background: #d8c49a; }
.rope-handle { display: block; width: 16px; height: 26px; border-radius: 8px; background: #e8dcc0; border: 1px solid #a08c5a; }
.rope.pulling { cursor: grabbing; }
.lamp-hint {
  position: absolute; top: 260px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.75);
  font-size: 15px; margin: 0; padding: 0 20px;
}
.login-card {
  position: relative; z-index: 5; max-width: 420px; margin: 300px auto 40px; padding: 26px 24px 22px;
  border-radius: 26px; background: rgba(255,255,255,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.6); box-shadow: 0 18px 44px rgba(0,0,0,.35); color: #1f2a1e;
}
body[data-mode="dark"] .login-card { background: rgba(30,42,34,.78); color: #e8efe6; }
.login-title { margin: 0 0 4px; font-size: 26px; }
.login-sub { margin: 0 0 18px; color: #5c6b58; }
body[data-mode="dark"] .login-sub { color: #9db39b; }
.auth-form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.auth-form input {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; font-size: 17px;
}
.pw-eye.holding { background: var(--surface2); }
.form-error { color: #c2255c; font-weight: 600; font-size: 14px; margin: 0 0 10px; }
.auth-form .btn-primary { width: 100%; margin-top: 4px; }
.auth-links { display: flex; justify-content: space-between; margin: 12px 0 0; }
.code-box {
  font-family: ui-monospace, monospace; font-size: 24px; letter-spacing: 2px; text-align: center;
  padding: 16px 10px; border-radius: var(--radius-sm); background: var(--surface2);
  border: 1px dashed var(--accent); margin: 14px 0; user-select: all; word-break: break-all;
}
#codeScreen .btn-secondary, #codeScreen .btn-primary { width: 100%; margin-top: 8px; }

/* ---------- dashboard ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.nav-btn { border: 1px solid var(--border); background: var(--surface2); color: var(--text); border-radius: 999px; padding: 8px 14px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.top-select { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.top-select select { padding: 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); max-width: 132px; }
.avatar-btn { border: 0; background: none; padding: 0; }
.avatar-img {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--hero1), var(--hero2)); color: #fff; font-size: 20px; font-weight: 800;
  background-size: cover; background-position: center; overflow: hidden; flex: none;
}
.avatar-img.big { width: 56px; height: 56px; font-size: 26px; }
.layout { display: flex; align-items: flex-start; }
.sidebar {
  position: sticky; top: 61px; width: 240px; flex: none; padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.side-profile { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.side-name { font-weight: 800; }
.side-sub { font-size: 12px; color: var(--muted); }
.side-btn { text-align: left; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--radius-sm); padding: 11px 14px; font-weight: 700; box-shadow: var(--shadow); }
.side-note { font-size: 12px; color: var(--muted); margin: 4px 2px; }
.main { flex: 1; min-width: 0; padding: 16px; max-width: 980px; margin: 0 auto; width: 100%; }
.mobile-chips { display: none; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 12px; font-weight: 700; }
.hero {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: linear-gradient(120deg, var(--hero1), var(--hero2)); color: #fff;
  border-radius: 26px; padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.hero h1 { margin: 0 0 4px; font-size: 28px; }
.hero p { margin: 0; opacity: .92; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); text-align: center; }
.stat-num { font-size: 24px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

.pr-card { background: var(--surface); border: 1px solid var(--border); border-radius: 26px; padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.pr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.pr-title { font-size: 21px; font-weight: 800; margin: 0; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); }
.badge.active { background: #e6f4ea; color: #2e7d32; border-color: #b7dfc0; }
body[data-mode="dark"] .badge.active { background: #1e3a26; color: #69b578; border-color: #2c5238; }
.pr-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; }
.pr-stat { background: var(--surface2); border-radius: var(--radius-sm); padding: 8px 6px; text-align: center; }
.pr-stat b { display: block; font-size: 16px; }
.pr-stat span { font-size: 11px; color: var(--muted); }
.pr-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.pr-controls label { font-size: 13px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pr-controls input { width: 96px; padding: 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); }
.pr-controls input.wa { width: 150px; }
.mini-btn { border: 1px solid var(--border); background: var(--surface2); color: var(--text); border-radius: 999px; padding: 8px 12px; font-weight: 700; }
.mini-btn.danger { color: #c2255c; }
.mini-btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.saved-tag { color: var(--accent); font-weight: 800; font-size: 13px; }

.movie-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface2); padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.movie-card.open { border-color: var(--accent); }
.movie-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.movie-name { font-weight: 800; font-size: 17px; }
.movie-meta { font-size: 13px; color: var(--muted); }
.movie-body { margin-top: 10px; }
.post-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--border); }
.post-row .post-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--accent); }
.post-row .post-link.nolink { color: var(--muted); font-style: italic; }
.paid-btn { border: 0; border-radius: 999px; padding: 7px 12px; font-weight: 700; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.paid-btn.paid { background: #e6f4ea; color: #2e7d32; border-color: #b7dfc0; }
body[data-mode="dark"] .paid-btn.paid { background: #1e3a26; color: #69b578; border-color: #2c5238; }
.icon-btn { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 4px; }
.movie-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.add-movie-btn { width: 100%; margin-top: 6px; }
.confirm-strip { background: #fdecef; border: 1px solid #f3b8c6; color: #8c1d3a; border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
body[data-mode="dark"] .confirm-strip { background: #3a1d26; border-color: #5c2f3d; color: #f2a9bd; }
.add-pr { width: 100%; margin-top: 4px; }
.foot-note { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 8px; }

/* ---------- popups ---------- */
.popup-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.popup {
  position: relative; width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto;
  background: var(--surface); color: var(--text); border-radius: 26px; padding: 22px; box-shadow: var(--shadow);
}
.popup h2 { margin: 0 0 10px; font-size: 20px; }
.popup p { line-height: 1.5; }
.popup textarea { width: 100%; min-height: 220px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface2); color: var(--text); padding: 12px; font-size: 14px; }
.popup .btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pill-row { display: flex; gap: 8px; margin: 10px 0; }
.pill { border: 1px solid var(--border); background: var(--surface2); color: var(--text); border-radius: 999px; padding: 7px 14px; font-weight: 700; }
.pill.sel { background: var(--accent); color: #fff; border-color: var(--accent); }
.opt-row { display: flex; gap: 8px; margin: 10px 0; }
.opt { flex: 1; border: 2px solid var(--border); background: var(--surface2); color: var(--text); border-radius: var(--radius-sm); padding: 12px 8px; font-weight: 700; }
.opt.sel { border-color: var(--accent); background: var(--surface); }
.form-grid label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.form-grid input { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface2); color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .mobile-chips { display: flex; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .pr-stats { grid-template-columns: repeat(3, 1fr); }
  .top-select span { display: none; }
  .top-select select { max-width: 96px; }
  .hero h1 { font-size: 23px; }
  .login-card { margin: 280px 16px 32px; }
}
@media (max-width: 420px) {
  .pr-stats { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 12px; }
  .topbar { padding: 8px 10px; }
}
