/* POLY-V2 · Accounting / bookkeeping theme (beige parchment) */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap");

:root {
  --bg: #F5F0E6;
  --bg-deep: #F3EEE4;
  --surface: #FFFBF5;
  --surface-2: #FAF6EE;
  --ink: #2C2A26;
  --ink-soft: #3D3A34;
  --muted: #8A8478;
  --line: #E5DFD3;
  --line-strong: #D8D0C2;
  --accent: #8b6914;
  --accent-soft: #a67c1a;
  --accent-bg: rgba(139, 105, 20, 0.10);
  --green: #2f6b4f;
  --green-bg: rgba(47, 107, 79, 0.10);
  --red: #9b3b32;
  --red-bg: rgba(155, 59, 50, 0.10);
  --shadow: 0 4px 18px rgba(44, 36, 25, 0.07);
  --radius: 16px;
  --radius-sm: 12px;
  --font: "Roboto", "Segoe UI", "Noto Sans", sans-serif;
  --mono: ui-monospace, "Roboto Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 18px;
  flex-wrap: nowrap;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(44,42,38,.12);
}
.mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--accent); color: #fffaf3;
  display: grid; place-items: center; font-weight: 700; font-size: 1.05rem;
}
.kicker {
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-size: .72rem; margin: 0 0 2px;
}
.topbar h1 { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--ink); }
.top-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

.badge {
  border: 1px solid var(--line-strong);
  padding: .28rem .65rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}
.badge.dry { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.badge.live { background: var(--green-bg); color: var(--green); border-color: transparent; }

.btn-gear, .btn-primary, .btn-icon {
  font-family: var(--font);
  cursor: pointer;
}
.btn-gear {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: .45rem .85rem;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
}
.btn-gear:hover { background: var(--accent-bg); border-color: var(--line-strong); }
.btn-primary {
  grid-column: 1 / -1;
  background: var(--accent);
  color: #fffaf3;
  border: 0;
  padding: .75rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: .95rem;
}
.btn-primary:hover { background: var(--accent-soft); }
.btn-icon {
  border: 0; background: transparent; color: var(--muted);
  font-size: 1.6rem; line-height: 1; padding: .1rem .45rem;
}
.btn-icon:hover { color: var(--ink); }

.wrap { max-width: none; width: 100%; margin: 0; padding: 1.25rem 1.5rem 2rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: 1.1rem;
}
.kpi { padding: 1rem 1.1rem; }
.kpi-label {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  margin-bottom: .35rem;
}
.kpi-val {
  display: block;
  font-size: 2.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
}
.kpi-note {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .78rem;
}
.win { color: var(--green) !important; }
.loss { color: var(--red) !important; }

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.grid.three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.grid.one {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.panel { overflow: hidden; }
.panel-h {
  padding: .9rem 1.05rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.panel-h h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.panel-h p { margin: .28rem 0 0; color: var(--muted); font-size: .82rem; }

.list { padding: .55rem; max-height: 640px; overflow: auto; }
.list.empty {
  color: var(--muted);
  padding: 1.15rem;
  text-align: center;
  font-size: .92rem;
}

.row {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: .8rem .9rem;
  margin: .45rem;
}
.row.pass { border-left: 3px solid var(--green); }
.row.fail { border-left: 3px solid var(--red); }
.row h3 {
  margin: 0 0 .35rem;
  font-size: .95rem;
  font-weight: 500;
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  color: var(--ink);
}
.row p { margin: .18rem 0; color: var(--muted); font-size: .82rem; }
.row strong.win, .row strong.loss { font-weight: 700; }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: .12rem .5rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.pill.pass { background: var(--green-bg); color: var(--green); }
.pill.fail { background: var(--red-bg); color: var(--red); }
.pill.side-buy { background: var(--green-bg); color: var(--green); }
.pill.side-sell { background: var(--red-bg); color: var(--red); }
.pill.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

.foot {
  max-width: none;
  width: 100%;
  margin: 0 0 2rem;
  padding: 0 1.5rem;
  color: var(--muted);
  font-size: .8rem;
}
.muted { color: var(--muted); }

.modal[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 1rem 2rem;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(44, 42, 38, 0.35);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  width: min(640px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(44, 36, 25, 0.18);
}
.modal-h {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  position: sticky; top: 0;
}
.modal-h h2 { margin: 0; font-size: 1.15rem; }
.modal-b { padding: 1rem 1.15rem 1.4rem; }

.cfg-block { margin-bottom: 1.25rem; }
.cfg-block h3 {
  margin: 0 0 .65rem;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: .4rem .75rem;
  margin: 0;
  font-size: .88rem;
}
.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; color: var(--ink); word-break: break-all; }
.kv code {
  font-family: var(--mono);
  font-size: .82rem;
  background: var(--surface-2);
  padding: .15rem .4rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.kv a { color: var(--accent); }

.cfg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}
.cfg label {
  display: flex; flex-direction: column; gap: .25rem;
  font-size: .8rem; color: var(--muted); font-weight: 500;
}
.cfg input {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .5rem .6rem;
  font-size: .92rem;
}
.cfg input:focus {
  outline: 2px solid rgba(139, 105, 20, 0.25);
  border-color: var(--accent-soft);
}
.hint { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; margin: 0; }

@media (max-width: 1100px) {
  .grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: 1fr; }
  .kpi-val { font-size: 1.85rem; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .cfg { grid-template-columns: 1fr; }
  .topbar { padding: 12px 14px; }
}

.made-by {
  margin: 0.15rem 0 0;
  font-family: Roboto, system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #8A8478;
  letter-spacing: 0.02em;
}


/* Settings tabs + deposit/withdraw */
.modal-card-wide { width: min(720px, 100%); }
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .65rem 1.15rem 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 53px;
  z-index: 2;
}
.stab[data-tab="deepseek"] {
  color: #0b6e4f;
  font-weight: 600;
}
.stab[data-tab="deepseek"].active {
  color: #0b6e4f;
}
.stab {
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  padding: .55rem .9rem;
  cursor: pointer;
}
.stab:hover { color: var(--ink-soft); background: var(--surface); }
.stab.active {
  color: var(--accent);
  background: var(--surface);
  border-color: var(--line);
  font-weight: 700;
}
.stab-pane[hidden] { display: none !important; }

.warn-box {
  background: rgba(155, 59, 50, 0.08);
  border: 1px solid rgba(155, 59, 50, 0.25);
  color: var(--red);
  border-radius: 10px;
  padding: .7rem .85rem;
  font-size: .88rem;
  margin: 0 0 .9rem;
}
.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.qr-wrap canvas {
  border-radius: 8px;
  background: #FFFBF5;
}
.hd-steps {
  margin: .75rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
  font-size: .88rem;
}
.hd-steps li { margin: .28rem 0; }
.btn-copy, .btn-max {
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  margin-left: .45rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  cursor: pointer;
  vertical-align: middle;
}
.btn-copy:hover, .btn-max:hover { background: var(--accent-bg); }
.cfg-stack { grid-template-columns: 1fr; }
.cfg-stack label { font-size: .85rem; }
.amt-row { display: flex; gap: .45rem; align-items: center; }
.amt-row input { flex: 1; }
.chk {
  flex-direction: row !important;
  align-items: flex-start;
  gap: .55rem !important;
  color: var(--ink-soft) !important;
  font-size: .85rem !important;
}
.chk input { width: auto; margin-top: .15rem; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #823028; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.hint.win { color: var(--green); }
.hint.loss { color: var(--red); }

.qr-box {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  background: #FFFBF5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-box img, .qr-box canvas {
  display: block;
  width: 180px !important;
  height: 180px !important;
}


/* Live trade sentence lines */
.list .sentence {
  margin: .35rem 0 .2rem;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.4;
}
.list .meta {
  margin: .15rem 0;
  color: var(--muted);
  font-size: .82rem;
}
.list .row {
  transition: background-color .15s ease;
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .75rem;
  border: 1px solid #E5DFD3;
  border-radius: 999px;
  background: #FFFBF5;
  color: #2C2A26;
  font-family: Roboto, system-ui, sans-serif;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-refresh:hover { background: #F3EEE4; }
.btn-refresh:disabled { opacity: .55; cursor: wait; }
.btn-refresh.spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }



.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  flex-shrink: 0;
}
.topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.made-by { margin: 0; font-size: 0.75rem; }
.earn-inline {
  margin: 0 0 0 8px;
  padding: 0.35rem 0.65rem;
  border-radius: 12px;
  background: linear-gradient(90deg, #E8F5E9 0%, #FFF8E7 55%, #F5F0E6 100%);
  border: 1px solid #E5DFD3;
  min-width: 0;
  flex: 1;
  max-width: 520px;
}
.earn-main {
  margin: 0;
  font-family: Roboto, system-ui, sans-serif;
  font-size: clamp(0.82rem, 1.4vw, 0.98rem);
  font-weight: 700;
  color: #1B5E20;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.earn-main.loss { color: #B71C1C; }
.earn-wish {
  margin: 0.1rem 0 0;
  font-family: Roboto, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: #5D564C;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .earn-inline { max-width: none; margin-left: 0; flex-basis: 100%; }
  .earn-main, .earn-wish { white-space: normal; }
}

.cap-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.cap-table th, .cap-table td { padding: 0.45rem 0.55rem; border-bottom: 1px solid #e2d8c8; text-align: left; }
.cap-table th { font-weight: 600; color: #5c5346; }
.cap-table .dep { color: #1b7a3d; }
.cap-table .wd { color: #b42318; }
.table-wrap { overflow-x: auto; max-height: 320px; overflow-y: auto; }

.btn-pause {
  border: 1px solid #b42318;
  background: #fef3f2;
  color: #b42318;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  margin-right: 0.4rem;
}
.btn-pause.running {
  border-color: #1b7a3d;
  background: #ecfdf3;
  color: #1b7a3d;
}
.btn-pause:disabled { opacity: 0.6; cursor: wait; }

/* Ví copy target list (Settings → Cấu hình bot) */
.wallet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.wallet-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .75rem;
  padding: .65rem .75rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.wallet-list .wl-label {
  font-weight: 700;
  color: var(--ink);
  min-width: 7.5rem;
}
.wallet-list .wl-addr {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--ink-soft);
  word-break: break-all;
  flex: 1;
}
.wallet-list .wl-copy {
  font-size: .75rem;
  padding: .25rem .55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}
.wallet-list .wl-copy:hover { color: var(--accent); border-color: var(--accent); }
.wallet-list .wl-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
}
