:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --text: #0f1f1c;
  --muted: #6b7f79;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-hover: #0d9488;
  --teal-soft: #e6f4f2;
  --teal-muted: #cce8e4;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fef9ee;
  --border: #dfe8e5;
  --shadow: 0 4px 20px rgba(15, 31, 28, 0.06);
  --radius: 14px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  /* aliases legacy */
  --gold: var(--amber);
  --gold-soft: var(--amber-soft);
  --blue: var(--teal);
  --blue-soft: var(--teal-soft);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

.page { max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem 2.5rem; }

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hero-brand { display: flex; align-items: center; gap: 0.85rem; }
.hero-brand h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.03em; }
.hero-brand p { color: var(--muted); font-size: 0.9rem; }

.logo-mark {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.logo-pegasus {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-nav {
  display: flex;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.25rem;
  box-shadow: var(--shadow);
}
.top-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9px;
}
.top-nav a:hover { color: var(--text); background: #f3f8f6; }
.top-nav a.is-active {
  background: var(--teal);
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-ghost:hover { background: #fff; color: var(--text); text-decoration: none; }

.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.75rem; }

.btn-pay {
  background: var(--amber);
  color: #fff;
  margin-top: 0.65rem;
}
.btn-pay:hover { filter: brightness(1.05); text-decoration: none; }

/* Month strip */
.month-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.strip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  box-shadow: var(--shadow);
}

.strip-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.strip-icon.mint { background: var(--teal-soft); color: var(--teal); }
.strip-icon.gold { background: var(--gold-soft); color: var(--gold); }
.strip-icon.blue { background: var(--blue-soft); color: var(--blue); }
.strip-icon.green { background: var(--green-soft); color: var(--green); }

.strip-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.strip-value { font-size: 1.2rem; font-weight: 700; margin-top: 0.1rem; }
.strip-sub { font-size: 0.75rem; color: var(--muted); }

.section-head { margin-bottom: 0.85rem; }
.section-head h2 { font-size: 1.15rem; font-weight: 700; }
.section-head p { color: var(--muted); font-size: 0.9rem; }

/* Partner cards */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.vcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.vcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 31, 28, 0.1);
}
.vcard.is-pay { border-top: 3px solid var(--amber); }
.vcard.is-receive { border-top: 3px solid var(--green); }

.vcard-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f766e, #134e4a);
  color: #fff;
  font-weight: 700;
  display: grid; place-items: center;
  font-size: 1.05rem;
}

.vcard-who { flex: 1; min-width: 0; }
.vcard-who h3 { font-size: 1.05rem; font-weight: 700; }
.vcard-who span { font-size: 0.78rem; color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-pay { background: var(--amber-soft); color: var(--amber); }
.pill-receive { background: var(--green-soft); color: var(--green); }

.vcard-metrics {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0.75rem;
}

.metric {
  background: #f7faf9;
  border-radius: 12px;
  padding: 0.75rem;
}
.metric-icon { color: var(--teal); margin-bottom: 0.35rem; }
.metric-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}
.metric-btc {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.2rem;
}
.metric-btc small { font-size: 0.7rem; color: var(--muted); font-weight: 500; }
.metric-usd { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }

.metric-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ring {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 0.35rem;
}
.ring svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: #e5eeeb;
  stroke-width: 3.2;
}
.ring-fg {
  fill: none;
  stroke: var(--teal);
  stroke-width: 3.2;
  stroke-linecap: round;
}
.vcard.is-pay .ring-fg { stroke: var(--amber); }
.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.vcard-result {
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}
.result-pay { background: linear-gradient(135deg, #fff7ed, #ffedd5); }
.result-receive { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }

.result-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--muted);
}
.result-amount {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}
.result-amount .big {
  font-size: 1.45rem;
  font-weight: 700;
  font-family: var(--mono);
}
.result-amount .unit { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.result-amount .usd-eq { color: var(--muted); font-size: 0.85rem; margin-left: auto; }

/* Company */
.company-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

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

.company-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}
.company-head h3 { font-size: 1rem; }

.bar-row {
  display: grid;
  grid-template-columns: 48px 1fr 64px;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
}
.bar-row span { color: var(--muted); }
.bar-row strong { font-family: var(--mono); font-size: 0.75rem; text-align: right; }
.bar-track {
  height: 8px;
  background: #e8f0ee;
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 99px; }
.bar-fill.gold { background: linear-gradient(90deg, #eab308, #ca8a04); }
.bar-fill.green { background: linear-gradient(90deg, #34d399, #047857); }

.company-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}

.company-card.is-client {
  border-color: #99d5ce;
  background: linear-gradient(180deg, #f3fbfa 0%, #fff 40%);
}
.company-card.is-new {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #fff 45%);
}
.company-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.pill-client {
  display: inline-block;
  margin-top: 0.35rem;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill-new {
  display: inline-block;
  margin-top: 0.35rem;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.company-row-4 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.owner-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.owner-chip {
  font-size: 0.72rem;
  background: #f3f6f5;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  color: var(--muted);
}

.wallet-line {
  margin: 0.65rem 0 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #f7faf9;
  border: 1px dashed var(--border);
}
.wallet-line.is-pending {
  background: #fff7ed;
  border-color: #fdba74;
}
.wallet-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
  margin-bottom: 0.25rem;
}
.wallet-tag.warn { color: var(--amber); }
.wallet-line code {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text);
  word-break: break-all;
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.empty-state p { margin-bottom: 1rem; }

.flow-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}
.flow-step {
  display: flex;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.flow-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.flow-step strong { display: block; font-size: 0.95rem; }
.flow-step p { color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }
.flow-meta { font-size: 0.75rem; color: var(--muted); margin-top: 0.35rem; }
.flow-meta.mono { font-family: var(--mono); font-size: 0.68rem; word-break: break-all; }

/* Bolsillos wallets */
.pocket-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
.pocket-total-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.pocket-total-card .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.pocket-total-card .btc {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 0.35rem;
}
.pocket-total-card .usd { color: var(--muted); font-size: 0.85rem; }
.pocket-total-card.custody { border-top: 3px solid var(--teal); }
.pocket-total-card.own { border-top: 3px solid var(--amber); }
.pocket-total-card.all { border-top: 3px solid var(--text); }

.mix-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
  margin-bottom: 0.35rem;
}
.mix-cust { background: var(--teal); }
.mix-own { background: var(--amber); }
.mix-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.pocket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.pocket-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}
.pocket-card.is-custody { border-left: 4px solid var(--teal); }
.pocket-card.is-own { border-left: 4px solid var(--amber); }
.pocket-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.pocket-head h3 { font-size: 1.05rem; letter-spacing: -0.02em; }
.pocket-badge {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}
.pocket-card.is-own .pocket-badge {
  color: var(--amber);
  background: var(--amber-soft);
}
.pocket-bal { text-align: right; }
.pocket-btc {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.05rem;
}
.pocket-btc small { font-size: 0.7rem; color: var(--muted); }
.pocket-usd { font-size: 0.8rem; color: var(--muted); }
.pocket-addr {
  display: block;
  margin: 0.65rem 0 0.85rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  word-break: break-all;
}
.pocket-bar {
  display: flex;
  height: 18px;
  border-radius: 8px;
  overflow: hidden;
  background: #eef4f2;
  margin-bottom: 0.75rem;
}
.pocket-seg { min-width: 2px; transition: width 0.4s ease; }
.pocket-legend {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pocket-legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto auto auto;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.78rem;
}
.pocket-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.pocket-legend .name { font-weight: 600; }
.pocket-legend .pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.pocket-legend .amt { font-family: var(--mono); font-size: 0.72rem; }
.pocket-legend .usd { color: var(--muted); text-align: right; min-width: 4.5rem; }
.pocket-hint, .pocket-empty {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.section-head h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.wallet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.wallet-card h4 { font-size: 0.95rem; margin-bottom: 0.35rem; }
.wallet-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.78rem;
}
.wallet-metrics strong { display: block; font-family: var(--mono); font-size: 0.85rem; }
.badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  margin-left: 0.35rem;
}
.badge-custody { background: var(--teal-soft); color: var(--teal); }
.badge-own { background: var(--amber-soft); color: var(--amber); }
.mono-sm { font-family: var(--mono); font-size: 0.65rem; color: var(--muted); word-break: break-all; }
.text-sm { font-size: 0.8rem; }
.text-muted { color: var(--muted); }
.num { font-family: var(--mono); text-align: right; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  gap: 1rem;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-table th, .data-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.data-table th { color: var(--muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; }

@media (max-width: 900px) {
  .flow-strip { grid-template-columns: 1fr; }
  .month-strip { grid-template-columns: 1fr 1fr; }
  .pocket-totals { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .month-strip { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .vcard-metrics { grid-template-columns: 1fr; }
  .pocket-legend li { grid-template-columns: 10px 1fr auto; }
  .pocket-legend .usd { display: none; }
  .top-nav { width: 100%; justify-content: space-between; }
}

/* Uptime page */
.uptime-chart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.3rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.uptime-chart-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.uptime-chart-panel h3 { font-size: 1rem; }
.chart-toggle { display: flex; gap: 0.35rem; }
.chart-toggle .btn.is-active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.chart-wrap { position: relative; width: 100%; }

.uptime-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--block-color, var(--teal));
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
}
.uptime-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.uptime-block-head h3 { font-size: 1.05rem; letter-spacing: -0.02em; }
.uptime-block-head p { color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 48px;
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.2rem;
  background: #f7faf9;
  border-radius: 10px;
}
.mini-bar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  min-width: 0;
}
.mini-bar span {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}

.up-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 140px;
}
.up-track {
  flex: 1;
  height: 8px;
  background: #e8f0ee;
  border-radius: 99px;
  overflow: hidden;
}
.up-fill { height: 100%; border-radius: 99px; }

/* Month tabs + cache */
.month-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}
.month-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  box-shadow: var(--shadow);
}
.month-tab em {
  font-style: normal;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
}
.month-tab.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.month-tab.status-upcoming {
  border-style: dashed;
  color: var(--amber);
}
.month-tab.status-upcoming.is-active {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}

.cache-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: #f7faf9;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  margin-bottom: 1.1rem;
}
.cache-bar.is-fresh { border-color: #a7f3d0; background: #ecfdf5; }
.cache-bar.is-stale { border-color: #fcd34d; background: #fffbeb; }
.cache-sep { opacity: 0.5; }

.top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.kpi-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.kpi-ico {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.kpi-ico.teal { background: var(--teal-soft); color: var(--teal); }
.kpi-ico.amber { background: var(--amber-soft); color: var(--amber); }
.kpi-ico.blue { background: var(--blue-soft); color: var(--blue); }
.kpi-ico.green { background: var(--green-soft); color: var(--green); }
.kpi-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.kpi-val { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 0.15rem; }
.kpi-val small { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.kpi-sub { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.kpi-link {
  position: absolute;
  right: 0.75rem;
  bottom: 0.55rem;
  font-size: 0.7rem;
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
}

.uptime-preview { margin-bottom: 1.5rem; }
.uptime-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.up-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--c, var(--teal));
  border-radius: 14px;
  padding: 0.75rem;
  box-shadow: var(--shadow);
}
.up-mini-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
}
.up-mini-top span { font-family: var(--mono); font-weight: 700; color: var(--c); }
.up-mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 36px;
  background: #f3f8f6;
  border-radius: 6px;
  padding: 2px;
}
.up-mini-bars i {
  flex: 1;
  display: block;
  background: var(--c);
  opacity: 0.85;
  border-radius: 1px 1px 0 0;
  min-height: 1px;
}
.up-mini-foot { margin-top: 0.35rem; font-size: 0.72rem; color: var(--muted); }

.pending-month {
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  box-shadow: var(--shadow);
}
.pending-ico { color: var(--amber); margin-bottom: 0.75rem; }
.pending-lead { color: var(--muted); margin: 0.35rem 0 1rem; }
.pending-list {
  list-style: none;
  display: inline-block;
  text-align: left;
  margin: 0 auto 1.25rem;
  color: var(--text);
  font-size: 0.9rem;
}
.pending-list li { padding: 0.35rem 0 0.35rem 1.2rem; position: relative; }
.pending-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.7rem;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

@media (max-width: 900px) {
  .kpi-strip, .uptime-preview-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .kpi-strip, .uptime-preview-grid { grid-template-columns: 1fr; }
}

/* —— Flujos wallets (columnas + conexiones) —— */
.flow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.flow-leg { display: inline-flex; align-items: center; gap: 0.4rem; }
.flow-leg i {
  width: 28px; height: 3px; border-radius: 2px; display: inline-block;
}
.flow-leg-btc i { background: #0f766e; }
.flow-leg-usdt i { background: #1d4ed8; }
.flow-leg-planned i {
  background: transparent;
  border-top: 2px dashed #b45309;
  height: 0;
}

.sankey-board {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}
.sankey-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.sankey-lines path { pointer-events: stroke; cursor: pointer; }

.sankey-col {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.sankey-col-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0 0.25rem 0.35rem;
}
.sankey-ico {
  width: 10px; height: 10px; border-radius: 3px;
}
.sankey-ico.pool { background: #64748b; }
.sankey-ico.mid { background: var(--teal); }
.sankey-ico.sink { background: #1d4ed8; }

.sankey-node {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--node, var(--teal));
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, transform 0.15s;
}
.sankey-node.is-hot {
  box-shadow: 0 0 0 2px var(--node), var(--shadow);
  transform: translateY(-1px);
}
.sn-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.sn-top strong { font-size: 0.9rem; }
.sn-amt, .sn-bal {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
}
.sn-amt small, .sn-bal small { font-size: 0.65rem; color: var(--muted); font-weight: 600; }
.sn-sub, .sn-usd { font-size: 0.72rem; color: var(--muted); }
.sn-addr {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  word-break: break-all;
}

.flow-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.flow-row {
  display: grid;
  grid-template-columns: 1.2fr 24px 1.2fr 1.4fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.flow-row:last-child { border-bottom: none; }
.flow-from, .flow-to { font-family: var(--mono); font-size: 0.72rem; }
.flow-arrow { color: var(--muted); text-align: center; }
.flow-label { color: var(--muted); }
.flow-amt { font-family: var(--mono); font-weight: 600; text-align: right; }
.flow-row.style-usdt { border-left: 3px solid #1d4ed8; }
.flow-row.style-btc { border-left: 3px solid #0f766e; }
.flow-row.style-planned { border-left: 3px dashed #b45309; background: #fffbeb; }

@media (max-width: 900px) {
  .sankey-board { grid-template-columns: 1fr; }
  .sankey-lines { display: none; }
  .flow-row { grid-template-columns: 1fr; gap: 0.2rem; }
}



/* Resumen mensual (estilo Excel Pagos BTC) */
.resumen-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.2rem;
  margin-bottom: 1.25rem;
}
.resumen-panel.aparte { border-color: #c4b5fd; background: #faf5ff; }
.resumen-panel .panel-header { margin-bottom: 0.75rem; }
.resumen-panel .panel-header h3 { margin: 0; font-size: 1.05rem; }
.resumen-table .mono { font-family: var(--mono); font-size: 0.78rem; }
.resumen-table .indent { padding-left: 1.4rem; color: var(--muted); }
.resumen-table tr.row-group td { background: #f0f7f5; font-weight: 600; }
.resumen-table tr.row-member td { background: transparent; }
.resumen-table tr.row-total td {
  border-top: 2px solid var(--ink);
  font-weight: 700;
  background: #f8faf9;
}
.tag-own {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 600;
}
.dividend-block { margin-top: 1rem; }
.dividend-block h4 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}
.div-totals {
  margin-left: auto;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--mono);
}
.resumen-notes {
  margin: 0.5rem 0 1.5rem;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

/* ── Página Pago (simple) ── */
.pago-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.pago-kicker {
  color: var(--teal);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.pago-hero h2 {
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}
.pago-sub { color: var(--muted); font-size: 0.9rem; }
.pago-total {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 1.2rem;
  text-align: right;
  box-shadow: var(--shadow);
}
.pago-total span { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.pago-total strong { font-size: 1.6rem; font-family: var(--mono); letter-spacing: -0.03em; }
.pago-total em { color: var(--muted); font-style: normal; font-size: 0.85rem; margin-left: 0.25rem; }

.pago-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.35rem;
  margin-bottom: 1.15rem;
}
.pago-step > header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.pago-step > header h3 { font-size: 1.05rem; margin: 0 0 0.15rem; }
.pago-step > header p { color: var(--muted); font-size: 0.88rem; margin: 0; }
.paso {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.paso-amber { background: var(--amber); }
.paso-green { background: var(--green); }

.pago-grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.pago-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #f8fbfa;
}
.pago-box-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.pago-box-top strong {
  font-family: var(--mono);
  font-size: 1.15rem;
}
.pago-box > p { color: var(--muted); font-size: 0.82rem; margin: 0; }
.pago-mini {
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
  line-height: 1.35;
}
.tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tag-teal { background: var(--teal-soft); color: var(--teal); }
.tag-blue { background: var(--blue-soft); color: var(--blue); }
.tag-amber { background: var(--amber-soft); color: var(--amber); }

.pago-luis-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 0.75rem;
  background: #0f1f1c;
  color: #fff;
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.pago-luis-bar span {
  display: block;
  font-size: 0.72rem;
  opacity: 0.7;
  margin-bottom: 0.15rem;
}
.pago-luis-bar strong {
  font-family: var(--mono);
  font-size: 1.1rem;
}
.pago-addr code {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  word-break: break-all;
  opacity: 0.95;
}

.pago-mohamed {
  border: 1.5px solid #f59e0b;
  background: #fffbeb;
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.pago-mohamed-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.pago-mohamed-main h4 { font-size: 1.1rem; margin: 0 0 0.15rem; }
.pago-mohamed-main p { color: var(--muted); font-size: 0.85rem; margin: 0; }
.pago-mohamed-amt { text-align: right; }
.pago-mohamed-amt span { display: block; font-size: 0.72rem; color: var(--amber); font-weight: 700; }
.pago-mohamed-amt strong { font-family: var(--mono); font-size: 1.5rem; }
.pago-mohamed-amt em { font-style: normal; color: var(--muted); }

.pago-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.pago-kpi-row > div {
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}
.pago-kpi-row span { display: block; font-size: 0.7rem; color: var(--muted); font-weight: 600; margin-bottom: 0.2rem; }
.pago-kpi-row strong { font-family: var(--mono); font-size: 0.92rem; display: block; }
.pago-kpi-row em { font-style: normal; font-size: 0.75rem; color: var(--muted); }

.pago-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.pago-step-total {
  margin-left: auto;
  text-align: right;
}
.pago-step-total span { display: block; font-size: 0.72rem; color: var(--muted); }
.pago-step-total strong { font-family: var(--mono); font-size: 1.15rem; }
.pago-step-total em { font-style: normal; color: var(--muted); font-size: 0.8rem; }

.pago-table-wrap { overflow-x: auto; }
.pago-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.pago-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
}
.pago-table td {
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid #eef3f1;
  vertical-align: top;
}
.pago-table td strong { display: block; font-family: var(--mono); font-size: 0.88rem; }
.pago-table td small { color: var(--muted); font-size: 0.75rem; }
.pago-table td.neto strong { color: var(--teal); }
.pago-table tfoot td {
  border-top: 2px solid var(--text);
  border-bottom: none;
  padding-top: 0.85rem;
  font-weight: 600;
}
.btn-sm { padding: 0.3rem 0.55rem; font-size: 0.75rem; }
.pago-foot {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.25rem;
}

@media (max-width: 900px) {
  .pago-grid3,
  .pago-luis-bar,
  .pago-kpi-row { grid-template-columns: 1fr; }
  .pago-step-total { margin-left: 0; text-align: left; width: 100%; }
}
