/* BtcInOutAlert 2026 — brand: red #ee0606, green outflow #1e9e33, Open Sans */
:root {
  --red: #ee0606;
  --green: #1e9e33;
  --ink: #14171a;
  --muted: #6d6d6d;
  --line: #e3e3e3;
  --bg: #ffffff;
  --bg2: #f6f7f8;
  --sidebar-w: 250px;
  --topbar-h: 54px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Open Sans", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: inherit; }

/* ---------- layout: sidebar + content ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
}
.content { margin-left: var(--sidebar-w); padding: 1.4rem 1.8rem 2rem; min-height: 100vh;
  display: flex; flex-direction: column; }
.content-plain { min-height: 100vh; }

.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 800; }
.brand img { height: 34px; width: 34px; object-fit: contain; }
.brand-side { padding: 1rem 1rem .9rem; border-bottom: 1px solid var(--line); font-size: 1.05rem; }

.sidenav { flex: 1; overflow-y: auto; padding: .5rem 0; }
.navgroup { padding: .8rem 1rem .2rem; color: var(--muted); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.navsection { margin-top: .6rem; padding-top: .3rem; border-top: 1px solid rgba(238,6,6,.35); }
.navsection .precise-hdr { color: #ee0606; }
.precise-tag { display: inline-block; font-size: .58rem; font-weight: 700; color: #fff;
  background: #ee0606; padding: 1px 6px; border-radius: 999px; margin-left: .35rem;
  vertical-align: middle; letter-spacing: .02em; text-transform: none; }
.navlink { display: block; padding: .5rem 1rem; text-decoration: none; color: var(--ink);
  border-left: 3px solid transparent; }
.navlink:hover { background: var(--bg2); border-left-color: var(--red); }
.navlink.sub { padding-left: 1.4rem; font-size: .92rem; color: #333; }
.sidefoot { border-top: 1px solid var(--line); padding: .7rem 1rem; display: flex;
  flex-direction: column; gap: .3rem; font-size: .85rem; }
.sidefoot .who { color: var(--muted); }
.sidefoot .logout { color: var(--red); font-weight: 700; text-decoration: none; }

/* mobile top bar + hamburger (hidden on desktop) */
.mobilebar { display: none; }
.overlay { display: none; }
.hamburger { width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer;
  padding: 8px; display: inline-flex; flex-direction: column; justify-content: space-between; }
.hamburger span { display: block; height: 3px; width: 100%; background: var(--ink); border-radius: 2px;
  transition: transform .3s ease, opacity .2s ease; }

/* ---------- headings ---------- */
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.grp-title { color: var(--muted); margin: 1rem 0 .4rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.desc { color: var(--muted); margin: .2rem 0; }
.stamp { color: var(--muted); font-size: .85rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: .9rem; text-decoration: none;
  color: var(--ink); background: #fff; display: flex; flex-direction: column; gap: .35rem;
  transition: box-shadow .15s, border-color .15s; }
.card:hover { border-color: var(--red); box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.card-name { font-weight: 700; }
.card-value { font-size: 1.3rem; font-weight: 800; }
.card-value.pos, .num.pos { color: var(--green); }
.card-value.neg, .num.neg { color: var(--red); }
.card-meta { color: var(--muted); font-size: .8rem; }

/* ---------- report card (polished pill design) ---------- */
.report-card { max-width: 470px; margin: .3rem auto 0; background: #fff; border: 1px solid #eceef1;
  border-radius: 20px; padding: 1.6rem 1.6rem 1.2rem; box-shadow: 0 10px 30px rgba(20,40,80,.07); }
.rc-head { text-align: center; margin-bottom: 1.1rem; }
.rc-logo { height: 54px; margin-bottom: .2rem; }
.rc-head h2 { border: 0; margin: .15rem 0 0; font-size: 1.95rem; font-weight: 800; color: #16202e; letter-spacing: -.01em; }
.rc-sub { color: #2f6fdb; font-size: 1rem; font-weight: 800; margin: .35rem 0 .1rem; }
.rc-link { color: #2f6fdb; font-size: .95rem; text-decoration: underline; display: inline-flex;
  align-items: center; gap: .35rem; }
.rc-link svg { width: 15px; height: 15px; }

.rc-rows { display: flex; flex-direction: column; gap: .55rem; }
.rc-row { display: flex; align-items: stretch; border: 1.5px solid #e8ebef; border-radius: 13px;
  overflow: hidden; background: #fff; min-height: 56px; }
.rc-ic { display: flex; align-items: center; padding-left: .95rem; color: #9aa4ad; }
.rc-ic svg { width: 23px; height: 23px; }
.rc-lab { flex: 1; display: flex; align-items: center; padding-left: .7rem; font-weight: 800;
  font-size: 1.12rem; color: #1c2530; }
.rc-val { min-width: 40%; display: flex; align-items: center; justify-content: flex-end;
  padding: .5rem 1.15rem; font-weight: 800; font-size: 1.18rem; font-variant-numeric: tabular-nums; color: #1c2530; }

/* per-state coloring */
.rc-flat .rc-val { background: #f4f6f8; }
.rc-neg .rc-ic, .rc-neg-strong .rc-ic { color: #e53935; }
.rc-pos .rc-ic, .rc-pos-strong .rc-ic { color: #26a544; }
.rc-neg .rc-val { background: #fdeaea; color: #e01e1e; }
.rc-pos .rc-val { background: #e9f7ee; color: #1e9e33; }
.rc-neg-strong .rc-val { background: #e53935; color: #fff; }
.rc-pos-strong .rc-val { background: #33ad51; color: #fff; }
.rc-total { background: #1663c7; border-color: #1663c7; }
.rc-total .rc-ic, .rc-total .rc-lab { color: #fff; }
.rc-total .rc-val { background: transparent; color: #fff; font-size: 1.35rem; }
.rc-multi .rc-val { min-width: 0; flex: 1; border-left: 1.5px solid #eef0f3; }

/* section divider (e.g. Data Rolling) */
.rc-sec { display: flex; align-items: center; gap: .55rem; margin: 1.3rem .2rem .8rem; color: #2f6fdb;
  font-weight: 800; font-size: 1.2rem; }
.rc-sec svg { width: 22px; height: 22px; flex: 0 0 auto; }
.rc-sec::before, .rc-sec::after { content: ""; flex: 1; height: 1.5px; background: #e8ebef; }
.rc-sec span { flex: 0 0 auto; }

.rc-foot { background: #eef3fb; border-radius: 13px; margin-top: .9rem; padding: .75rem; text-align: center; }
.rc-foot-label { display: inline-flex; align-items: center; gap: .35rem; color: #e01e1e; font-weight: 800; font-size: .82rem; }
.rc-foot-label svg { width: 16px; height: 16px; }
.rc-foot-time { font-weight: 800; font-size: 1.15rem; color: #16202e; margin-top: .1rem; }
.rc-empty { text-align: center; color: var(--muted); }
.rc-supplynote { text-align: center; color: var(--muted); font-size: .8rem; margin: .3rem 0 0; }
/* ---- mobile: single-column but compact, so the whole report fits one phone screen ---- */
@media (max-width: 560px) {
  .report-card { max-width: 100%; padding: .85rem .8rem .75rem; border-radius: 14px; }
  .rc-head { margin-bottom: .5rem; }
  .rc-logo { height: 32px; }
  .rc-head h2 { font-size: 1.2rem; }
  .rc-sub { font-size: .78rem; margin: .1rem 0 .03rem; }
  .rc-link { font-size: .76rem; }
  .rc-rows { gap: .32rem; }
  .rc-row { min-height: 38px; border-radius: 10px; }
  .rc-ic { padding-left: .65rem; }
  .rc-ic svg { width: 18px; height: 18px; }
  .rc-lab { font-size: .92rem; padding-left: .5rem; }
  .rc-val { min-width: 34%; font-size: .98rem; padding: .3rem .7rem; }
  .rc-total .rc-val { font-size: 1.08rem; }
  .rc-sec { margin: .55rem .1rem .4rem; font-size: 1rem; }
  .rc-sec svg { width: 18px; height: 18px; }
  .rc-foot { padding: .5rem; margin-top: .5rem; }
  .rc-foot-label { font-size: .74rem; }
  .rc-foot-time { font-size: 1rem; }
  .rc-supplynote { font-size: .74rem; }
}

/* ---------- chart ---------- */
.chart-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
#chart-card { background: #fff; border: 1px solid #eceef1; border-radius: 16px;
  padding: 1rem 1rem 1.1rem; box-shadow: 0 6px 20px rgba(20,40,80,.05); }
.chart-card-title { border: 0; text-align: center; margin: .1rem 0 .8rem;
  font-size: 1.4rem; font-weight: 800; color: #16202e; letter-spacing: -.01em; }
#chart-card .chart-wrap { margin: 0; }
.chart-nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .6rem 0; }
.ranges button { background: #fff; color: var(--ink); border: 1px solid var(--line); padding: .3rem .7rem;
  border-radius: 6px; cursor: pointer; }
.ranges button.active, .ranges button:hover { background: var(--red); color: #fff; border-color: var(--red); }
.avgbtn { background: #fff; color: var(--ink); border: 1px solid var(--line); padding: .3rem .7rem;
  border-radius: 6px; cursor: pointer; font-weight: 700; }
.avgbtn:hover { border-color: #2f6fdb; color: #2f6fdb; }
.avgbtn.active { background: #2f6fdb; color: #fff; border-color: #2f6fdb; }
.chart-wrap { position: relative; height: 60vh; min-height: 340px; border: 1px solid var(--line);
  border-radius: 10px; padding: .5rem; background: #fff; }
.hint { color: var(--muted); font-size: .85rem; }
.recon-key { display: inline-block; width: 16px; height: 11px; background: rgba(120,120,140,0.28);
  border: 1px solid #bbb; vertical-align: middle; margin-right: .2rem; }

/* ---------- forms / admin ---------- */
input, select, button { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 7px; }
button, .btn { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; cursor: pointer; }
button:hover, .btn:hover { filter: brightness(.92); }
button.danger { background: #fff; color: var(--red); }
.btn.ghost { background: #fff; color: var(--ink); }
.grid { border-collapse: collapse; width: 100%; margin: .6rem 0; }
.grid th, .grid td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; font-size: .92rem; }
.grid th { background: var(--bg2); }
td.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
td.actions form { display: flex; gap: .4rem; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; }

.flash { margin: 0 0 1rem; }
.flash p { background: #fff3f3; border: 1px solid var(--red); padding: .6rem .9rem; border-radius: 8px; word-break: break-all; }

/* ---------- admin: monitored addresses ---------- */
.addr-summary { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; color: var(--muted);
  margin: .3rem 0 1.1rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg2); color: var(--ink); text-decoration: none; font-size: .82rem; }
.chip:hover { border-color: var(--red); }
.chip.active { border-color: var(--red); color: var(--red); font-weight: 700; }
.chip b { font-weight: 800; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .82rem; font-variant-numeric: tabular-nums; }
.addr-cell { max-width: 320px; overflow-x: auto; white-space: nowrap; }
.tag-form { display: flex; gap: .35rem; align-items: center; }
.tag-form input { width: 130px; padding: .3rem .45rem; }
.mini { padding: .3rem .55rem; font-size: .82rem; }
.status-on { color: var(--green); font-weight: 700; }
.status-off { color: var(--muted); font-weight: 700; }
.view-tabs { display: flex; gap: .5rem; margin: 0 0 1rem; }
.pager { display: flex; align-items: center; gap: .8rem; margin: .9rem 0 .3rem; flex-wrap: wrap; }
.pager a { text-decoration: none; border: 1px solid var(--line); padding: .35rem .75rem; border-radius: 7px; color: var(--ink); }
.pager a:hover { border-color: var(--red); }
.pager .muted { color: var(--muted); font-size: .88rem; }

/* ---------- live feed (Telegram-channel style) ---------- */
.feed-status { font-size: .75rem; color: #fff; background: var(--green); padding: .15rem .5rem;
  border-radius: 999px; font-weight: 700; align-self: center; }
.feed { max-width: 640px; display: flex; flex-direction: column; gap: .55rem; }
.msg { display: flex; gap: .6rem; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px;
  padding: .6rem .75rem; background: #fff; }
.msg.inflow { border-left-color: var(--green); }
.msg.outflow { border-left-color: var(--red); }
.msg.info { border-left-color: #9aa4ad; }
.msg-badge { flex: 0 0 auto; min-width: 34px; height: 22px; border-radius: 999px; font-size: .7rem;
  font-weight: 800; color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0 .4rem; }
.msg.inflow .msg-badge { background: var(--green); }
.msg.outflow .msg-badge { background: var(--red); }
.msg.info .msg-badge { background: #9aa4ad; }
.msg-body { flex: 1; min-width: 0; }
.msg-title { font-size: .98rem; }
.msg-entity { font-weight: 700; }
.msg-text { color: #333; font-size: .9rem; margin-top: .15rem; }
.msg-meta { color: var(--muted); font-size: .78rem; margin-top: .25rem; }
.msg-meta a { color: #2f6fb0; }
.msg-src { text-transform: uppercase; letter-spacing: .03em; }
@keyframes msgIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.msg-new { animation: msgIn .35s ease; }

/* feed filter bar (per-flow + movements/info) */
.feed-filters { display: flex; flex-direction: column; gap: .45rem; max-width: 640px; margin: 0 0 1rem; }
.feed-tabs { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.feed-tabs-label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  font-weight: 700; margin-right: .2rem; min-width: 42px; }
.chip.mv.active { border-color: var(--green); color: var(--green); }
.chip.nfo.active { border-color: #9aa4ad; color: #556; }
.feed-thresholds { align-items: center; gap: .5rem; margin: 0 0 .9rem; flex-wrap: wrap; }
.feed-thresholds label { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem;
  color: var(--muted); font-weight: 700; }
.feed-thresholds .minbtc { width: 92px; }

/* movement readability + size tiers (highlight the substantial ones) */
.msg-amt { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.msg.inflow .msg-amt { color: var(--green); }
.msg.outflow .msg-amt { color: var(--red); }
.msg-dir { font-weight: 800; font-size: .66rem; letter-spacing: .05em; border: 1px solid currentColor;
  border-radius: 999px; padding: 0 .35rem; vertical-align: middle; }
.msg.inflow .msg-dir { color: var(--green); }
.msg.outflow .msg-dir { color: var(--red); }
.mv-flag { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .06em; color: #fff;
  padding: .06rem .4rem; border-radius: 999px; vertical-align: middle; }
.mv-flag.large { background: #e08a00; }
.mv-flag.whale { background: #111; }
.z-badge { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .02em;
  padding: .04rem .34rem; border-radius: 999px; vertical-align: middle; border: 1px solid; }
.z-badge.z-lo { color: #7a7a7a; border-color: #d8d8d8; }
.z-badge.z-mid { color: #b26a00; border-color: #e0a04d; background: #fff6e9; }
.z-badge.z-hi { color: #fff; background: #7a1fa2; border-color: #7a1fa2; }
.int-badge { display: inline-block; font-size: .62rem; font-weight: 700; color: #66708a;
  border: 1px dashed #b9bfd0; background: #f3f5fa; padding: .04rem .34rem; border-radius: 999px; vertical-align: middle; }
.msg-internal { opacity: .6; }
.msg.mv-large { border-left-width: 6px; }
.msg.mv-whale { border-left-width: 8px; box-shadow: 0 1px 10px rgba(0,0,0,.08); }
.msg.mv-whale.inflow { background: linear-gradient(90deg, rgba(30,158,51,.07), #fff 60%); }
.msg.mv-whale.outflow { background: linear-gradient(90deg, rgba(238,6,6,.06), #fff 60%); }
.msg.mv-whale .msg-amt { font-size: 1.3rem; }

.foot { margin-top: auto; padding-top: 1.5rem; color: var(--muted); font-size: .8rem; }

/* ---------- login ---------- */
.login-box { max-width: 380px; margin: 9vh auto; text-align: center; border: 1px solid var(--line);
  border-radius: 12px; padding: 2rem; }
.login-logo { width: 84px; }
.login-box .sub { color: var(--muted); margin-top: -.4rem; }
.login-box form { display: flex; flex-direction: column; gap: .8rem; text-align: left; margin-top: 1rem; }
.login-box label { font-size: .85rem; font-weight: 600; display: flex; flex-direction: column; gap: .25rem; }

/* ---------- responsive: mobile drawer ---------- */
@media (max-width: 860px) {
  .mobilebar { display: flex; align-items: center; gap: .5rem; height: var(--topbar-h);
    padding: 0 .6rem; border-bottom: 3px solid var(--red); position: sticky; top: 0; background: #fff; z-index: 30; }
  .mobilebar .brand { font-size: 1rem; }
  .content { margin-left: 0; padding: 1rem 1rem 2rem; }

  .sidebar { transform: translateX(-100%); transition: transform .3s ease; box-shadow: 2px 0 16px rgba(0,0,0,.15); }
  body.menu-open .sidebar { transform: translateX(0); }
  .overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4);
    opacity: 0; pointer-events: none; transition: opacity .3s ease; z-index: 35; }
  body.menu-open .overlay { opacity: 1; pointer-events: auto; }

  /* animate hamburger into an X when open */
  body.menu-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.menu-open .hamburger span:nth-child(2) { opacity: 0; }
  body.menu-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .report { grid-template-columns: 1fr; }
}

/* ---------- admin addresses: sortable headers + filters ---------- */
.grid th a.sorth { color: inherit; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: .2rem; }
.grid th a.sorth:hover { text-decoration: underline; }
.grid th a.sorth .arr { color: var(--red); font-size: .8em; }
.inline-form.filters { align-items: center; gap: .5rem; margin: .5rem 0 .3rem; }
.inline-form.filters .minbtc { width: 160px; }
.table-scroll { overflow-x: auto; }
