:root {
  color-scheme: dark;
  --bg: #0a0d10;
  --bg-soft: #0f1318;
  --panel: #14191f;
  --panel-raised: #191f26;
  --panel-soft: #10151a;
  --line: #27303a;
  --line-strong: #384451;
  --text: #f4f6f8;
  --text-soft: #c8ced5;
  --muted: #7f8a96;
  --gold: #f5b844;
  --gold-bright: #ffd479;
  --gold-soft: #2b2112;
  --orange: #f28938;
  --green: #45c98a;
  --green-soft: #122c22;
  --red: #f07064;
  --red-soft: #321a19;
  --blue: #66a8ff;
  --blue-soft: #142338;
  --sidebar: 248px;
  --control-height: 46px;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -10%, rgba(245, 184, 68, .09), transparent 30%),
    linear-gradient(180deg, #0c1014 0, var(--bg) 46%);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
code {
  color: #cbd3dc;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .88em;
  overflow-wrap: anywhere;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.02em; }
h2 { font-size: 20px; margin-bottom: 0; }
small { font-size: 12px; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  background: rgba(10, 13, 16, .96);
  border-right: 1px solid #202832;
  backdrop-filter: blur(18px);
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 7px 22px;
  border-bottom: 1px solid #202832;
}
.brand > span:last-child { min-width: 0; display: grid; gap: 2px; }
.brand strong { max-width: 164px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.brand small { color: var(--muted); }
.brand-mark {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #251607;
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(145deg, var(--gold-bright), var(--orange));
  box-shadow: 0 10px 30px rgba(242, 137, 56, .2), inset 0 1px rgba(255,255,255,.45);
}
.brand-mark.large { width: 68px; height: 68px; border-radius: 20px; font-size: 30px; }

nav { display: grid; gap: 4px; padding-top: 18px; }
.nav-label {
  margin: 12px 11px 5px;
  color: #58636f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #aeb7c1;
  font-weight: 650;
  transition: .16s ease;
}
.nav-link > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #8f99a5;
  background: #151b21;
  font-size: 11px;
  font-weight: 800;
}
.nav-link:hover { color: white; background: #12181e; }
.nav-link.active {
  color: #fff7e7;
  border-color: #5b4320;
  background: linear-gradient(90deg, #2b2114, #17191c);
}
.nav-link.active > span { color: #281708; background: var(--gold); }
.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding: 16px 5px 0;
  border-top: 1px solid #202832;
}
.environment { display: flex; align-items: center; gap: 9px; padding: 0 6px; }
.environment > div { min-width: 0; display: grid; }
.environment strong { font-size: 12px; }
.environment small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(69, 201, 138, .1);
}

.content {
  width: auto;
  max-width: 1560px;
  margin-left: var(--sidebar);
  padding: 27px 34px 56px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 65px;
  margin-bottom: 22px;
}
.topbar h1 { margin-bottom: 0; font-size: 29px; }
.eyebrow {
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.actor {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 144px;
  padding: 9px 13px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(20, 25, 31, .84);
}
.actor > span:last-child { display: grid; font-size: 12px; font-weight: 700; }
.actor small { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: linear-gradient(145deg, rgba(24, 30, 36, .98), rgba(17, 22, 27, .98));
  box-shadow: 0 16px 48px rgba(0, 0, 0, .14);
}
.page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 16px;
  padding: 22px 24px;
  border: 1px solid #3d3423;
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(50, 37, 20, .88), rgba(19, 24, 29, .92) 58%),
    var(--panel);
}
.page-intro.compact { min-height: 108px; }
.page-intro h2 { margin-bottom: 6px; font-size: 23px; }
.page-intro p:last-child { max-width: 680px; margin-bottom: 0; color: #a8b0b9; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 10px; }
.quick-action {
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid #3a444f;
  border-radius: 11px;
  background: rgba(12, 16, 20, .66);
}
.quick-action > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #222b34;
  color: var(--gold-bright);
  font-weight: 900;
}
.quick-action div { display: grid; }
.quick-action small { color: var(--muted); }
.quick-action.primary { border-color: #745226; background: rgba(50, 35, 16, .78); }
.quick-action:hover { border-color: #6f7e8c; transform: translateY(-1px); }
.command-tip, .operator-hint, .room-state, .security-note, .mode-status {
  min-width: 230px;
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(9, 13, 17, .54);
}
.command-tip span, .operator-hint span, .room-state small, .security-note span, .mode-status small { color: var(--muted); font-size: 11px; }
.command-tip code { color: var(--gold-bright); font-size: 14px; }
.room-state { justify-items: end; }
.security-note { border-color: #6d4037; background: rgba(52, 25, 22, .62); }
.mode-status.ready { border-color: #24684b; background: rgba(17, 48, 35, .54); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.metric {
  position: relative;
  min-height: 126px;
  display: grid;
  gap: 6px;
  align-content: space-between;
  overflow: hidden;
}
.metric::after {
  content: "";
  position: absolute;
  width: 74px;
  height: 74px;
  right: -22px;
  bottom: -28px;
  border-radius: 50%;
  background: rgba(245, 184, 68, .055);
}
.metric > span { color: #9ea8b2; font-size: 12px; font-weight: 650; }
.metric > strong { font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.metric > small { color: #6f7a85; }
.metric.warn { border-color: #76483d; background: linear-gradient(145deg, #2b1b1b, #171719); }
.metric.featured { border-color: #604821; background: linear-gradient(145deg, #2c2214, #17191d); }
.workspace-grid, .split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 12px;
  margin-bottom: 12px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.section-head h2 { font-size: 18px; }
.section-head > a { color: var(--gold-bright); font-size: 12px; font-weight: 700; }
.section-note, .section-count {
  color: var(--muted);
  font-size: 12px;
}
.section-count {
  padding: 5px 9px;
  border-radius: 999px;
  background: #20272f;
}
.section-index { color: #46515d; font-size: 24px; font-weight: 800; }

.task-list { display: grid; }
.task-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 67px;
  padding: 10px 2px;
  border-bottom: 1px solid #252e37;
}
.task-row:last-child { border-bottom: 0; }
.task-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #cfdae4;
  background: #202831;
  font-size: 11px;
  font-weight: 800;
}
.task-row > div { display: grid; }
.task-row small { color: var(--muted); }
.task-row b {
  min-width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--gold-bright);
  background: var(--gold-soft);
}
.balance-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.balance-pair > div {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #2c3640;
  border-radius: 11px;
  background: #0f1419;
}
.balance-pair span { color: var(--muted); font-size: 11px; }
.balance-pair strong { color: var(--gold-bright); font-size: 21px; }
.balance-pair strong small { color: #9e8b65; }
details summary { cursor: pointer; user-select: none; color: #d6dde4; }
.inline-operation { border-top: 1px solid #29323b; padding-top: 12px; }
.quick-fund { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; padding-top: 12px; }

.button {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid #46515d;
  border-radius: 9px;
  color: #e7ebef;
  background: #242c34;
  cursor: pointer;
  font-weight: 750;
  transition: .15s ease;
}
.button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.button.primary {
  color: #261706;
  border-color: #ffc25c;
  background: linear-gradient(135deg, var(--gold-bright), #e9902d);
  box-shadow: 0 9px 24px rgba(233, 144, 45, .15);
}
.button.secondary { color: #ffe1a1; border-color: #735126; background: #332514; }
.button.danger { color: #ffc1bb; border-color: #754039; background: #3b211f; }
.button.warning { color: #ffd18b; border-color: #765729; background: #352817; }
.button.ghost { color: #9da7b1; background: transparent; border-color: #303943; }
.button.small { min-height: 34px; padding: 0 11px; border-radius: 8px; font-size: 12px; }
.button.full, .full { width: 100%; }

label { display: grid; gap: 7px; color: #b7c0c9; font-size: 12px; font-weight: 700; }
label small { color: #6f7a85; font-weight: 500; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select {
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 12px;
  border: 1px solid #36414c;
  border-radius: 9px;
  outline: none;
  color: var(--text);
  background: #0d1217;
  line-height: normal;
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, #77838f 50%),
    linear-gradient(135deg, #77838f 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
input:focus, select:focus { border-color: #be8738; box-shadow: 0 0 0 3px rgba(245, 184, 68, .1); }
input::placeholder { color: #56616c; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 14px; }
.stack.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.config-grid { display: grid; gap: 12px; }
.config-section { padding: 22px; }
.address-config {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, .52fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
  padding: 15px;
  border: 1px solid #5f4725;
  border-radius: 11px;
  background: linear-gradient(135deg, #2b2115, #14191d);
}
.address-config input {
  color: var(--gold-bright);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .015em;
}
.address-config p { display: grid; gap: 5px; margin: 0; padding-bottom: 3px; }
.address-config p strong { color: #e1bf7c; font-size: 12px; }
.address-config p span { color: var(--muted); font-size: 11px; line-height: 1.55; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid #35414c;
  border-radius: 12px;
  background: #10161b;
  cursor: pointer;
}
.choice-card:has(input:checked) { border-color: #986c2f; background: #292014; box-shadow: inset 0 0 0 1px #58411f; }
.choice-card input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold); }
.choice-card span { display: grid; gap: 5px; }
.choice-card strong { color: var(--text); font-size: 14px; }
.choice-card small { color: var(--muted); font-weight: 500; }
.choice-card.disabled { opacity: .52; cursor: not-allowed; }
.toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.toggle input { width: 36px; height: 20px; accent-color: var(--gold); }
.save-dock {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr minmax(260px, .8fr) auto;
  align-items: end;
  gap: 14px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #5d4727;
  border-radius: 13px;
  background: rgba(19, 22, 25, .96);
  box-shadow: 0 18px 60px rgba(0,0,0,.42);
  backdrop-filter: blur(16px);
}
.save-dock > div { display: grid; align-self: center; }
.save-dock > div span { color: var(--muted); font-size: 11px; }
.save-note { gap: 4px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 10px 11px;
  color: #747f8b;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
td { padding: 13px 11px; border-bottom: 1px solid #252e37; vertical-align: middle; }
tbody tr:hover { background: rgba(255,255,255,.018); }
.money { color: #f1d094; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 800; }
.positive { color: #74dda9; font-weight: 800; }
.negative { color: #ff978e; font-weight: 800; }
.entity { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.entity-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #3a4651;
  border-radius: 10px;
  color: #e6c98d;
  background: #222a32;
  font-size: 11px;
  font-weight: 850;
}
.entity-avatar.large { width: 54px; height: 54px; border-radius: 15px; font-size: 18px; }
.entity > div { display: grid; }
.entity small { color: var(--muted); }
.badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid #46515c;
  border-radius: 999px;
  color: #c5ccd3;
  background: #222931;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.badge.enabled, .badge.settled, .badge.succeeded, .badge.sent, .badge.credited, .badge.completed, .badge.released, .badge.pass, .badge.confirmed { color: #8ee8ba; border-color: #256b4b; background: #153326; }
.badge.open, .badge.funds_held, .badge.approved, .badge.broadcasted, .badge.confirming, .badge.pending { color: #ffd38d; border-color: #765727; background: #372918; }
.badge.unknown, .badge.failed, .badge.disabled, .badge.rejected, .badge.void, .badge.fail, .badge.mismatch { color: #ffa298; border-color: #79413a; background: #381e1c; }
.badge.warn { color: #ffd38d; border-color: #765727; background: #372918; }

.search { display: flex; gap: 8px; min-width: 420px; }
.search input { flex: 1; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin: -7px 0 12px; color: var(--muted); font-size: 12px; }
.breadcrumb a { color: var(--gold); }
.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  gap: 12px;
  margin-bottom: 12px;
}
.player-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.player-heading h2 { margin-bottom: 2px; font-size: 24px; }
.hero-balance {
  position: relative;
  display: grid;
  gap: 5px;
  margin: 22px 0 16px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid #725122;
  border-radius: 12px;
  background: linear-gradient(135deg, #332514, #1b1917);
}
.hero-balance::after { content: "U"; position: absolute; right: 18px; bottom: -16px; color: rgba(255,255,255,.035); font-size: 86px; font-weight: 900; }
.hero-balance > span { color: #b9a076; font-size: 11px; font-weight: 700; }
.hero-balance > strong { color: var(--gold-bright); font-size: 35px; line-height: 1.15; }
.hero-balance > strong small { color: #a88d60; font-size: 15px; }
.hero-balance > small { color: #7f725e; }
.profile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-facts > div { display: grid; gap: 4px; padding: 12px; border: 1px solid #2d3640; border-radius: 10px; background: #10151a; }
.profile-facts span { color: var(--muted); font-size: 10px; }
.credit-card { display: grid; gap: 20px; border-color: #67491f; background: linear-gradient(155deg, #2d2215, #15191d 64%); }
.credit-card > div > p:last-child { margin: 7px 0 0; color: #a9a294; }
.credit-form { display: grid; gap: 14px; }
.amount-field { position: relative; }
.amount-field input { height: 62px !important; padding: 0 50px 0 16px !important; color: var(--gold-bright) !important; font-size: 26px !important; font-weight: 850; }
.amount-field > span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: #9e855a; font-weight: 800; }
.credit-submit { min-height: 52px; font-size: 15px; }
.credit-note { margin: 0; color: #817767; font-size: 11px; text-align: center; }

.ledger-panel { margin-top: 12px; }
.ledger-panel .section-head { margin-bottom: 12px; }
.ledger-panel .section-head p:last-child { margin: 5px 0 0; color: var(--muted); }
.ledger-panel .section-head .button { white-space: nowrap; }
.ledger-table time { color: #aab2bb; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-table td:nth-child(2) { min-width: 150px; }
.ledger-table td:nth-child(3) { min-width: 110px; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-code { display: block; margin-top: 3px; color: #68737e; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.ledger-reference { color: #aeb6bf; white-space: nowrap; }
.ledger-empty { min-height: 120px; }

.agents-workspace { grid-template-columns: minmax(320px, .72fr) minmax(0, 1.28fr); }
.relation-arrow { color: var(--gold); font-size: 11px; font-weight: 800; text-align: center; }
.agent-list { display: grid; gap: 3px; max-height: 640px; overflow: auto; }
.agent-list form {
  display: grid;
  grid-template-columns: 1fr minmax(180px, .7fr) auto;
  align-items: end;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #29323b;
}

.withdrawal-list { display: grid; gap: 12px; }
.withdrawal-summary { margin-bottom: 12px; }
.withdrawal-summary .metric.warn { border-color: #76502d; background: linear-gradient(145deg, #2b1d16, var(--panel)); }
.withdrawal-toolbar { display: grid; gap: 13px; margin-bottom: 12px; padding: 13px 15px; }
.withdrawal-tabs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.withdrawal-tabs a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid #313b45;
  border-radius: 9px;
  color: #9da6af;
  background: #10151a;
  font-size: 11px;
  font-weight: 800;
}
.withdrawal-tabs a span { min-width: 20px; padding: 2px 5px; border-radius: 999px; background: #242c34; text-align: center; }
.withdrawal-tabs a.active { color: #f2d49c; border-color: #725025; background: #2c2115; }
.withdrawal-tabs a.active span { color: #15110c; background: var(--gold); }
.withdrawal-search { width: 100%; min-width: 0; }
.withdrawal-card {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid #303a44;
  border-radius: 13px;
  background: #10151a;
}
.withdrawal-card.attention { border-color: #62472b; box-shadow: inset 3px 0 #ad7437; }
.withdrawal-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.withdrawal-head .age { color: var(--muted); font-size: 10px; }
.withdrawal-head code { margin-left: auto; color: #6f7a85; }
.withdrawal-amount-row { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.withdrawal-amount-row > strong { color: var(--gold-bright); font-size: 31px; }
.withdrawal-amount-row > strong small { color: #927f5e; font-size: 14px; }
.withdrawal-amount-row > a { color: #cfb077; font-size: 12px; font-weight: 800; }
.risk-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.risk-strip span { padding: 5px 8px; border: 1px solid #74402f; border-radius: 7px; color: #ffaca1; background: #321d1a; font-size: 10px; font-weight: 750; }
.risk-strip.clear span { color: #77d9aa; border-color: #285b42; background: #142c21; }
.withdrawal-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 14px; }
.withdrawal-facts > div { display: grid; gap: 3px; min-height: 78px; align-content: center; padding: 10px; border: 1px solid #29333c; border-radius: 9px; background: #0b1014; }
.withdrawal-facts span { color: var(--muted); font-size: 9px; }
.withdrawal-facts strong { color: #d8dee4; font-size: 13px; }
.withdrawal-facts small { color: #68737e; font-size: 9px; }
.withdrawal-chain { padding: 12px; border: 1px solid #29333c; border-radius: 9px; background: #0b1014; }
.withdrawal-chain dd { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.withdrawal-chain dd small { flex-basis: 100%; margin-left: 0; }
dl { display: grid; grid-template-columns: 86px 1fr; gap: 8px 13px; margin: 0; }
dt { color: var(--muted); font-size: 11px; }
dd { margin: 0; color: #c8cfd6; overflow-wrap: anywhere; }
dd small { color: var(--muted); margin-left: 4px; }
.withdrawal-actions { display: grid; gap: 9px; align-content: start; padding: 14px; border: 1px solid #29333c; border-radius: 11px; background: #0b1014; }
.action-heading { display: grid; padding-bottom: 5px; }
.action-heading span { color: var(--muted); font-size: 10px; }
.withdrawal-actions form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.withdrawal-actions form:has(.full) { grid-template-columns: 1fr; }
.payout-instruction, .verification-state, .terminal-state { display: grid; gap: 4px; padding: 13px; border: 1px solid #3a4650; border-radius: 9px; color: #d9c08e; background: #15191d; }
.payout-instruction span, .verification-state span, .terminal-state span { color: #8d979f; font-size: 11px; line-height: 1.55; }
.verification-state { border-color: #68502c; background: #272015; }
.terminal-state { color: #83d8ae; border-color: #2e6048; background: #13281f; }
.unknown-state { display: grid; gap: 4px; padding: 13px; border: 1px solid #705127; border-radius: 9px; color: #f2c77c; background: #2e2417; }
.unknown-state span { color: #b29566; font-size: 11px; }

.funds-cockpit { margin: 12px 0; border-color: #315c49; background: linear-gradient(135deg, #172b23, #15191e 48%, #10151a); }
.funds-cockpit.danger { border-color: #754239; background: linear-gradient(135deg, #2d1d1a, #15191e 48%, #10151a); }
.funds-cockpit .section-head p:last-child { margin: 4px 0 0; color: #8f9b9f; }
.reconciliation-state { min-width: 164px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid #2e674b; border-radius: 10px; background: #132b20; }
.reconciliation-state.warn { border-color: #705127; background: #2d2417; }
.reconciliation-state.fail { border-color: #784039; background: #321d1b; }
.reconciliation-state.warn .status-dot { background: #eaaa4d; box-shadow: 0 0 0 5px rgba(234, 170, 77, .1); }
.reconciliation-state.fail .status-dot { background: #ed796f; box-shadow: 0 0 0 5px rgba(237, 121, 111, .1); }
.reconciliation-state > div { display: grid; }
.reconciliation-state strong { font-size: 12px; }
.reconciliation-state small { color: #829087; font-size: 9px; }
.funds-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.funds-grid > div { position: relative; display: grid; gap: 4px; min-height: 114px; align-content: center; padding: 14px; overflow: hidden; border: 1px solid #304038; border-radius: 11px; background: rgba(9, 14, 16, .54); }
.funds-grid > div > span { color: #92a09b; font-size: 10px; }
.funds-grid > div > strong { color: #e7ece9; font-size: 24px; font-variant-numeric: tabular-nums; }
.funds-grid > div > strong small { color: #8a9792; font-size: 11px; }
.funds-grid > div > small { color: #68746f; font-size: 9px; }
.funds-grid .healthy-value { border-color: #2b6147; }
.funds-grid .healthy-value > strong { color: #7ce0ae; }
.funds-grid .danger-value { border-color: #7a4038; background: #2b1a18; }
.funds-grid .danger-value > strong { color: #ff958c; }
.funds-detail { display: flex; flex-wrap: wrap; gap: 8px 17px; margin-top: 10px; padding: 10px 12px; border: 1px solid #293831; border-radius: 9px; color: #71807a; background: rgba(8, 13, 15, .5); font-size: 10px; }
.funds-detail strong { margin-left: 3px; color: #a8b3ae; }

.date-filter { display: flex; align-items: end; gap: 8px; }
.date-filter label { min-width: 180px; }
.reconciliation-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
  overflow: hidden;
  border-color: #2e684c;
  background: linear-gradient(135deg, #153125, #11171a 63%);
}
.reconciliation-hero.warn { border-color: #705329; background: linear-gradient(135deg, #302515, #11171a 63%); }
.reconciliation-hero.fail { border-color: #754038; background: linear-gradient(135deg, #351d1b, #11171a 63%); }
.reconciliation-mark { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid #2c7655; border-radius: 16px; color: #8ce2b6; background: #173c2b; font-size: 27px; font-weight: 900; }
.reconciliation-hero.warn .reconciliation-mark { color: #f1c370; border-color: #765628; background: #3a2a16; }
.reconciliation-hero.fail .reconciliation-mark { color: #ff9d94; border-color: #7d4038; background: #3b1e1b; }
.reconciliation-hero h2 { margin: 3px 0 4px; font-size: 25px; }
.reconciliation-hero p { margin-bottom: 0; }
.reconciliation-time { display: grid; gap: 4px; text-align: right; }
.reconciliation-time span { color: var(--muted); font-size: 10px; }
.reconciliation-time strong { font-size: 11px; }
.reconciliation-metrics { margin-bottom: 12px; }
.reconciliation-metrics .metric.warn { border-color: #70502b; }
.reconciliation-workspace { margin-bottom: 12px; }
.check-list { display: grid; gap: 0; }
.check-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #29323a; }
.check-list > div:last-child { border-bottom: 0; }
.check-list span { color: var(--muted); }
.check-list strong { text-align: right; }
.reconciliation-issues { display: grid; gap: 7px; }
.reconciliation-issues article { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 11px; padding: 12px; border: 1px solid #62472c; border-radius: 9px; background: #241d15; }
.reconciliation-issues article.error { border-color: #744038; background: #2d1b19; }
.reconciliation-issues article p { margin: 3px 0; color: #b1b9c0; }
.reconciliation-issues article code { color: #737f89; font-size: 10px; overflow-wrap: anywhere; }

.detail-metrics { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; margin-bottom: 12px; padding: 0; overflow: hidden; }
.detail-metrics > div { min-height: 105px; display: grid; gap: 4px; align-content: center; padding: 14px; border-right: 1px solid var(--line); }
.detail-metrics > div:last-child { border-right: 0; }
.detail-metrics span { color: var(--muted); font-size: 10px; }
.detail-metrics strong { font-size: 16px; }
.detail-metrics small { color: #66717c; }

.audit-list details { border-bottom: 1px solid #28313a; }
.audit-list details:last-child { border-bottom: 0; }
.audit-list summary { display: grid; grid-template-columns: minmax(130px, auto) minmax(140px, .8fr) 1fr auto; align-items: center; gap: 12px; padding: 12px 2px; }
.audit-list time { color: var(--muted); font-size: 11px; }
.audit-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 13px; padding: 13px; border: 1px solid #29333c; border-radius: 10px; background: #0c1115; }
.audit-detail p { grid-column: 1 / -1; margin-bottom: 0; }
pre { max-height: 280px; margin-bottom: 0; overflow: auto; padding: 10px; border-radius: 8px; color: #aeb8c2; background: #080b0e; white-space: pre-wrap; overflow-wrap: anywhere; }

.flash {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin-bottom: 12px;
  padding: 12px 15px;
  border: 1px solid;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,.32);
}
.flash.success { color: #a9ebc8; border-color: #2b7652; background: #173727; }
.flash.error { color: #ffc0b9; border-color: #82473f; background: #3a211e; }
.notice { margin-bottom: 12px; padding: 12px 14px; border: 1px solid #68532c; border-radius: 10px; color: #e4c990; background: #2d2517; }
.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 26px;
  color: var(--muted);
  border: 1px dashed #39434d;
  border-radius: 11px;
  text-align: center;
}
.empty strong { color: var(--text-soft); font-size: 15px; }
.empty span, .empty p { margin: 0; }
.empty-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--gold); background: var(--gold-soft); font-weight: 850; }
.success-empty { border-color: #28533f; background: rgba(18, 48, 35, .25); }
.success-empty strong { color: #88deb1; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; line-height: 1.55; }

.auth-body { display: grid; place-items: center; padding: 28px; }
.auth-content { width: min(1040px, 100%); }
.login-shell {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  align-items: center;
  gap: 72px;
  min-height: calc(100vh - 56px);
}
.brand-full-name { margin: 18px 0 5px; color: #d2b278; font-size: 13px; font-weight: 750; letter-spacing: .04em; }
.login-brand h1 { max-width: 670px; margin: 0 0 14px; font-size: clamp(39px, 4.7vw, 58px); line-height: 1.08; overflow-wrap: anywhere; }
.login-brand > p:not(.eyebrow) { max-width: 610px; color: #929ca6; font-size: 15px; line-height: 1.8; }
.login-points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.login-points span { padding: 6px 10px; border: 1px solid #3e4750; border-radius: 999px; color: #b8c0c8; background: #12171c; font-size: 11px; }
.login-card { display: grid; gap: 17px; padding: 28px; border-color: #4d3c25; }
.login-card h2 { font-size: 25px; }
.login-card > div > p:last-child { margin: 5px 0 0; }

@media (max-width: 1250px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-metrics > div { border-bottom: 1px solid var(--line); }
  .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .withdrawal-card { grid-template-columns: 1fr; }
  .withdrawal-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  :root { --sidebar: 0px; }
  .sidebar { position: static; width: auto; padding: 12px 14px; }
  .brand { min-height: 46px; padding: 0 3px 10px; border-bottom: 0; }
  .brand-mark { width: 35px; height: 35px; }
  .sidebar nav { display: flex; gap: 7px; padding: 5px 0 0; overflow-x: auto; scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .nav-label, .sidebar-footer { display: none; }
  .nav-link { flex: 0 0 auto; min-height: 38px; padding: 6px 9px; white-space: nowrap; }
  .nav-link > span { display: none; }
  .content { margin-left: 0; padding: 20px 18px 44px; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .quick-actions { width: 100%; }
  .quick-action { min-width: 0; }
  .workspace-grid, .split, .account-grid, .agents-workspace { grid-template-columns: 1fr; }
  .address-config { grid-template-columns: 1fr; }
  .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .save-dock { grid-template-columns: 1fr auto; }
  .save-note { grid-column: 1 / -1; grid-row: 2; }
  .detail-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  :root { --control-height: 48px; }
  body { font-size: 13px; }
  .content { padding: 16px 12px 36px; }
  .topbar { min-height: 54px; margin-bottom: 14px; }
  .topbar h1 { font-size: 24px; }
  .actor { display: none; }
  .page-intro { padding: 18px; }
  .page-intro h2 { font-size: 20px; }
  .command-tip, .operator-hint, .room-state, .security-note, .mode-status { width: 100%; min-width: 0; }
  .quick-actions { grid-template-columns: 1fr; }
  .metric-grid, .form-grid.two, .form-grid.three, .form-grid.four, .choice-grid, .profile-facts { grid-template-columns: 1fr; }
  .funds-grid { grid-template-columns: 1fr; }
  .metric { min-height: 108px; }
  .panel, .config-section { padding: 16px; }
  .section-head { align-items: flex-start; }
  .search { width: 100%; min-width: 0; flex-wrap: wrap; }
  .search input { flex-basis: 100%; font-size: 16px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select { font-size: 16px; }
  .save-dock { position: static; grid-template-columns: 1fr; }
  .save-note { grid-column: auto; grid-row: auto; }
  .detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-metrics > div { border-right: 1px solid var(--line); }
  .player-heading { grid-template-columns: auto 1fr; }
  .player-heading > .badge { grid-column: 1 / -1; }
  .agent-list form { grid-template-columns: 1fr; }
  .withdrawal-actions form { grid-template-columns: 1fr; }
  .withdrawal-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .withdrawal-amount-row { align-items: flex-start; flex-direction: column; }
  .reconciliation-hero { grid-template-columns: auto 1fr; }
  .reconciliation-time { grid-column: 1 / -1; text-align: left; }
  .date-filter { width: 100%; }
  .date-filter label { flex: 1; min-width: 0; }
  .audit-list summary { grid-template-columns: 1fr auto; }
  .audit-list summary > span:nth-child(3), .audit-list time { display: none; }
  .audit-detail { grid-template-columns: 1fr; }
  .audit-detail p { grid-column: auto; }
  .login-shell { grid-template-columns: 1fr; gap: 30px; padding: 16px 0; }
  .login-brand h1 { font-size: 38px; }
}
