/* bounty dashboard */
:root {
  --bg: #0a0a0a;
  --side: #0d0d0d;
  --panel: #111111;
  --panel-2: #141414;
  --panel-3: #181818;
  --line: #1c1c1c;
  --line-2: #242424;
  --text: #ededed;
  --muted: #8b8b8b;
  --dim: #5f5f5f;
  --good: #4ade80;
  --bad: #f87171;
  --chart: #d7dde0;
  --teal: #92c8d2;
  --ment-bg: rgba(88, 101, 242, .24);
  --ment-fg: #c9cdfb;
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Satoshi', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
::selection { background: rgba(146, 200, 210, .3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232323; border-radius: 10px; border: 3px solid var(--bg); }

.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }

/* ------------------------------------------------------------ sidebar */
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side);
  border-right: 1px solid #161616; padding: 20px 14px 14px; display: flex; flex-direction: column;
}
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; font-size: 19px; font-weight: 600; }
.side .brand img { width: 30px; height: 30px; object-fit: contain; }
.switcher {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 14px;
  background: #141414; border: 1px solid #1f1f1f; text-align: left; transition: border-color .2s, background .2s;
}
.switcher:hover { border-color: #2b2b2b; background: #171717; }
.switcher .gicon { width: 42px; height: 42px; border-radius: 11px; flex: none; }
.switcher small { display: block; font-size: 11px; color: var(--muted); }
.switcher b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switcher .chev { margin-left: auto; color: var(--dim); font-size: 12px; }
.gicon { display: grid; place-items: center; background: #1f2527; color: #e2eff1; font-weight: 700; overflow: hidden; }
.gicon img { width: 100%; height: 100%; object-fit: cover; }
.menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 320px; overflow-y: auto;
  background: #141414; border: 1px solid #262626; border-radius: 14px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .18s, transform .18s var(--ease);
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; font-size: 13px; }
.menu a:hover, .menu a.on { background: #1d1d1d; }
.menu a .gicon { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.menu hr { border: 0; border-top: 1px solid #222; margin: 6px 4px; }
.nav-groups { margin-top: 18px; display: grid; gap: 18px; flex: 1; }
.group h6 { font-size: 13px; color: var(--muted); font-weight: 500; padding: 0 10px 8px; }
.group a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: #b7b7b7; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.group a i { width: 16px; text-align: center; color: #767676; font-size: 14px; transition: color .15s; }
.group a:hover { background: #151515; color: #e7e7e7; }
.group a.on { background: #1c1c1c; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.group a.on i { color: #fff; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 6px 2px; border-top: 1px solid #181818; margin-top: 14px; }
.me .av { width: 34px; height: 34px; border-radius: 50%; background: #1f1f1f; flex: none; overflow: hidden; display: grid; place-items: center; }
.me .av img { width: 100%; height: 100%; object-fit: cover; }
.me b { display: block; font-size: 14px; }
.me small { color: var(--muted); font-size: 12px; }
.me button { margin-left: auto; color: var(--muted); padding: 6px; border-radius: 8px; }
.me button:hover { color: #fff; background: #1a1a1a; }

/* ------------------------------------------------------------ main */
.main { min-width: 0; }
.topbar {
  height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 24px; border-bottom: 1px solid #151515;
  position: sticky; top: 0; z-index: 10; background: rgba(10,10,10,.85); backdrop-filter: blur(10px);
}
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.crumbs i { font-size: 13px; }
.crumbs .sep { color: #333; }
.crumbs b { color: #fff; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.crumbs .pageicon { width: 24px; height: 24px; border-radius: 7px; background: #181818; display: grid; place-items: center; font-size: 11px; color: #cfcfcf; }
.hamburger { display: none; padding: 8px; border-radius: 8px; color: #ccc; }
.content { max-width: 1560px; margin: 0 auto; padding: 44px 56px 120px; }

/* page header */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.hello h1 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.hello h1 .dot { width: 18px; height: 18px; border-radius: 50%; background: #1d1d1d; overflow: hidden; }
.hello h1 .dot img { width: 100%; height: 100%; }
.hello p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.hello p b { color: #fff; font-weight: 600; }
.seg { display: flex; align-items: center; gap: 2px; padding: 4px; background: #121212; border: 1px solid #1f1f1f; border-radius: 11px; }
.seg button { padding: 6px 12px; border-radius: 8px; font-size: 12px; color: #9a9a9a; transition: background .15s, color .15s; }
.seg button:hover { color: #fff; }
.seg button.on { background: #242424; color: #fff; }
.seg .cal { color: #777; padding: 6px 10px; font-size: 13px; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 26px 26px 20px; }
.kpi-label { font-size: 12px; color: #bdbdbd; font-weight: 500; }
.kpi-num { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-num small { font-size: 18px; font-weight: 600; }
.delta { font-size: 11.5px; color: var(--good); margin-top: 4px; }
.delta.down { color: var(--bad); }
.delta span { color: var(--muted); }
.big-chart { position: relative; }
.big-chart .legend { position: absolute; right: 26px; top: 26px; display: grid; gap: 6px; font-size: 12px; color: #cfcfcf; }
.big-chart .legend span { display: flex; align-items: center; gap: 8px; }
.big-chart .legend i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #d7dde0; }
.big-chart .legend i.d { border-style: dashed; border-color: #7c8588; }
.chart-wrap { position: relative; height: 250px; margin-top: 18px; }
.chart-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.axis text { fill: #626262; font-size: 11px; }
.tip {
  position: absolute; pointer-events: none; padding: 9px 12px; border-radius: 10px; background: #161616; border: 1px solid #272727;
  font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); opacity: 0; transition: opacity .12s; white-space: nowrap; z-index: 2;
}
.tip .d { color: var(--muted); margin-bottom: 4px; }
.tip div { display: flex; gap: 8px; align-items: center; }
.tip b { font-variant-numeric: tabular-nums; }
.tip i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid #d7dde0; }
.tip i.d { border-style: dashed; border-color: #7c8588; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 18px; }
.kpi { position: relative; overflow: hidden; min-height: 164px; }
.kpi .spark { position: absolute; left: 0; right: 0; bottom: 0; height: 60px; }
.tables { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 30px; }
.tables h3, .section-title { font-size: 15px; font-weight: 700; }
.tables .sub, .section-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.table { margin-top: 20px; }
.table .head, .table .row { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.1fr; align-items: center; gap: 10px; padding: 0 16px; }
.table .head { font-size: 12.5px; color: #bdbdbd; height: 38px; }
.table .row { height: 50px; background: #131313; border: 1px solid #1c1c1c; border-radius: 12px; margin-top: 7px; font-size: 13px; font-variant-numeric: tabular-nums; transition: background .15s, border-color .15s; }
.table .row:hover { background: #161616; border-color: #242424; }
.mention { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 8px; border-radius: 6px; background: var(--ment-bg); color: var(--ment-fg); font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.who img, .who .ph { width: 26px; height: 26px; border-radius: 50%; background: #222; flex: none; }
.who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ring { display: inline-flex; align-items: center; gap: 8px; }
.ring svg { width: 18px; height: 18px; transform: rotate(-90deg); }
.table .up { color: var(--good); } .table .down { color: var(--bad); }
.empty-row { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 13px; background: #121212; border: 1px dashed #222; border-radius: 12px; margin-top: 8px; }

/* ------------------------------------------------------------ settings pages */
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 12px; }
.page-head h1 .pi { width: 36px; height: 36px; border-radius: 11px; background: #171717; border: 1px solid #222; display: grid; place-items: center; font-size: 15px; color: #d7d7d7; }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 720px; line-height: 1.6; }
.stack { display: grid; gap: 18px; max-width: 980px; }
.set-card { padding: 6px 0; }
.set-card > h3 { padding: 18px 24px 4px; font-size: 14px; font-weight: 700; }
.set-card > p.cd { padding: 0 24px 8px; color: var(--muted); font-size: 12.5px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 24px; border-top: 1px solid #181818; }
.srow:first-of-type { border-top: 0; }
.set-card > h3 + .srow, .set-card > p.cd + .srow { border-top: 1px solid #181818; }
.srow .lbl b { display: block; font-size: 14px; font-weight: 600; }
.srow .lbl span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.5; max-width: 520px; }
.srow .ctl { flex: none; width: min(340px, 45%); display: flex; justify-content: flex-end; }
.srow.wide { flex-direction: column; align-items: stretch; }
.srow.wide .ctl { width: 100%; justify-content: stretch; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; background: #0d0d0d; border: 1px solid #262626; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input:focus { border-color: #3a3a3a; box-shadow: 0 0 0 4px rgba(255,255,255,.04); }
.input.num { width: 120px; text-align: right; }
.with-suffix { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.toggle { position: relative; width: 44px; height: 24px; border-radius: 99px; background: #262626; transition: background .2s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #8a8a8a; transition: transform .25s var(--ease), background .2s; }
.toggle.on { background: #e8e8e8; }
.toggle.on::after { transform: translateX(20px); background: #0a0a0a; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: #181818; border: 1px solid #262626; font-size: 12.5px; }
.chip button { color: #888; font-size: 11px; }
.chip button:hover { color: #fff; }
.chip .sw { width: 9px; height: 9px; border-radius: 50%; }
.chip.opt { cursor: pointer; transition: background .15s, border-color .15s, color .15s; color: #aaa; }
.chip.opt.on { background: #e8e8e8; color: #0a0a0a; border-color: #e8e8e8; }
.add-select { width: auto; min-width: 160px; height: 32px; font-size: 12.5px; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 40px; height: 40px; border: 1px solid #262626; border-radius: 10px; background: #0d0d0d; padding: 4px; }
.thresholds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; }
.thresholds label { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #0f0f0f; border: 1px solid #1f1f1f; font-size: 13px; }
.thresholds .input { width: 80px; height: 34px; text-align: right; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px;
  background: #e8e8e8; color: #0a0a0a; font-weight: 700; font-size: 13px; transition: transform .15s, background .15s, opacity .15s;
}
.btn:hover { background: #fff; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: #181818; color: #e8e8e8; border: 1px solid #262626; }
.btn.ghost:hover { background: #1e1e1e; }
.btn.danger { background: rgba(248,113,113,.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.25); }
.btn.danger:hover { background: rgba(248,113,113,.2); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #111; border: 1px solid #1d1d1d; width: max-content; margin-bottom: 18px; }
.tabs button { padding: 7px 14px; border-radius: 9px; color: #999; font-size: 13px; font-weight: 600; }
.tabs button.on { background: #222; color: #fff; }
.help { font-size: 12px; color: var(--muted); line-height: 1.7; }
.help code, .code { font-family: var(--mono); font-size: 12px; background: #181818; border: 1px solid #242424; padding: 1px 6px; border-radius: 6px; color: #ddd; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: #121212; border: 1px solid #222; color: #cfcfcf; line-height: 1.6; }
.notice i { margin-top: 3px; color: var(--teal); }

/* save bar */
.savebar {
  position: fixed; left: calc(128px + 50%); bottom: 22px; z-index: 40; width: min(640px, calc(100vw - 300px));
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 12px 12px 20px; border-radius: 14px;
  background: #151515; border: 1px solid #2a2a2a; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  visibility: hidden; transform: translate(-50%, calc(100% + 60px)); transition: transform .35s var(--ease), visibility 0s .35s;
}
.savebar.show { visibility: visible; transform: translate(-50%, 0); transition: transform .35s var(--ease), visibility 0s; }
.savebar span { color: #d5d5d5; font-weight: 600; }
.savebar div { display: flex; gap: 8px; }
.savebar.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { margin-left: -8px; } 40%, 80% { margin-left: 8px; } }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 50; }
.toast { padding: 12px 16px; border-radius: 12px; background: #171717; border: 1px solid #2a2a2a; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 13px; display: flex; gap: 10px; align-items: center; animation: tin .3s var(--ease); max-width: 380px; }
.toast.err i { color: var(--bad); } .toast.ok i { color: var(--good); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

/* guild picker / login */
.center { min-height: 100vh; display: grid; place-items: center; padding: 30px; }
.login { width: min(420px, 100%); text-align: center; padding: 40px 34px; }
.login img { width: 96px; height: 96px; object-fit: contain; }
.login h1 { font-size: 22px; margin-top: 14px; }
.login p { color: var(--muted); margin: 8px 0 26px; line-height: 1.6; }
.login .btn { width: 100%; height: 46px; font-size: 14px; }
.login .btn + .btn { margin-top: 10px; }
.login .discord { background: #5865f2; color: #fff; }
.login .discord:hover { background: #6d78f5; }
.login .err { color: var(--bad); font-size: 13px; margin-bottom: 14px; }
.picker { max-width: 1100px; margin: 0 auto; padding: 60px 30px; }
.picker h1 { font-size: 26px; }
.picker > p { color: var(--muted); margin-top: 8px; }
.gg { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 28px; }
.gcard { padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; transition: border-color .2s, transform .25s var(--ease); }
.gcard:hover { border-color: #2c2c2c; transform: translateY(-3px); }
.gcard .gicon { width: 72px; height: 72px; border-radius: 22px; font-size: 24px; }
.gcard b { font-size: 15px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard small { color: var(--muted); }
.gcard .btn { width: 100%; }

/* voicemaster empty state */
.hero-empty { padding: 40px; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; }
.hero-empty h2 { font-size: 20px; }
.hero-empty p { color: var(--muted); margin: 8px 0 18px; line-height: 1.6; max-width: 520px; }
.vm-mini { width: 250px; border-radius: 16px; background: #2b2d31; padding: 12px; font-size: 13px; color: #949ba4; font-family: 'gg sans', var(--font); }
.vm-mini div { padding: 6px 8px; border-radius: 6px; display: flex; gap: 8px; align-items: center; }
.vm-mini .c { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.vm-mini .l { color: #f2f3f5; background: rgba(255,255,255,.05); }
.skeleton { background: linear-gradient(90deg, #121212, #181818, #121212); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.fade-in { animation: fin .35s var(--ease); }
@keyframes fin { from { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1200px) { .content { padding: 36px 32px 120px; } .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 60; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .side.open { transform: none; box-shadow: 30px 0 80px rgba(0,0,0,.6); }
  .hamburger { display: inline-flex; }
  .tables { grid-template-columns: 1fr; }
  .savebar { left: 50%; width: calc(100vw - 32px); }
  .hero-empty { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .content { padding: 26px 16px 120px; }
  .kpis { grid-template-columns: 1fr; }
  .srow { flex-direction: column; align-items: stretch; }
  .srow .ctl { width: 100%; justify-content: flex-start; }
  .thresholds { grid-template-columns: 1fr; }
  .table .head, .table .row { grid-template-columns: 1.4fr .9fr .9fr; }
  .table .head > :nth-child(3), .table .row > :nth-child(3) { display: none; }
}
