@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Marca (muestreada del logo) */
  --brand: #0a1f5c;
  --brand-hover: #071645;
  --brand-deep: #050c2c;
  --brand-50: #f1f4fb;
  --brand-100: #e2e8f6;
  --brand-ring: rgba(10, 31, 92, 0.18);
  --brand-orange: #f85c00;
  --brand-orange-2: #f89a10;
  --brand-orange-soft: #fff4eb;
  --accent: var(--brand);
  --accent-hover: var(--brand-hover);

  /* Neutros */
  --bg: #f6f7f9;
  --card: #ffffff;
  --surface-2: #f9fafb;
  --ink: #0b1220;
  --ink-2: #334155;
  --muted: #667085;
  --line: #e7e9ee;
  --line-strong: #d4d8e0;

  /* Estados */
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --danger: #c4320a;
  --danger-strong: #b42318;
  --danger-bg: #fef3f2;
  --pending: #b54708;
  --pending-bg: #fffaeb;
  --info-bg: #f1f4fb;

  --sidebar: #ffffff;
  --sidebar-ink: #475467;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 8px 24px -6px rgba(16, 24, 40, 0.1), 0 2px 4px rgba(16, 24, 40, 0.04);
  --touch: 44px;
  --bottom-nav-h: 64px;
  --mobile-top-h: 56px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100%;
}

body {
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.icon {
  display: block;
  flex-shrink: 0;
}

/* —— Layout shell —— */
.layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  width: 248px;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  border-right: 1px solid var(--line);
  padding: 1.5rem 0.9rem 1rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.brand {
  padding: 0 0.6rem;
  margin: 0 0 1.75rem;
}

.brand-logo {
  display: block;
  height: 34px;
  width: auto;
}

.brand small {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 40px;
  color: var(--sidebar-ink);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: background 0.15s, color 0.15s;
}

.nav a .icon { color: #98a2b3; transition: color 0.15s; }

.nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}

.nav a:hover .icon { color: var(--ink-2); }

.nav a.active {
  background: var(--brand-50);
  color: var(--brand);
  font-weight: 600;
}

.nav a.active .icon { color: var(--brand); }

.nav a.active::before {
  content: "";
  position: absolute;
  left: -0.9rem;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--brand-orange-2), var(--brand-orange));
}

.nav-logout {
  margin-top: auto !important;
  border-top: 1px solid var(--line);
  border-radius: 0 !important;
  padding-top: 0.9rem !important;
}

.nav-logout:hover {
  background: transparent !important;
  color: var(--danger-strong) !important;
}

.nav-logout:hover .icon { color: var(--danger-strong) !important; }

.main {
  flex: 1;
  padding: 2rem 2.25rem 3rem;
  min-width: 0;
  max-width: 1120px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h3 { font-weight: 600; letter-spacing: -0.01em; }

.topbar-who {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-2);
}

.topbar-who:empty { display: none; }

.topbar-who::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
}

.muted { color: var(--muted); }

/* Panel-only chrome (hidden on desktop by default for mobile pieces) */
.mobile-topbar,
.bottom-nav {
  display: none;
}

/* —— Cards & metrics —— */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.card + .card,
.stack > .card + .card {
  margin-top: 1rem;
}

.grid > .card + .card {
  margin-top: 0;
}

.card h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.metric {
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
}

.metric .unit {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 0.2rem;
}

.metric,
td,
.transfer-card-total,
.fund-preview strong,
.detail-item .value {
  font-variant-numeric: tabular-nums;
}

.metric-note {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

/* PROD: tarjeta principal en azul de marca */
.balance-card.prod {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(248, 154, 16, 0.16), transparent 45%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-md);
}

.balance-card.prod::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-orange), var(--brand-orange-2));
}

.balance-card.prod h2 { color: rgba(255, 255, 255, 0.72); }
.balance-card.prod .metric { color: #fff; }
.balance-card.prod .metric .unit,
.balance-card.prod .muted { color: rgba(255, 255, 255, 0.68); }

.balance-card.prod .badge.prod {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.balance-card.prod .badge.prod::before { background: var(--brand-orange-2); }

.quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}

@media (min-width: 700px) {
  .quick-links {
    grid-template-columns: repeat(4, 1fr);
  }
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 1rem 1.05rem 1.05rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  min-height: var(--touch);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.quick-link .ql-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand);
  margin-bottom: 0.6rem;
}

.quick-link:hover {
  border-color: var(--brand-100);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.quick-link span:not(.ql-icon) {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

.hint {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--info-bg);
  border: 1px solid var(--brand-100);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 0.9rem;
}

.hint strong { color: var(--ink); }

/* —— Badges —— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.18rem 0.6rem 0.18rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.35;
  text-transform: capitalize;
  background: #f2f4f7;
  color: var(--ink-2);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.badge.test { background: #f2f4f7; color: #475467; text-transform: uppercase; letter-spacing: 0.03em; }
.badge.prod { background: var(--brand-50); color: var(--brand); text-transform: uppercase; letter-spacing: 0.03em; }
.badge.completed,
.badge.approved { background: var(--ok-bg); color: var(--ok); }
.badge.pending { background: var(--pending-bg); color: var(--pending); }
.badge.failed,
.badge.rejected { background: var(--danger-bg); color: var(--danger-strong); }
.badge.muted { background: #f2f4f7; color: var(--muted); }

/* —— Tables —— */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.card:has(> table),
.table-wrap.card {
  padding: 0;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  white-space: nowrap;
}

tbody tr { transition: background 0.12s; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }

th:first-child, td:first-child { padding-left: 1.1rem; }
th:last-child, td:last-child { padding-right: 1.1rem; }

th.num,
td.num {
  text-align: right;
  white-space: nowrap;
}

td.num { font-weight: 500; }

/* Transfer cards (mobile) */
.transfer-cards {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.transfer-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  font-weight: 400;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}

.transfer-card:hover {
  text-decoration: none;
  border-color: var(--line-strong);
}

.transfer-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.transfer-card-id {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

.transfer-card-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.transfer-card-total {
  font-weight: 650;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.empty-state {
  text-align: center;
  padding: 2.25rem 1rem;
  color: var(--muted);
}

/* —— Filters —— */
.filters {
  margin-bottom: 1rem;
}

.filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.filters-form .field {
  flex: 1 1 140px;
  min-width: 120px;
  margin: 0;
}

.filters-form .field label {
  margin-bottom: 0.3rem;
}

.filters-form .field select,
.filters-form .field input {
  max-width: none;
}

.filters-form .filter-actions {
  flex: 0 0 auto;
}

/* —— Forms & buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1.1rem;
  min-height: var(--touch);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  text-decoration: none;
  color: #fff;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.btn.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.btn.secondary:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn.danger {
  background: #fff;
  color: var(--danger-strong);
  border-color: #fecdca;
  box-shadow: var(--shadow);
}

.btn.danger:hover {
  background: var(--danger-bg);
  border-color: #fda29b;
  color: var(--danger-strong);
}

.btn.small {
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  min-height: 36px;
}

.btn.block {
  width: 100%;
}

form .row { margin-bottom: 1rem; }

label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ink-2);
}

input, select, textarea {
  width: 100%;
  max-width: 420px;
  padding: 0.6rem 0.8rem;
  min-height: var(--touch);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder,
textarea::placeholder { color: #98a2b3; }

input:hover, select:hover, textarea:hover {
  border-color: #b9bfcb;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

input[type="file"] {
  padding: 0.45rem;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.area-panel input,
.area-panel select,
.area-panel textarea {
  max-width: none;
}

.flash {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-weight: 500;
  font-size: 0.92rem;
  border: 1px solid transparent;
  border-left-width: 3px;
}

.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: #abefc6; border-left-color: var(--ok); }
.flash.err { background: var(--danger-bg); color: var(--danger-strong); border-color: #fecdca; border-left-color: var(--danger-strong); }

/* —— Auth —— */
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem 1.25rem;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(10, 31, 92, 0.1), transparent 70%),
    radial-gradient(45% 40% at 95% 100%, rgba(248, 92, 0, 0.08), transparent 70%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 2rem 1.75rem 1.75rem;
  border-color: var(--line);
  box-shadow: 0 24px 48px -12px rgba(16, 24, 40, 0.12), 0 2px 4px rgba(16, 24, 40, 0.04);
}

.auth-logo-link {
  display: block;
}

.auth-logo {
  display: block;
  width: min(200px, 64%);
  height: auto;
  margin: 0 auto 1.6rem;
}

.auth-card h1 {
  margin-bottom: 0.3rem;
  font-size: 1.3rem;
  text-align: center;
}

.auth-card h1 + .muted {
  text-align: center;
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}

.auth-card input {
  max-width: none;
}

.auth-card .btn {
  width: 100%;
  margin-top: 0.4rem;
}

.auth-footer {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.auth-switch {
  margin: 1.25rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-switch a { font-weight: 600; }

.auth-card-wide {
  max-width: 680px;
}

.auth-card-wide input,
.auth-card-wide select,
.auth-card-wide textarea {
  max-width: none;
}

.form-section-title {
  margin: 1.4rem 0 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid .span-2 {
    grid-column: 1 / -1;
  }
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}

.hp-field {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.review-banner {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  background: var(--pending-bg);
  border: 1px solid #fedf89;
  border-left: 3px solid #f79009;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 0.9rem;
}

.review-banner strong { color: var(--pending); }

.notice-title {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-weight: 600;
}

.notice-body { margin: 0; }

.request-label {
  margin: 1.1rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.request-description {
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.kyc-admin-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.kyc-admin-photo {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
  text-decoration: none;
}

.kyc-admin-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.2s;
}

.kyc-admin-photo:hover img { transform: scale(1.03); }

.kyc-admin-photo span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 0.6rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}

.kyc-admin-photo.is-empty {
  display: grid;
  place-items: center;
}

.kyc-admin-photo.is-empty span {
  position: static;
  padding: 0;
  background: none;
  color: var(--muted);
  font-weight: 500;
}

.kyc-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.kyc-reject-form {
  flex: 1 1 260px;
  min-width: 0;
}

/* —— Code / copy —— */
pre, code { font-family: var(--mono); }

code {
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.code-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.code-row code {
  flex: 1 1 200px;
  min-width: 0;
}

.pre-wrap {
  position: relative;
  margin: 0.75rem 0;
}

.pre-wrap .copy {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  float: none;
  z-index: 1;
}

pre {
  background: #0e1628;
  color: #e4e7ec;
  border: 1px solid #1d2939;
  padding: 1rem;
  padding-top: 2.6rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.8rem;
  line-height: 1.6;
  margin: 0;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

.copy {
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  min-height: 34px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.copy:hover { background: var(--surface-2); color: var(--ink); }
.copy.copied { background: var(--ok-bg); color: var(--ok); border-color: #abefc6; }

.pre-wrap .copy {
  background: rgba(255, 255, 255, 0.08);
  color: #e4e7ec;
  border-color: rgba(255, 255, 255, 0.14);
}

.pre-wrap .copy:hover { background: rgba(255, 255, 255, 0.14); }

.secret-box {
  background: var(--pending-bg);
  border: 1px solid #fedf89;
  border-left: 3px solid #f79009;
  padding: 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.secret-box code {
  display: inline-block;
  max-width: 100%;
  background: #fff;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.url-block {
  margin: 0.65rem 0;
}

.url-block label {
  margin-bottom: 0.35rem;
}

.key-cards {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.key-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  background: var(--surface-2);
}

.key-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

/* —— Docs —— */
.docs-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}

.docs-toc h2 {
  flex: 1 0 100%;
}

.docs-toc a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.25rem 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.docs-toc a:hover {
  background: var(--brand-50);
  border-color: var(--brand-100);
  color: var(--brand);
}

.docs-section {
  margin-top: 1rem;
}

.docs-section:first-of-type {
  margin-top: 0;
}

.detail-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.detail-item .label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.detail-item .value {
  font-size: 0.95rem;
  font-weight: 550;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

/* —— Admin keeps simple responsive —— */
.area-admin .mobile-topbar,
.area-admin .bottom-nav {
  display: none !important;
}

@media (max-width: 899px) {
  .area-admin .layout {
    display: block;
  }

  .area-admin .sidebar {
    width: auto;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 1rem;
  }

  .area-admin .brand {
    margin-bottom: 0.9rem;
  }

  .area-admin .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .area-admin .nav a.active::before { display: none; }

  .area-admin .nav-logout {
    margin-top: 0 !important;
    border-top: 0;
    padding-top: 0.5rem !important;
    border-radius: var(--radius-sm) !important;
  }

  .area-admin .main {
    padding: 1.25rem 1rem 2rem;
  }
}

/* —— Panel mobile —— */
@media (max-width: 899px) {
  .area-panel .layout {
    display: block;
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  }

  .area-panel .sidebar {
    display: none;
  }

  .area-panel .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
    height: calc(var(--mobile-top-h) + env(safe-area-inset-top, 0px));
    padding: 0 0.75rem 0 1rem;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    color: var(--ink);
  }

  .mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
  }

  .mobile-topbar-brand .brand-logo {
    height: 24px;
  }

  .mobile-topbar-brand small {
    display: block;
    padding-left: 0.75rem;
    border-left: 1px solid var(--line);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
  }

  .mobile-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--brand);
    font-weight: 600;
    font-size: 0.86rem;
    padding: 0.45rem 0.6rem;
    min-height: var(--touch);
    text-decoration: none;
  }

  .mobile-logout:hover {
    text-decoration: none;
    color: var(--brand-hover);
  }

  .area-panel .main {
    padding: 1.1rem 1rem 1.5rem;
  }

  .area-panel .topbar {
    margin-bottom: 1rem;
  }

  .area-panel .topbar-who {
    display: none;
  }

  .area-panel .topbar h1 {
    font-size: 1.3rem;
  }

  .area-panel .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--line);
  }

  .bottom-nav a {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-decoration: none;
    color: #98a2b3;
    font-size: 0.68rem;
    font-weight: 500;
    min-height: var(--bottom-nav-h);
    transition: color 0.15s;
  }

  .bottom-nav a span:last-child { color: var(--muted); }

  .bottom-nav a.active,
  .bottom-nav a.active span:last-child {
    color: var(--brand);
    font-weight: 600;
  }

  .bottom-nav a.active::before {
    content: "";
    position: absolute;
    top: 6px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand-orange);
  }

  .bottom-nav a:hover {
    text-decoration: none;
  }

  .bn-icon {
    display: grid;
    place-items: center;
    line-height: 1;
  }

  .quick-links {
    grid-template-columns: 1fr 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 699px) {
  .desktop-only-table {
    display: none !important;
  }

  .transfer-cards {
    display: flex;
  }

  .key-cards {
    display: flex;
  }

  .keys-table-wrap {
    display: none !important;
  }

  .filters-form .filter-actions {
    width: 100%;
  }

  .filters-form .filter-actions .btn {
    width: 100%;
  }
}

@media (min-width: 900px) {
  .area-panel .mobile-topbar,
  .area-panel .bottom-nav {
    display: none !important;
  }

  .area-panel .sidebar {
    display: flex;
  }

  .area-panel .layout {
    padding-bottom: 0;
  }
}

/* —— Fondear —— */
.fund-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: #eef0f3;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.fund-tab {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 0.5rem 0.75rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.fund-tab:hover {
  text-decoration: none;
  color: var(--ink);
}

.fund-tab.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1), 0 1px 2px rgba(16, 24, 40, 0.06);
}

.pay-details {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pay-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}

.pay-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.pay-value {
  min-width: 0;
  padding: 0.45rem 0.6rem;
  overflow-wrap: anywhere;
}

.pay-value:last-child {
  grid-column: 2 / -1;
}

@media (max-width: 480px) {
  .pay-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.3rem 0.5rem;
  }

  .pay-label,
  .pay-value:last-child {
    grid-column: 1 / -1;
  }
}

.pay-steps {
  margin: 0.9rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.pay-steps li + li {
  margin-top: 0.25rem;
}

.pay-steps li::marker {
  color: var(--brand);
  font-weight: 600;
}

.pay-steps ul {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
}

.pay-steps ul li::marker { color: var(--muted); }

.pay-steps code {
  font-size: 0.85rem;
}

.bp-grid {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 700px) {
  .bp-grid {
    grid-template-columns: 260px 1fr;
  }
}

.bp-qr {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.bp-qr img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.bp-check {
  margin: 0.9rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--ok-bg);
  border: 1px solid #abefc6;
  color: var(--ok);
  font-size: 0.88rem;
}

.bp-steps-title {
  margin: 1.5rem 0 0;
  font-size: 0.98rem;
}

.receipt-preview {
  display: block;
  margin-top: 0.6rem;
  max-width: 100%;
  max-height: 260px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  object-fit: contain;
  background: var(--surface-2);
}

.receipt-preview[hidden],
.receipt-warning[hidden] {
  display: none;
}

.receipt-warning {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--danger-strong);
}

.receipt-link {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.receipt-thumb {
  display: inline-block;
  line-height: 0;
}

.receipt-thumb img {
  max-width: 180px;
  max-height: 180px;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  object-fit: cover;
  transition: box-shadow 0.15s;
}

.receipt-thumb:hover img { box-shadow: var(--shadow-md); }

form .row small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .fund-tab {
    padding: 0.5rem 0.35rem;
    font-size: 0.85rem;
  }
}

.fund-preview {
  margin: -0.4rem 0 1rem;
  font-size: 0.9rem;
}

.fund-preview strong {
  color: var(--brand);
  font-size: 1.1rem;
  font-weight: 650;
}

.fund-request-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fund-request-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  background: var(--surface-2);
}

/* —— Idioma ES / EN —— */
.lang-switch {
  display: inline-flex;
  flex-shrink: 0;
  padding: 2px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.lang-switch button {
  min-width: 2.25rem;
  padding: 0.28rem 0.55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.lang-switch button:hover { color: var(--brand); }

.lang-switch button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
  cursor: default;
}

.lang-switch button:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 1px;
}

.sidebar-lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.sidebar-lang > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mobile-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.lang-switch-sm button {
  min-width: 2rem;
  padding: 0.3rem 0.45rem;
}

.auth-card { position: relative; }

.auth-lang {
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.auth-lang ~ .auth-logo-link { margin-top: 0.9rem; }

.auth-lang:hover {
  border-color: var(--line-strong);
  color: var(--brand);
  text-decoration: none;
}
