/* Trading report — static template (no regenerar en cada ejecución) */

:root {
  color-scheme: dark;
  --bg0: #0a0e12;
  --bg1: #121922;
  --bg: var(--bg0);
  --card: #161d27;
  --card-hover: #1c2531;
  --line: rgba(255, 255, 255, 0.07);
  --text: #e8edf4;
  --muted: #8a9bb0;
  --accent: #7eb8ff;
  --profit: #3ee6a4;
  --profit-bg: rgba(62, 230, 164, 0.09);
  --profit-border: rgba(62, 230, 164, 0.35);
  --loss: #ff8b7a;
  --loss-bg: rgba(255, 139, 122, 0.09);
  --loss-border: rgba(255, 139, 122, 0.35);
  --zero: #9aa8bc;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% -10%, rgba(62, 230, 164, 0.06), transparent),
    radial-gradient(900px 600px at 100% 0%, rgba(126, 184, 255, 0.07), transparent),
    linear-gradient(165deg, var(--bg0) 0%, var(--bg1) 45%, #0d1218 100%);
  background-attachment: fixed;
}

#app {
  height: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* Layout: topbar + overlay menu (no sidebar fijo) */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
}

.app-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: 3.25rem;
  padding: 0 0.7rem;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 18, 0.92);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.app-topbar-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-menu-toggle {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.app-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.app-menu-toggle-bars,
.app-menu-toggle-bars::before,
.app-menu-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.18s ease, top 0.18s ease, background 0.18s ease;
}

.app-menu-toggle-bars {
  position: relative;
}

.app-menu-toggle-bars::before,
.app-menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.app-menu-toggle-bars::before {
  top: -6px;
}

.app-menu-toggle-bars::after {
  top: 6px;
}

.app-layout.is-nav-open .app-menu-toggle-bars {
  background: transparent;
}

.app-layout.is-nav-open .app-menu-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.app-layout.is-nav-open .app-menu-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.app-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.app-layout.is-nav-open .app-nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.side-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: 100%;
  height: 100dvh;
  z-index: 40;
  padding: 1.25rem 0 1.5rem;
  background: rgba(10, 14, 18, 0.98);
  border-right: 1px solid var(--line);
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.app-layout.is-nav-open .side-nav {
  transform: translateX(0);
}

@media (min-width: 821px) {
  .side-nav {
    width: min(360px, 100%);
  }
}

.side-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.1rem 1.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.side-nav-brand-mark {
  font-size: 1.1rem;
  color: var(--profit);
  opacity: 0.9;
}

.side-nav-brand-text {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.side-nav-menu {
  padding: 0 0.65rem;
  flex: 1;
}

.side-nav-footer {
  margin-top: auto;
  padding: 1rem 0.65rem 0;
  border-top: 1px solid var(--line);
}

.side-nav-user {
  margin: 0 0 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
  word-break: break-word;
}

.nav-item--logout {
  color: var(--muted);
}

.nav-item--logout:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.nav-group-title {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 0.75rem 0.5rem 0.5rem;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li {
  margin: 0.15rem 0;
}

.nav-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.75rem;
  min-height: 44px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-item.is-active {
  background: linear-gradient(135deg, rgba(126, 184, 255, 0.18), rgba(62, 230, 164, 0.08));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(126, 184, 255, 0.25);
}

.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.content-inner {
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0.7rem 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.view-panels {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.view-panel[hidden] {
  display: none !important;
}

.view-panel.is-active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  animation: viewFade 0.22s ease;
}

.panel-mount {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.panel-mount:has(.operar-fit) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@keyframes viewFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section--flush {
  margin-bottom: 0;
}

.hero {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero .tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero .meta {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.view-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.view-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.view-header-title {
  margin: 0;
  font-size: clamp(1.45rem, 3.5vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.view-header-tagline {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 52rem;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .view-header-tagline {
    display: none;
  }
}

.report-filters[hidden],
#report-footer[hidden],
.token-expiry-banner-mount[hidden] {
  display: none !important;
}

.token-expiry-banner-mount {
  margin-bottom: 1.25rem;
}

.token-expiry-banner {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.22), rgba(220, 53, 69, 0.1));
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
  box-shadow: inset 0 0 0 1px rgba(220, 53, 69, 0.15);
}

.token-expiry-banner__line {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.token-expiry-banner__line + .token-expiry-banner__line {
  margin-top: 0.45rem;
}

.token-expiry-banner strong {
  color: #fff;
  font-weight: 600;
}

.token-expiry-banner code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: #ffe4e6;
}

/* Boot panel (plantilla sin datos embebidos) */
.boot-panel {
  max-width: 560px;
  margin: 2rem auto;
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.boot-panel p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.boot-panel code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  word-break: break-all;
}

.boot-panel input[type="file"] {
  width: 100%;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: var(--bg1);
  color: var(--text);
  cursor: pointer;
}

.boot-panel.hidden {
  display: none;
}

.boot-status {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.boot-status--error {
  color: var(--loss);
}

.auth-gate {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-gate-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text);
}

.auth-gate-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-gate-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.auth-gate-field input {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
}

.auth-gate-error {
  margin: 0;
  color: var(--loss);
  font-size: 0.9rem;
}

.auth-gate-sessions ul {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.btn-filter--secondary {
  margin-top: 0.5rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.btn-filter--secondary:hover {
  border-color: var(--profit);
  color: var(--profit);
}

.boot-hint {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.boot-hint code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
}

/* Sections */
.section {
  margin-bottom: 2.75rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(126, 184, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(126, 184, 255, 0.25);
}

.badge--empty {
  background: rgba(138, 155, 176, 0.12);
  color: var(--muted);
  border-color: var(--line);
}

.subsection {
  margin-top: 1.75rem;
}

.subsection h3 {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.subsection--month-pl {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

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

.month-pl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 0.75rem;
}

.month-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  min-height: 5.5rem;
}

.month-card--profit {
  background: var(--profit-bg);
  border-color: var(--profit-border);
  box-shadow: inset 3px 0 0 var(--profit-border);
}

.month-card--loss {
  background: var(--loss-bg);
  border-color: var(--loss-border);
  box-shadow: inset 3px 0 0 var(--loss-border);
}

.month-card--flat {
  background: rgba(154, 168, 188, 0.06);
}

.month-card-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: capitalize;
}

.month-card-value {
  font-size: 1.15rem;
  line-height: 1.2;
}

.month-card-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

/* Acordeones (cerrados por defecto) */
.accordion {
  margin-top: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.accordion-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-summary::before {
  content: "▸";
  font-size: 0.85rem;
  color: var(--accent);
  transition: transform 0.15s ease;
}

.accordion[open] > .accordion-summary::before {
  transform: rotate(90deg);
}

.accordion-summary:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.accordion-body {
  padding: 0 0 0.85rem;
  border-top: 1px solid var(--line);
}

.accordion--table .accordion-body .table-wrap {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.accordion--table .accordion-body .empty-msg {
  padding: 1rem 1rem 0.25rem;
}

/* Operativas agrupadas — subfilas deslizables */
.op-group-toggle-col,
.op-group-toggle-cell {
  width: 1.75rem;
  text-align: center !important;
  padding-left: 0.65rem !important;
  padding-right: 0.35rem !important;
}

.op-group-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.op-group-toggle:hover {
  color: var(--accent);
}

.op-group-chevron {
  display: inline-block;
  font-size: 0.8rem;
  line-height: 1;
  transition: transform 0.18s ease;
}

.op-group-chevron.is-open {
  transform: rotate(90deg);
}

.op-group-detail-cell {
  padding: 0 !important;
  border-bottom: 1px solid var(--line);
}

.op-group-slide {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}

.op-group-detail.is-open .op-group-slide {
  grid-template-rows: 1fr;
}

.op-group-slide-inner {
  overflow: hidden;
}

table.data.op-group-members {
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  font-size: 0.86rem;
}

table.data.op-group-members td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

table.data.op-group-members tbody tr:last-child td {
  border-bottom: none;
}

table.data.op-group-members tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.op-group-member-spacer {
  width: 1.75rem;
  padding-left: 0.65rem !important;
}

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.kpi:hover {
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.1);
}

.kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.kpi-value.num--profit {
  color: var(--profit);
}
.kpi-value.num--loss {
  color: var(--loss);
}
.kpi-value.num--zero,
.kpi-value.num--neutral {
  color: var(--zero);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.data th,
table.data td {
  padding: 0.65rem 0.85rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
}

table.data th:first-child,
table.data td:first-child {
  text-align: left;
}

table.data thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.25);
}

table.data tbody tr:last-child td {
  border-bottom: none;
}

table.data tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Daily P/L rows */
tr.row-day--profit td {
  background: var(--profit-bg);
  box-shadow: inset 3px 0 0 var(--profit-border);
}
tr.row-day--loss td {
  background: var(--loss-bg);
  box-shadow: inset 3px 0 0 var(--loss-border);
}
tr.row-day--flat td {
  background: rgba(154, 168, 188, 0.05);
}

/* Count columns: tint wins/losses subtly */
.cell-wins {
  color: var(--profit);
  font-weight: 500;
}
.cell-losses {
  color: var(--loss);
  font-weight: 500;
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.num--profit {
  color: var(--profit);
  font-weight: 600;
}
.num--loss {
  color: var(--loss);
  font-weight: 600;
}
.num--zero {
  color: var(--zero);
}

.empty-msg {
  color: var(--muted);
  font-style: italic;
  padding: 1rem 0;
}

.footer-note {
  flex-shrink: 0;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Filtros */
.filter-bar {
  margin-bottom: 0.65rem;
  padding: 0.75rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filter-bar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
}

.filter-bar-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.filter-bar-note {
  font-size: 0.78rem;
  color: var(--muted);
  flex: 1;
  min-width: 200px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem 1rem;
  align-items: end;
}

.flt-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.flt-field span:first-child {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.flt-field input,
.flt-field select {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--text);
  color-scheme: dark;
}

.flt-field select option {
  background-color: var(--card);
  color: var(--text);
}

.flt-field--wide {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .flt-field--wide {
    grid-column: span 1;
  }
}

.flt-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.flt-inline select {
  min-width: 5.5rem;
}

.flt-inline input[type="number"] {
  flex: 1;
  min-width: 120px;
}

.flt-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-filter {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-filter:hover {
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-filter--primary {
  background: linear-gradient(135deg, rgba(126, 184, 255, 0.25), rgba(62, 230, 164, 0.12));
  border-color: rgba(126, 184, 255, 0.35);
}

.btn-filter--sync {
  border-color: rgba(62, 230, 164, 0.45);
  color: var(--profit);
}

.btn-filter--danger {
  border-color: rgba(255, 107, 107, 0.45);
  color: #ff8a8a;
}

.btn-filter--compact {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
}

.btn-filter.is-loading,
.btn-filter:disabled {
  opacity: 0.65;
  cursor: wait;
}

.legacy-note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.22);
  border-radius: 10px;
}

.legacy-note code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

th.th-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.12s ease, background 0.12s ease;
}

th.th-sortable:hover,
.accordion-body th.th-sortable:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

th.th-sortable.is-sorted {
  color: var(--accent);
}

/* Optimización de trading (gráficas) */
.optim-section .section-head {
  margin-bottom: 1rem;
}

.optim-intro {
  margin: 0 0 1.25rem;
  max-width: 52rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.optim-intro strong {
  color: var(--text);
}

.optim-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.optim-stat {
  padding: 0.75rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.optim-stat-k {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.optim-stat-v {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.optim-insight {
  margin: 0 0 1.25rem;
  max-width: 52rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.optim-insight strong {
  color: var(--text);
}

.chart-card {
  margin-top: 1.5rem;
  padding: 1.1rem 1.15rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.22);
}

.chart-card:first-of-type {
  margin-top: 0.25rem;
}

.chart-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.chart-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.chart-canvas-wrap {
  width: 100%;
  min-width: 0;
  margin-top: 0.85rem;
  overflow-x: auto;
}

.chart-canvas-wrap canvas {
  display: block;
  vertical-align: top;
}

/* Tests (exchange) */
.tests-section {
  max-width: 720px;
}

.operar-fit.tests-section {
  max-width: none;
  width: 100%;
  height: 100%;
}

.sim-env-banner {
  max-width: 720px;
  margin: 0 0 1rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, #f59e0b 18%, var(--card));
  border: 1px solid color-mix(in srgb, #f59e0b 45%, var(--line));
  font-size: 0.88rem;
  line-height: 1.5;
}

.view-badge--sim {
  background: color-mix(in srgb, #f59e0b 25%, transparent);
  color: #b45309;
  border-color: color-mix(in srgb, #f59e0b 40%, var(--line));
}

.nav-item--sim.is-active {
  border-left-color: #f59e0b;
}

.sim-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.sim-status-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sim-status-value {
  font-weight: 600;
}

.sim-events-log {
  margin-top: 0.75rem;
  max-height: 8rem;
  overflow: auto;
  font-size: 0.72rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem;
}

.sim-result {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.sim-result.is-error {
  color: var(--danger, #c0392b);
}

.tests-input-readonly {
  background: var(--bg);
  color: var(--muted);
}

.tests-actions--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: flex-end;
}

.tests-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
  line-height: 1.55;
}

.tests-card {
  padding: 1.1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.tests-card--shared {
  margin-bottom: 1.25rem;
}

.tests-card-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.tests-card-desc {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.tests-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.tests-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 140px;
}

.tests-field[hidden],
.operar-pane[hidden],
.operar-form-section[hidden],
.operar-step-hedge[hidden] {
  display: none !important;
}

.tests-field span:first-child {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tests-field input,
.tests-field select {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--text);
  color-scheme: dark;
}

.tests-field select option {
  background-color: var(--card);
  color: var(--text);
}

.tests-field--wide {
  flex: 1;
  min-width: 160px;
}

.tests-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.tests-result {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-all;
  flex: 1;
  min-width: 200px;
}

.tests-result--ok {
  color: var(--profit);
}

.tests-result--error {
  color: var(--loss);
}

.tests-output {
  margin-top: 0.85rem;
  font-size: 0.85rem;
}

.tests-output--ok {
  border-left: 3px solid var(--profit);
  padding-left: 0.75rem;
}

.tests-output--error {
  border-left: 3px solid var(--loss);
  padding-left: 0.75rem;
}

.tests-muted {
  color: var(--muted);
  margin: 0;
}

.tests-webhook-block {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.tests-webhook-block--compact {
  margin: 0.35rem 0 0.5rem;
}

.tests-webhook-label {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.tests-webhook-url {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--accent);
}

.tests-webhook-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.tests-webhook-row td {
  background: var(--bg);
  border-top: none;
  padding-top: 0;
}

.tests-error {
  color: var(--loss);
  margin: 0;
  font-size: 0.82rem;
  word-break: break-word;
}

.tests-dl {
  margin: 0;
  display: grid;
  gap: 0.35rem 1rem;
}

.tests-dl-row {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.tests-dl dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tests-dl dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  word-break: break-all;
}

.plan-preview {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.plan-preview-ref {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: var(--bg1);
  border: 1px solid var(--line);
}

.plan-preview-ref-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-preview-ref-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.plan-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.plan-preview-grid--single {
  grid-template-columns: 1fr;
}

@media (max-width: 820px) {
  .plan-preview-grid {
    grid-template-columns: 1fr;
  }
}

.plan-preview-section {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 92%, var(--bg1));
}

.plan-preview-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.plan-preview-dl {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.plan-preview-row {
  display: grid;
  grid-template-columns: minmax(110px, 42%) 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.plan-preview-row dt {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
}

.plan-preview-row dd {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-word;
}

.plan-preview-hint {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.tests-table-wrap {
  margin-top: 0.85rem;
  overflow-x: auto;
}

.tests-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.tests-table th,
.tests-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.tests-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.tests-row--highlight td {
  background: rgba(62, 230, 164, 0.08);
}

.tests-table-actions {
  text-align: right;
  white-space: nowrap;
}

.tests-empty {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.tests-card--live {
  border-color: rgba(240, 185, 60, 0.35);
}

.tests-live-ticker {
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  background: linear-gradient(145deg, rgba(240, 185, 60, 0.08), rgba(0, 0, 0, 0.15));
  border: 1px solid rgba(240, 185, 60, 0.2);
  border-radius: 12px;
}

.tests-live-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.tests-live-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f0b93c;
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(240, 185, 60, 0.45);
  border-radius: 6px;
}

.tests-live-symbol {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.tests-live-status {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
}

.tests-live-status--ok {
  color: var(--profit);
}

.tests-live-status--error {
  color: var(--loss);
}

.tests-live-status--paused {
  color: var(--muted);
}

.tests-live-price {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.15;
  color: #f0b93c;
  letter-spacing: -0.02em;
}

.tests-live-price--flash {
  animation: tests-price-flash 0.35s ease;
}

@keyframes tests-price-flash {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

.tests-live-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.tests-card--entry {
  border-color: rgba(126, 184, 255, 0.25);
}

.operar-fit {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.operar-native-fields {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.operar-wizard {
  position: relative;
}

.operar-steps {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
}

.operar-steps li[hidden] {
  display: none;
}

.operar-step {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  min-height: 36px;
  cursor: pointer;
}

.operar-step.is-current {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 16%, var(--card));
}

.operar-step.is-done {
  color: var(--text);
}

.operar-step:disabled {
  opacity: 0.45;
  cursor: default;
}

.operar-context {
  flex-shrink: 0;
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.operar-pane {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.operar-pane-lead {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.operar-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}

.operar-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--text);
  cursor: pointer;
}

.operar-choice.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
}

.operar-choice.is-disabled,
.operar-choice:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.operar-choice-label {
  font-size: 1rem;
  font-weight: 650;
}

.operar-choice-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.operar-wizard .tests-card-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.operar-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem 1rem;
}

.operar-stack .tests-field {
  min-width: 0;
}

.operar-wizard .tests-field input,
.operar-wizard .tests-field select,
.operar-wizard .tests-level-input,
.operar-wizard .tests-loss-input {
  min-height: 44px;
  font-size: 1rem;
}

.operar-form-section {
  margin-top: 0.25rem;
  padding-top: 0;
}

.operar-form-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.operar-form-divider {
  margin: 0 0 0.85rem;
  border: 0;
  border-top: 1px solid var(--line);
}

.tests-row--common {
  margin-bottom: 0.25rem;
}

.tests-field--plain-level {
  grid-column: 1 / -1;
}

.operar-level-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.operar-level-mode {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  min-height: 36px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.operar-level-mode.is-selected {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 16%, var(--card));
}

.operar-level-mode:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.operar-level-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.operar-level-prefix {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.operar-level-input-wrap .tests-level-input {
  flex: 1;
}

.operar-level-suffix {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.operar-level-hint {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  line-height: 1.4;
}

.tests-field--level .tests-level-control {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.tests-auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.tests-auto-toggle.is-hidden {
  display: none;
}

.tests-auto-toggle input {
  accent-color: var(--accent);
}

.tests-level-input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.tests-level-input.is-auto {
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-sans);
}

.tests-level-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tests-loss-input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.tests-field.is-disabled,
.tests-field input:disabled,
.tests-field select:disabled {
  opacity: 0.55;
}

.tests-field input:disabled,
.tests-field select:disabled {
  cursor: not-allowed;
}

.tests-row--entry,
.tests-row--hedged {
  margin-top: 0.75rem;
}

.tests-loss-hint {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.operar-step-error {
  margin: 0.75rem 0 0;
  color: var(--danger, #c0392b);
  font-size: 0.85rem;
}

.operar-wizard-footer {
  flex-shrink: 0;
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.operar-wizard-footer [hidden],
.operar-context[hidden] {
  display: none !important;
}

.operar-watch-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.65rem;
}

.operar-watch-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

@media (min-width: 640px) {
  .operar-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operar-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* —— Casos de uso (seguimiento) —— */
.uc-page-header {
  margin-bottom: 1.25rem;
}
.uc-page-lead {
  color: var(--muted);
  max-width: 52rem;
  line-height: 1.5;
}

/* —— Formularios admin (usuarios, cuentas exchange) —— */
.admin-create-form {
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg1);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}

.admin-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 0;
}

.admin-form-field > span:first-child {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-form-field--wide {
  grid-column: span 2;
}

@media (max-width: 640px) {
  .admin-form-field--wide {
    grid-column: span 1;
  }
}

.admin-form-field input,
.admin-form-field select,
.admin-form-select {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-form-field input:focus,
.admin-form-field select:focus,
.admin-form-select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.admin-form-field select,
.admin-form-select {
  cursor: pointer;
  appearance: none;
  color-scheme: dark;
  padding-right: 2rem;
  background-color: var(--card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1.5 1.5 6 6l4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}

.admin-form-field select option,
.admin-form-select option {
  background-color: var(--card);
  color: var(--text);
}

.admin-form-field select option:checked,
.admin-form-select option:checked {
  background-color: color-mix(in srgb, var(--accent) 22%, var(--card));
  color: var(--text);
}

.admin-form-field select option:hover,
.admin-form-select option:hover {
  background-color: var(--card-hover);
  color: var(--text);
}

.admin-field-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--danger, #e55);
}

.admin-section-title {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.admin-settings-grid {
  grid-template-columns: 1fr;
}

.admin-setting-desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  line-height: 1.35;
}

.admin-setting-meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.admin-form-actions .btn-filter {
  width: auto;
  min-width: 0;
}

/* —— Cuentas exchange (admin) —— */
.admin-exchange-section {
  margin-bottom: 1.75rem;
}

.admin-exchange-section .admin-section-title {
  margin-top: 0;
}

.admin-exchange-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-exchange-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-exchange-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg1);
}

.admin-exchange-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.admin-exchange-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  min-width: 0;
}

.admin-ex-key {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
  border: 1px solid var(--line);
}

.admin-ex-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.admin-ex-badge--ok {
  color: color-mix(in srgb, #4ade80 85%, var(--text));
  border-color: color-mix(in srgb, #4ade80 35%, var(--line));
  background: color-mix(in srgb, #4ade80 12%, transparent);
}

.admin-ex-badge--off {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 8%, transparent);
}

.admin-ex-badge--warn {
  color: color-mix(in srgb, #fbbf24 90%, var(--text));
  border-color: color-mix(in srgb, #fbbf24 35%, var(--line));
  background: color-mix(in srgb, #fbbf24 10%, transparent);
}

.admin-exchange-card-grid {
  margin-top: 0.15rem;
}

.admin-ex-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.admin-ex-actions .btn-filter {
  width: auto;
  min-width: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

.admin-ex-actions .btn-filter--primary {
  padding: 0.35rem 0.75rem;
}

@media (max-width: 720px) {
  .admin-exchange-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-ex-actions {
    justify-content: flex-start;
  }
}

.uc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.9fr);
  gap: 1rem;
  align-items: start;
}
.uc-table-wrap {
  overflow-x: auto;
}
.uc-row {
  cursor: pointer;
}
.uc-row--selected {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.uc-id {
  font-family: var(--font-mono);
  white-space: nowrap;
}
.uc-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: nowrap;
}
.uc-detail-panel {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--bg1);
}
.uc-detail-header h2 {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}
.uc-summary {
  color: var(--muted);
  margin: 0 0 1rem;
}
.uc-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}
.uc-meta dt {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.uc-meta dd {
  margin: 0;
}
.uc-block {
  margin-bottom: 1rem;
}
.uc-block h3 {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}
.uc-textarea,
.uc-select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg0);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}
.uc-agent-detail {
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  background: var(--bg0);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.45;
}
.uc-hint,
.uc-muted {
  color: var(--muted);
  font-size: 0.82rem;
}
.uc-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.uc-changelog {
  list-style: none;
  padding: 0;
  margin: 0;
}
.uc-changelog li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.uc-changelog-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.uc-status {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.uc-status--pending { background: var(--bg0); color: var(--muted); }
.uc-status--in_review { background: #3b4a6b; color: #dbeafe; }
.uc-status--ok { background: #14532d; color: #bbf7d0; }
.uc-status--improvements { background: #713f12; color: #fde68a; }
.uc-status--bug { background: #7f1d1d; color: #fecaca; }
.uc-empty {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem;
}
@media (max-width: 960px) {
  .uc-layout {
    grid-template-columns: 1fr;
  }
  .uc-detail-panel {
    position: static;
    max-height: none;
  }
}
