/* bounty dashboard */
:root {
  --bg: #08090c;
  --side: #0a0c10;
  --panel: #0c0f16;
  --panel-2: #0f1219;
  --panel-3: #12161e;
  --line: #151923;
  --line-2: #1d212b;
  --text: #e8eefb;
  --muted: #9ba5bb;
  --dim: #505a6e;
  --good: #4ade80;
  --bad: #f87171;
  --chart: #d3dff8;
  --teal: #dee7fa;
  --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(255, 255, 255, .22); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1d2129; 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 #11141b; 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: #0f1219; border: 1px solid #191d25; text-align: left; transition: border-color .2s, background .2s;
}
.switcher:hover { border-color: #222834; background: #11151d; }
.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: #1c2333; color: #e8eefb; 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: #0f1219; border: 1px solid #1e232e; 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: #161a25; }
.menu a .gicon { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.menu hr { border: 0; border-top: 1px solid #1c2028; 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: #bbc6dc; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.group a i { width: 16px; text-align: center; color: #8995af; font-size: 14px; transition: color .15s; }
.group a:hover { background: #10131a; color: #e2eafb; }
.group a.on { background: #151923; 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 #12161e; margin-top: 14px; }
.me .av { width: 34px; height: 34px; border-radius: 50%; background: #191d25; 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: #141820; }

/* ------------------------------------------------------------ main */
.main { min-width: 0; }
.topbar {
  height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 24px; border-bottom: 1px solid #10131a;
  position: sticky; top: 0; z-index: 10; background: rgba(8, 9, 12, .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: #292f3d; }
.crumbs b { color: #fff; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.crumbs .pageicon { width: 24px; height: 24px; border-radius: 7px; background: #12161e; display: grid; place-items: center; font-size: 11px; color: #c3d4f6; }
.hamburger { display: none; padding: 8px; border-radius: 8px; color: #bfd0f6; }
.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: #161a25; 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: #0d1017; border: 1px solid #191d25; border-radius: 11px; }
.seg button { padding: 6px 12px; border-radius: 8px; font-size: 12px; color: #9eadce; transition: background .15s, color .15s; }
.seg button:hover { color: #fff; }
.seg button.on { background: #1d212b; color: #fff; }
.seg .cal { color: #8a96af; 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: #c0cadf; 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: #c3d4f6; }
.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 #d3dff8; }
.big-chart .legend i.d { border-style: dashed; border-color: #939fb6; }
.chart-wrap { position: relative; height: 250px; margin-top: 18px; }
.chart-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.axis text { fill: #525c72; font-size: 11px; }
.tip {
  position: absolute; pointer-events: none; padding: 9px 12px; border-radius: 10px; background: #11141b; border: 1px solid #20242f;
  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 #d3dff8; }
.tip i.d { border-style: dashed; border-color: #939fb6; }
.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: #c0cadf; height: 38px; }
.table .row { height: 50px; background: #0e1118; border: 1px solid #151923; border-radius: 12px; margin-top: 7px; font-size: 13px; font-variant-numeric: tabular-nums; transition: background .15s, border-color .15s; }
.table .row:hover { background: #11141b; border-color: #1d212b; }
.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: #1c2028; 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: #0d1017; border: 1px dashed #1c2028; 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: #11151d; border: 1px solid #1c2028; display: grid; place-items: center; font-size: 15px; color: #cddbf7; }
.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 #12161e; }
.srow:first-of-type { border-top: 0; }
.set-card > h3 + .srow, .set-card > p.cd + .srow { border-top: 1px solid #12161e; }
.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: #0a0c10; border: 1px solid #1e232e; 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%, #8a96af 50%), linear-gradient(135deg, #8a96af 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: #2e3546; 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: #1e232e; transition: background .2s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #9ba5bb; transition: transform .25s var(--ease), background .2s; }
.toggle.on { background: #e3eafa; }
.toggle.on::after { transform: translateX(20px); background: #08090c; }
.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: #12161e; border: 1px solid #1e232e; font-size: 12.5px; }
.chip button { color: #99a3b9; 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: #aebbd6; }
.chip.opt.on { background: #e3eafa; color: #08090c; border-color: #e3eafa; }
.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 #1e232e; border-radius: 10px; background: #0a0c10; 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: #0b0e13; border: 1px solid #191d25; 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: #e3eafa; color: #08090c; 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: #12161e; color: #e3eafa; border: 1px solid #1e232e; }
.btn.ghost:hover { background: #151b27; }
.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: #0c0f16; border: 1px solid #161a25; width: max-content; margin-bottom: 18px; }
.tabs button { padding: 7px 14px; border-radius: 9px; color: #9dadce; font-size: 13px; font-weight: 600; }
.tabs button.on { background: #1c2028; color: #fff; }
.help { font-size: 12px; color: var(--muted); line-height: 1.7; }
.help code, .code { font-family: var(--mono); font-size: 12px; background: #12161e; border: 1px solid #1d212b; padding: 1px 6px; border-radius: 6px; color: #d4e0f9; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: #0d1017; border: 1px solid #1c2028; color: #c3d4f6; 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: #10131a; border: 1px solid #212733; 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: #c9d8f8; 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: #11151d; border: 1px solid #212733; 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: linear-gradient(180deg, #ffffff, #dfe8fb); color: #08090c; }
.login .discord:hover { background: #909cb5; }
.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: #232935; 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, #0d1017, #12161e, #0d1017); 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; }
}
