:root {
  --teal: #0B4654;
  --teal-2: #15505E;
  --ink: #14323b;
  --muted: #5d7278;
  --line: #e3eaec;
  --bg: #f3f6f7;
  --card: #ffffff;
  --orange: #e85d3a;
  --ok: #1f7a4d;
  --ok-bg: #e7f6ee;
  --warn: #8a5a12;
  --warn-bg: #fff4df;
  --bad: #9d2c2c;
  --bad-bg: #fdecec;
  --info: #0f5f86;
  --info-bg: #e7f3f8;
  --shadow: 0 10px 30px rgba(11, 70, 84, 0.06);
  --sidebar: 248px;
  --font: "Manrope", "Segoe UI", sans-serif;
}
html[data-theme="dark"] {
  --ink: #e7f0f2;
  --muted: #a9bdc3;
  --line: #244148;
  --bg: #0e1c21;
  --card: #143038;
  --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 760; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: 1.7rem; }
.lede { color: var(--muted); margin: 0.35rem 0 0; }

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); background: var(--teal); color: #fff;
  display: flex; flex-direction: column; padding: 1.1rem 0.85rem 1rem; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 0.75rem; align-items: center; text-decoration: none; color: #fff; padding: 0.2rem 0.45rem 1rem; }
.brand strong { display: block; font-size: 0.95rem; }
.brand small { display: block; opacity: 0.72; font-size: 0.75rem; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: #fff; color: var(--teal); font-weight: 760;
}
.brand-dark { color: var(--ink); margin-bottom: 1.2rem; }
.brand-dark .brand-mark { background: var(--teal); color: #fff; }
.side-nav { display: flex; flex-direction: column; gap: 0.15rem; }
.side-nav a, .side-foot {
  display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: rgba(255,255,255,0.82);
  padding: 0.62rem 0.7rem; border-radius: 10px; font-size: 0.92rem;
}
.side-nav a svg, .side-foot svg { width: 18px; height: 18px; }
.side-nav a.is-active, .side-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.side-foot { margin-top: auto; opacity: 0.8; }
.workspace { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 1.3rem;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--card) 88%, transparent);
  position: sticky; top: 0; z-index: 5;
}
.crumbs { display: flex; gap: 0.4rem; color: var(--muted); font-size: 0.9rem; min-width: 0; }
.crumbs strong { color: var(--ink); font-weight: 680; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 0.45rem; }
.who { text-align: right; line-height: 1.15; }
.who strong { display: block; font-size: 0.86rem; }
.who small { color: var(--muted); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; position: relative; text-decoration: none; cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn em {
  position: absolute; top: -4px; right: -4px; background: var(--orange); color: #fff;
  font-style: normal; font-size: 0.65rem; border-radius: 99px; padding: 0.05rem 0.3rem;
}
.content { padding: 1.3rem; max-width: 1240px; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; margin-bottom: 1rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin-bottom: 1rem; }
.stat, .card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.stat { padding: 0.95rem 1rem; }
.stat span, .muted { color: var(--muted); font-size: 0.82rem; }
.stat strong { display: block; font-size: 1.55rem; margin-top: 0.25rem; letter-spacing: -0.04em; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 0.8rem; }
.card { padding: 1rem 1.05rem; }
.card + .card, .stack > * + * { margin-top: 0.8rem; }
.card h2 { font-size: 1.02rem; margin-bottom: 0.75rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 680; }
th, td { padding: 0.7rem 0.45rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 0.15rem 0.55rem; font-size: 0.75rem; font-weight: 680; background: var(--line); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: var(--orange); color: #fff; border: 0; border-radius: 10px; padding: 0.68rem 0.95rem;
  text-decoration: none; font-weight: 680; cursor: pointer;
}
.btn.secondary { background: transparent; color: var(--teal); border: 1px solid var(--line); }
html[data-theme="dark"] .btn.secondary { color: var(--ink); }
.btn.ghost { background: transparent; color: var(--bad); }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem; }
input, select, textarea {
  width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0.65rem 0.7rem;
}
label { display: block; font-size: 0.82rem; font-weight: 680; margin-bottom: 0.28rem; }
.field { margin-bottom: 0.75rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.flash { padding: 0.75rem 0.9rem; border-radius: 10px; margin-bottom: 0.8rem; background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.empty { padding: 1.4rem 0.2rem; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 0.2rem; }
.timeline li { position: relative; padding: 0 0 1rem 1.3rem; border-left: 2px solid var(--line); }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 0.2rem; width: 10px; height: 10px; border-radius: 50%; background: var(--teal);
}
.steps { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.steps span { font-size: 0.78rem; padding: 0.3rem 0.55rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.steps span.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.map { height: 320px; border-radius: 12px; border: 1px solid var(--line); }
.pager { display: flex; gap: 0.4rem; margin-top: 0.8rem; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background:
  radial-gradient(900px 400px at 10% -10%, rgba(232,93,58,0.16), transparent 50%), var(--bg); }
.auth-card { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.45rem; margin-bottom: 0.2rem; }
.check { display: flex; gap: 0.45rem; align-items: center; font-weight: 560; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-top: 0.5rem; }
.pay-method {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem;
  padding: 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  text-decoration: none; cursor: pointer;
}
.pay-method.is-active { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.pay-method.is-disabled { opacity: 0.55; cursor: not-allowed; }
.pay-method i { color: var(--teal); }
.pay-crypto-detail { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; margin-top: 1rem; align-items: start; }
.pay-qr canvas { display: block; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.copy-row { display: flex; gap: 0.45rem; align-items: stretch; }
.copy-row input { flex: 1; }
@media (max-width: 640px) {
  .pay-methods, .pay-crypto-detail { grid-template-columns: 1fr; }
}
#nav-toggle { display: none; }
@media (max-width: 980px) {
  .stats, .grid-2, .form-grid { grid-template-columns: 1fr 1fr; }
  .sidebar { position: fixed; z-index: 20; transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.is-open { transform: none; }
  #nav-toggle { display: grid; }
  .who { display: none; }
}
@media (max-width: 640px) {
  .stats, .grid-2, .form-grid { grid-template-columns: 1fr; }
  .content { padding: 0.9rem; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
