/* ==========================================================
   Nexus — Enterprise dark mode design system (minimal, flat)
   ========================================================== */

:root {
  --bg: #050505;
  --bg-elevated: #080808;
  --surface: #0c0c0c;
  --surface-hover: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f2f2;
  --text-secondary: #9a9a9a;
  --text-muted: #555555;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 24px;
  --transition: 0.15s ease;
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 900px) {
  :root {
    /* Separación más amplia (65px) para asegurar que ninguna barra de estado se coma la app */
    --sat: 65px;
    --sab: max(env(safe-area-inset-bottom, 0px), 32px);
  }
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
  overflow-y: scroll;
}

/* Scrollbar — transparent & dark adaptive */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-corner {
  background: transparent;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle cinematic background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 55% at 80% 30%, rgba(234, 88, 12, 0.16), transparent 55%),
    radial-gradient(ellipse 55% 45% at 70% 55%, rgba(220, 38, 38, 0.10), transparent 50%),
    radial-gradient(ellipse 80% 60% at 55% 100%, rgba(180, 83, 9, 0.08), transparent 45%),
    var(--bg);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 40%, transparent 30%, rgba(0,0,0,0.82) 100%);
  pointer-events: none;
}

/* Vertical grid lines (disabled) */
.grid-lines {
  display: none;
}

/* Page loader */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.page-loader.done {
  opacity: 0;
  visibility: hidden;
}
.page-loader .ring {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.75rem, 8vw, 6rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}
.hero-title .line {
  display: block;
}
.hero-title .line.right {
  text-align: right;
  padding-right: 6vw;
  color: rgba(242, 242, 242, 0.78);
}

.page-title {
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.page-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
}

/* Navbar */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(70px + var(--sat));
  padding-top: var(--sat);
  padding-left: clamp(1.25rem, 4vw, 3rem);
  padding-right: clamp(1.25rem, 4vw, 3rem);
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
}

.top-nav-left,
.top-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}
.top-nav-right {
  justify-content: flex-end;
}

.user-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.8rem 0.25rem 0.25rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  max-width: 220px;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-secondary);
  flex-shrink: 0;
}
.user-avatar svg {
  width: 14px;
  height: 14px;
}
.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}

.brand-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--accent);
}
.brand-icon svg {
  width: 16px;
  height: 16px;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-menu a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 0.9rem;
  font-size: 0.82rem;
  font-weight: 450;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-xl);
  transition: color var(--transition), background var(--transition);
}

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

.nav-item-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-item-dropdown > a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-item-dropdown > a::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.6;
}
.nav-submenu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 150px;
  padding: 0.4rem;
  background: rgba(10,10,10,0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 101;
}
.nav-item-dropdown:hover .nav-submenu,
.nav-item-dropdown:focus-within .nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-submenu a {
  justify-content: flex-start;
  height: 34px;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle svg {
  width: 18px;
  height: 18px;
}

/* Buttons */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 1.1rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-xl);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn-pill-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  color: #fff;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}
.btn-pill-primary:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 55%, #2563eb 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-pill-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-pill-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.03);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 40px;
  padding: 0 1.1rem;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  background: var(--surface);
  color: var(--text);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  color: #fff;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 55%, #2563eb 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.32);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.03);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.35);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.08);
}

.btn-sm {
  height: 34px;
  padding: 0 0.85rem;
  font-size: 0.82rem;
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-icon-only svg {
  width: 16px;
  height: 16px;
}
.btn-icon-only:hover {
  color: var(--text);
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.32);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.btn-icon-only.success:hover { color: var(--success); border-color: rgba(34,197,94,0.55); background: rgba(34,197,94,0.08); }
.btn-icon-only.danger:hover { color: var(--danger); border-color: rgba(239,68,68,0.55); background: rgba(239,68,68,0.08); }
.btn-icon-only.bnb-verify:hover { color: #60a5fa; border-color: rgba(96,165,250,0.55); background: rgba(96,165,250,0.08); }

/* Main layout */
.main {
  padding-top: calc(110px + var(--sat));
  padding-bottom: calc(5rem + var(--sab));
  padding-left: env(safe-area-inset-left, clamp(1.25rem, 4vw, 3rem));
  padding-right: env(safe-area-inset-right, clamp(1.25rem, 4vw, 3rem));
  max-width: 1800px;
  margin: 0 auto;
}

/* Page head */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

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

/* Sections (flat) */
.section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.card {
  background: transparent;
  border: none;
  border-radius: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0.75rem;
  border-bottom: 1px solid var(--border);
}
.card-head h3 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.card-body {
  padding: 0.75rem 0 0;
}

/* Stats — flat horizontal blocks */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 2.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 1.25rem 1.5rem;
  border-right: 1px solid var(--border);
}
.stat:last-child {
  border-right: none;
}

.stat .num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat .label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 450;
}

.stat-sublabel {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  font-weight: 400;
}

.market-stats .stat.highlight .num {
  color: var(--accent);
}

/* P2P ads by bank */
.p2p-ads-by-bank {
  width: 100%;
}
.p2p-ads-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.p2p-ads-header .section-title {
  margin-bottom: 0;
}
.p2p-ads-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.p2p-ads-updated {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.p2p-ads-count {
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}
.p2p-ads-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.p2p-ads-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.p2p-bank-group {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.p2p-bank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.p2p-bank-header:hover {
  background: rgba(255,255,255,0.04);
}
.p2p-bank-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}
.p2p-bank-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.2);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.p2p-bank-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.p2p-bank-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.p2p-bank-badge.sell { color: var(--success); border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.06); }
.p2p-bank-badge.buy { color: var(--accent); border-color: rgba(37,99,235,0.3); background: rgba(37,99,235,0.06); }
.p2p-bank-toggle {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}
.p2p-bank-toggle svg {
  width: 14px;
  height: 14px;
}
.p2p-bank-group.collapsed .p2p-bank-toggle {
  transform: rotate(-90deg);
}
.p2p-bank-group.collapsed .p2p-bank-ads {
  display: none;
}
.p2p-bank-ads {
  overflow: hidden;
}
.p2p-bank-ads table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.p2p-bank-ads thead tr {
  border-bottom: 1px solid var(--border);
}
.p2p-bank-ads th {
  padding: 0.6rem 1.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}
.p2p-bank-ads td {
  padding: 0.6rem 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text);
  vertical-align: middle;
}
.p2p-bank-ads tbody tr:last-child td {
  border-bottom: none;
}
.p2p-bank-ads tbody tr {
  transition: background var(--transition);
}
.p2p-bank-ads tbody tr:hover {
  background: rgba(255,255,255,0.03);
}
.p2p-bank-ads .ad-price {
  font-family: var(--font-display);
  font-weight: 500;
  white-space: nowrap;
}
.p2p-bank-ads .ad-price.sell { color: var(--success); }
.p2p-bank-ads .ad-price.buy { color: var(--accent); }
.p2p-bank-ads .ad-nickname {
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.p2p-bank-ads .ad-limits {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.p2p-bank-ads .ad-active {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
}
.p2p-bank-ads .ad-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}
.p2p-bank-ads .ad-active-dot.offline {
  background: var(--text-muted);
}
.p2p-ads-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.p2p-col {
  min-width: 0;
}

.p2p-col-wide {
  grid-column: span 1;
}

.market-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.market-metric {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.market-metric:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.market-metric:first-child {
  padding-top: 0;
}

.market-metric .num {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.market-metric .label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 450;
}

.market-metric.recommended .num {
  color: var(--accent);
}

.market-card-ads {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1rem;
  min-height: 200px;
}

.ads-side {
  min-height: 80px;
}

.ads-side-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.ads-table {
  font-size: 0.8rem;
}
.ads-table th {
  padding: 0.5rem 0.6rem;
  font-size: 0.65rem;
}
.ads-table td {
  padding: 0.55rem 0.6rem;
}

/* Widget button — minimal circular action */
.btn-widget {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.btn-widget:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.45);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.15);
}
.btn-widget svg {
  width: 16px;
  height: 16px;
}
.btn-widget-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}

/* Refresh button widget */
.btn-refresh {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-refresh svg {
  width: 14px;
  height: 14px;
}
.btn-refresh.spinning svg {
  animation: spin 0.85s linear infinite;
}
.btn-refresh:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

@media (max-width: 1100px) {
  .p2p-bank-ads {
    overflow-x: auto;
  }
  .p2p-bank-ads table {
    min-width: 500px;
  }
}

/* Metrics fallback (if still used) */
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  border: none;
}

.metric {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 1rem 0;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
}
.metric:last-child {
  border-right: none;
}
.metric:hover {
  transform: none;
  border-color: var(--border);
}

.metric .icon-box {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}
.metric .icon-box svg {
  width: 18px;
  height: 18px;
}
.metric .icon-box.accent { color: var(--accent); border-color: rgba(37,99,235,0.35); }
.metric .icon-box.green { color: var(--success); border-color: rgba(34,197,94,0.35); }
.metric .icon-box.amber { color: var(--warning); border-color: rgba(245,158,11,0.35); }
.metric .icon-box.admin { color: #60a5fa; border-color: rgba(96,165,250,0.35); }
.metric .icon-box.red { color: var(--danger); border-color: rgba(239,68,68,0.35); }

.metric .num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
}
.metric .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Tables — clean, flat */
.table-scroll {
  overflow-x: auto;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

thead tr {
  border-bottom: 1px solid var(--border-strong);
}

th {
  text-align: left;
  padding: 0.8rem 1rem;
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  white-space: nowrap;
}

td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--surface-hover);
}

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

/* Badges / pills */
.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.pill-active { color: var(--success); border-color: rgba(34,197,94,0.35); }
.pill-inactive { color: var(--text-secondary); border-color: var(--border); }
.pill-admin { color: #60a5fa; border-color: rgba(96,165,250,0.35); }
.pill-operador { color: var(--accent); border-color: rgba(37,99,235,0.35); }

.badge-group {
  display: inline-flex;
  gap: 0.35rem;
}

.badge-bnb {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: help;
}
.badge-bnb svg {
  width: 14px;
  height: 14px;
}

.badge-bnb-ok { color: var(--success); border-color: rgba(34,197,94,0.55); background: rgba(34,197,94,0.10); }
.badge-bnb-no { color: var(--danger); border-color: rgba(239,68,68,0.55); background: rgba(239,68,68,0.10); }

.row-actions {
  display: inline-flex;
  gap: 0.35rem;
}

/* Empty states */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3.5rem 1rem;
  color: var(--text-secondary);
  text-align: center;
}
.empty svg {
  width: 36px;
  height: 36px;
  opacity: 0.45;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-input {
  width: 100%;
  height: 42px;
  padding: 0 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--text);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input::placeholder {
  color: var(--text-muted);
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2.1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Custom multiselect for payment methods */
.custom-multiselect {
  position: relative;
  width: 100%;
}
.custom-multiselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 0 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--text);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.custom-multiselect-trigger:hover,
.custom-multiselect-trigger:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.custom-multiselect-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 0.5rem;
}
.custom-multiselect-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 260px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 300;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.custom-multiselect-search {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(0,0,0,0.35);
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
}
.custom-multiselect-search::placeholder {
  color: var(--text-muted);
}
.custom-multiselect-list {
  overflow-y: auto;
  max-height: 210px;
  padding: 0.3rem 0;
}
.custom-multiselect-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: background-color var(--transition);
}
.custom-multiselect-item:hover {
  background: rgba(37,99,235,0.12);
}
.custom-multiselect-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.custom-multiselect-empty {
  padding: 0.75rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Drawer */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 5000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.drawer-mask.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 90vw);
  z-index: 5010;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 50px rgba(0,0,0,0.5);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.drawer.open {
  transform: translateX(0);
}
.drawer.shift-left {
  transform: translateX(-300px);
}

.drawer-right {
  width: 300px;
  right: 0;
  z-index: 5010;
  box-shadow: -8px 0 30px rgba(0,0,0,0.4);
}

@media (max-width: 860px) {
  .drawer-right {
    width: min(440px, 90vw);
    z-index: 5015;
  }
  .drawer.shift-left {
    transform: translateX(0);
  }
}

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(1.25rem + var(--sat)) 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.drawer-top h2 {
  font-size: 1.15rem;
  font-weight: 500;
}

.drawer-close {
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.drawer-close:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.drawer-close svg {
  width: 16px;
  height: 16px;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

/* Modal */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.modal-mask.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: min(380px, 100%);
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
}
.modal-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.modal-card p {
  color: var(--text-secondary);
  font-size: 0.86rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
}

/* Toast */
.toast-wrap {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  font-size: 0.82rem;
  color: var(--text);
  animation: toastIn 0.25s ease;
  pointer-events: auto;
}
.toast svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.toast-ok { border-color: rgba(34,197,94,0.35); }
.toast-ok svg { color: var(--success); }
.toast-err { border-color: rgba(239,68,68,0.35); }
.toast-err svg { color: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glass widget — now just a minimal status badge */
.glass-widget {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.95rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: border-color var(--transition);
}
.glass-widget:hover {
  border-color: var(--border-strong);
}

.glass-widget-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.45);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.45); }
  70% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.glass-widget-arrow {
  width: 13px;
  height: 13px;
  opacity: 0.55;
}

/* Login page */
#threeCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

body.login-body {
  padding-bottom: 0 !important;
  overflow: hidden;
}

@media (max-width: 768px) {
  body.login-body,
  body.login-body * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  body.login-body::-webkit-scrollbar,
  body.login-body *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(360px, 100%);
}

.login-card-glow {
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-xl);
  background: conic-gradient(
    from 180deg,
    rgba(239, 68, 68, 0.18),
    rgba(220, 38, 38, 0.08),
    rgba(239, 68, 68, 0.06),
    rgba(220, 38, 38, 0.14),
    rgba(239, 68, 68, 0.18)
  );
  filter: blur(1px);
  animation: borderSpin 6s linear infinite;
  opacity: 0.6;
}
@keyframes borderSpin {
  to { filter: blur(1px) hue-rotate(360deg); }
}

.login-card-inner {
  position: relative;
  padding: 2.5rem 2rem 2rem;
  background: rgba(8, 8, 8, 0.7);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}
.login-brand .brand-icon {
  width: 28px;
  height: 28px;
  color: #ef4444;
}
.login-brand h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-divider {
  width: 40px;
  height: 2px;
  margin: 1.25rem auto 1.5rem;
  background: linear-gradient(90deg, transparent, #ef4444, transparent);
  border-radius: 1px;
  opacity: 0.5;
}

/* Floating label inputs */
.step-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.float-group {
  position: relative;
}

.float-input {
  width: 100%;
  height: 54px;
  padding: 1.35rem 1rem 0.35rem;
  background: rgba(255, 255, 255, 0.03);
  border: none;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-ui);
  outline: none;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.float-input:focus,
.float-input.filled {
  background: rgba(239, 68, 68, 0.03);
}

.float-input:-webkit-autofill,
.float-input:-webkit-autofill:hover,
.float-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(8, 8, 8, 0.85) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text) !important;
  transition: background-color 5000s ease-in-out 0s;
}
.float-input::placeholder {
  color: transparent;
}

.float-label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: left center;
}
.float-input:focus ~ .float-label,
.float-input.filled ~ .float-label {
  top: 0.45rem;
  transform: translateY(0) scale(0.7);
  color: #ef4444;
  letter-spacing: 0.02em;
}

.float-bar {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #ef4444;
  border-radius: 1px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.float-input:focus ~ .float-bar {
  width: 100%;
  left: 0;
}

.toggle-pass {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}
.toggle-pass svg {
  width: 17px;
  height: 17px;
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toggle-pass .eye-closed {
  opacity: 0;
  transform: scale(0.8);
}
.toggle-pass.visible .eye-open {
  opacity: 0;
  transform: scale(0.8);
}
.toggle-pass.visible .eye-closed {
  opacity: 1;
  transform: scale(1);
}
.toggle-pass:hover {
  color: var(--text-secondary);
}

/* Next arrow */
.next-arrow {
  position: absolute;
  right: 6px;
  bottom: 12px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.next-arrow svg {
  width: 18px;
  height: 18px;
}
.next-arrow:hover, .next-arrow:focus {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transform: translateX(2px);
  outline: none;
}
.next-arrow:active {
  transform: scale(0.98);
}

/* Login button */
.login-btn {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.2s ease;
}
.login-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}
.login-btn:hover svg {
  transform: translateX(3px);
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -6px rgba(239, 68, 68, 0.35);
}
.login-btn:active {
  transform: translateY(0);
}

.error-msg {
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--radius-md);
  color: #fca5a5;
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.01em;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  vertical-align: middle;
}
.spinner-white {
  border-color: rgba(255,255,255,0.4);
  border-right-color: transparent;
}

/* Login decorative elements */
.login-deco {
  position: fixed;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1;
  opacity: 0;
  animation: fadeIn 1s ease 0.8s forwards;
}
.login-deco-tl { top: 1.5rem; left: 1.5rem; }
.login-deco-tr { top: 1.5rem; right: 1.5rem; }
.login-deco-bl { bottom: 1.5rem; left: 1.5rem; }
.login-deco-br { bottom: 1.5rem; right: 1.5rem; }

.deco-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.deco-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}
.deco-sep {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.12);
}
.login-deco-br svg {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  opacity: 0.5;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes fadeIn {
  to { opacity: 1; }
}

.login-footer-deco {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1;
  opacity: 0;
  animation: fadeIn 1s ease 1s forwards;
}
.footer-line {
  width: 40px;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.footer-text {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 500;
  color: rgba(255,255,255,0.15);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Step transitions */
.step-hidden {
  display: none;
}
.step-exit {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.step-enter {
  opacity: 0;
  transform: translateY(12px);
  animation: stepIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes stepIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Animations */
.animate-in {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.animate-in-d1 { animation-delay: 0.06s; }
.animate-in-d2 { animation-delay: 0.12s; }
.animate-in-d3 { animation-delay: 0.18s; }
.animate-in-d4 { animation-delay: 0.24s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 900px) {
  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.15rem;
    padding: 1.5rem;
    background: #0a0a0f;
    border-top: 1px solid var(--border);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .nav-menu.open {
    transform: translateX(0);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.85);
  }
  .nav-menu a {
    width: 100%;
    height: 44px;
    padding: 0 1rem;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    justify-content: flex-start;
  }
  .nav-item-dropdown {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  .nav-item-dropdown > a {
    width: 100%;
  }
  .nav-item-dropdown > a::after {
    display: none;
  }
  .nav-submenu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: rgba(255,255,255,0.03);
    border: none;
    box-shadow: none;
    padding: 0 0 0 0.75rem;
    width: 100%;
    border-radius: 8px;
  }
  .nav-submenu a {
    height: 40px;
    padding: 0 1rem;
  }
  .nav-toggle {
    display: grid;
    place-items: center;
  }
  .top-nav-right .btn-pill-ghost {
    display: none;
  }
  .hero-title .line.right {
    text-align: left;
    padding-right: 0;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main {
    padding-top: 95px;
    padding-bottom: 6rem;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
  }
  .stats,
  .metrics {
    flex-direction: column;
    gap: 1rem;
    border: none;
  }
  .stat,
  .metric {
    border: none;
    padding: 0.5rem 0;
  }
  .stat:last-child,
  .metric:last-child {
    border-bottom: none;
  }
  .login-page {
    padding: 1.5rem;
  }
  .login-card-glow {
    display: none;
  }
  .login-card-inner {
    padding: 2rem 1rem;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
  }
  .float-input {
    height: 56px;
    font-size: 16px;
  }

  .login-btn {
    height: 50px;
    font-size: 0.95rem;
  }
  .login-deco-tl,
  .login-deco-tr,
  .login-deco-bl,
  .login-deco-br,
  .login-footer-deco {
    display: none;
  }
  .footer-text {
    font-size: 0.5rem;
  }
  .glass-widget {
    bottom: 1rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.72rem;
    max-width: 90vw;
  }
}

@media (max-width: 380px) {
  .login-card-inner {
    padding: 1.75rem 1.25rem 1.25rem;
  }
  .login-brand .brand-icon {
    width: 24px;
    height: 24px;
  }
  .login-brand h1 {
    font-size: 1.2rem;
  }
}

/* FX rates ticker card */
.fx-ticker {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.fx-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
}
.fx-ticker-item .currency {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fx-ticker-item .rate {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
}
.fx-ticker-item .source {
  color: var(--text-muted);
  font-size: 0.7rem;
}
.fx-ticker-loading {
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.fx-ticker-error {
  color: var(--danger);
  font-size: 0.8rem;
}

/* Radio / scanner button */
.btn-radio {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
  position: relative;
}
.btn-radio:hover {
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.35);
}
.btn-radio svg {
  width: 14px;
  height: 14px;
}
.btn-radio::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.btn-radio.pulse::after {
  border-color: rgba(245, 158, 11, 0.35);
  animation: pulse 1.6s infinite;
}

/* My ads drawer */
.myads-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.myads-empty {
  color: var(--text-secondary);
  font-size: 0.86rem;
  text-align: center;
  padding: 2rem 0;
}
.myads-empty-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
}
.myads-empty-action .empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--accent);
  border: 1px dashed var(--border-strong);
}
.myads-card {
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.myads-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.myads-card .type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.myads-card .type.sell { color: var(--success); }
.myads-card .type.buy { color: var(--accent); }
.myads-card .price {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
}
.myads-card .meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.myads-card .meta span + span::before {
  content: '·';
  margin: 0 0.4rem;
  color: var(--text-muted);
}
.myads-card .status {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.myads-card .status.online { color: var(--success); border-color: rgba(34,197,94,0.35); }
.myads-card .status.paused { color: var(--warning); border-color: rgba(245,158,11,0.35); }
.myads-card .status.closed { color: var(--danger); border-color: rgba(239,68,68,0.35); }
.myads-card .status.offline { color: var(--text-secondary); border-color: var(--border); }

.myads-config {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.myads-config p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.7rem;
  line-height: 1.45;
}
.myads-config .form-row {
  display: flex;
  gap: 0.5rem;
}
.myads-config .form-row input {
  flex: 1;
}

/* Drawer tabs */
.drawer-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
}
.drawer-tab {
  flex: 1;
  height: 38px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.drawer-tab:hover {
  color: var(--text);
}
.drawer-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.drawer-tab-panel {
  display: none;
}
.drawer-tab-panel.active {
  display: block;
}

/* Create ad form */
.myads-form .form-group {
  margin-bottom: 0.9rem;
}
.myads-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}
.myads-form .form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.myads-form textarea.form-input {
  height: auto;
  padding-top: 0.6rem;
  resize: vertical;
  min-height: 58px;
}

/* Payment methods dropdown */
.pay-methods-group {
  min-width: 0;
}
.pay-methods-dropdown {
  position: relative;
}
.pay-methods-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.pay-methods-trigger:hover {
  border-color: var(--border-strong);
}
.pay-methods-trigger-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pay-methods-trigger-arrow {
  font-size: 0.65rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.pay-methods-menu {
  position: fixed;
  z-index: 500;
  display: flex;
  flex-direction: column;
  width: 280px;
  max-height: 260px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  overflow: hidden;
}
.pay-methods-search {
  padding: 0.5rem 0.6rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
  outline: none;
}
.pay-methods-search::placeholder {
  color: var(--text-muted);
}
.pay-methods-options {
  overflow-y: auto;
  padding: 0.35rem;
}
.pay-method-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text);
  transition: background 0.15s ease;
}
.pay-method-option:hover {
  background: var(--surface-hover);
}
.pay-method-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.pay-method-option span {
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pay-methods-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.pay-method-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text);
}
.pay-method-tag button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
}
.pay-method-tag button:hover {
  color: var(--danger);
}

/* Orders toolbar */
.orders-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
  align-items: end;
}
.orders-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.orders-field label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding-left: 0.1rem;
}
.orders-field .form-input {
  min-height: 38px;
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
}
.orders-actions {
  display: flex;
  gap: 0.5rem;
  align-items: end;
}
.orders-actions button {
  flex: 1;
  min-height: 38px;
}

/* Order card */
.order-card {
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.order-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}
.order-card.selected {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.45);
}
.order-card:active {
  transform: scale(0.995);
}
.order-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.order-card .type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.order-card .type.sell { color: var(--success); }
.order-card .type.buy { color: var(--accent); }
.order-card .amount {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
}
.order-card .status {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.order-card .status.pending { color: var(--warning); border-color: rgba(245,158,11,0.35); }
.order-card .status.paid { color: var(--accent); border-color: rgba(37,99,235,0.35); }
.order-card .status.completed { color: var(--success); border-color: rgba(34,197,94,0.35); }
.order-card .status.cancelled { color: var(--danger); border-color: rgba(239,68,68,0.35); }
.order-card .status.dispute { color: #f43f5e; border-color: rgba(244,63,94,0.35); }
.order-card .status.expired { color: var(--text-secondary); border-color: var(--border); }
.order-card .meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
  line-height: 1.4;
}
.order-card .meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.order-card .meta span:not(:last-child)::after {
  content: "•";
  margin-left: 0.3rem;
  opacity: 0.4;
}
.order-card .order-hint {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.45rem;
  opacity: 0.7;
}

/* Order detail drawer */
.order-detail-card {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.order-detail-empty {
  padding: 2rem 0.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.order-detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.order-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  gap: 1rem;
}
.order-detail-row:last-child { border-bottom: none; }
.order-detail-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.order-detail-value {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: right;
  font-family: var(--font-display);
  word-break: break-word;
  max-width: 65%;
}
.order-detail-value.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}
.drawer-detail {
  z-index: 5010;
}

.drawer-wide {
  width: min(980px, 95vw);
}

@media (max-width: 860px) {
  .drawer-wide {
    width: min(980px, 95vw);
  }
}

/* Account drawer */
.account-card {
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.account-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-top: 0.75rem;
}
.account-label:first-child { margin-top: 0; }
.account-balance {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 0.25rem;
}
.account-value {
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

/* Bot config in create ad form */
.bot-config {
  padding: 0.75rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.01);
}
.bot-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.bot-toggle input { accent-color: var(--accent); }
.bot-range {
  margin-top: 0.75rem;
}

/* Ad actions */
.ad-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}

/* Pulse assign button */
@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.btn-pulse {
  animation: pulse-glow 1.5s infinite;
}

.assign-user-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.assign-user-item:last-child { border-bottom: none; }
.assign-user-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.assigned-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--accent);
}
.assigned-label::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.tracking-sync-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.btn-tracking-sync {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.btn-tracking-sync:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-tracking-sync svg {
  width: 14px;
  height: 14px;
}
.btn-tracking-sync.spinning svg {
  animation: spin 0.85s linear infinite;
}
.btn-tracking-sync:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
.tracking-sync-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.tracking-sync-info span:first-child {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.tracking-sync-info span:last-child {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Tracking / seguimiento view */
.tracking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.tracking-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 4rem 1rem;
  color: var(--text-secondary);
  text-align: center;
}

.tracking-card {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.tracking-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}
.tracking-card-pulse {
  animation: tracking-pulse 2s infinite;
}

@keyframes tracking-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.25); border-color: rgba(34, 197, 94, 0.35); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); border-color: var(--border); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); border-color: var(--border); }
}

.tracking-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.tracking-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.tracking-type.sell { color: var(--success); }
.tracking-type.buy { color: var(--accent); }

.tracking-order-count {
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  padding: 0.15em 0.5em;
  border-radius: 999px;
  white-space: nowrap;
}

.tracking-row-inconsistent {
  background: rgba(234, 88, 12, 0.06) !important;
}
.tracking-row-inconsistent:hover {
  background: rgba(234, 88, 12, 0.12) !important;
}
.tracking-type-badge-inconsistent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.65rem;
  color: #ea580c;
  cursor: help;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.tracking-card-price {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.tracking-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.tracking-card-meta span {
  color: var(--text-muted);
}

.tracking-card-users {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}
.tracking-card-users span {
  color: var(--text-muted);
}

.tracking-card-note {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--warning);
}

.tracking-card-admin {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.tracking-card-admin span {
  color: var(--text-muted);
}

.tracking-card-admin-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  padding: 0.15em 0.5em;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Tracking layout: columns, header, counts */
.tracking-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: flex-start;
  flex: 1;
}

@media (max-width: 1024px) {
  .tracking-columns {
    grid-template-columns: 1fr;
  }
}

.tracking-column {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.column-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.column-count {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* Tracking layout: sidebar + main */
.tracking-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  min-height: 0;
}

.tracking-sidebar {
  width: 260px;
  min-width: 220px;
  max-width: 300px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 160px);
  position: sticky;
  top: 100px;
}

.tracking-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.tracking-sidebar-header h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tracking-sidebar-count {
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  padding: 0.15em 0.5em;
  border-radius: 999px;
  min-width: 1.2em;
  text-align: center;
}

.tracking-sidebar-list {
  overflow-y: auto;
  flex: 1;
  padding: 0.4rem;
}

.tracking-sidebar-order {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background 0.12s ease;
  margin-bottom: 2px;
  border: 1px solid transparent;
}
.tracking-sidebar-order:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.tracking-sidebar-order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.tracking-sidebar-order-amount {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.tracking-sidebar-order-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.tracking-sidebar-order-id {
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

.tracking-sidebar-order-date {
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tracking-sidebar-order-admin {
  font-size: 0.62rem;
  font-weight: 600;
  color: #818cf8;
}

.tracking-sidebar-order .status {
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.1em 0.45em;
  border-radius: 999px;
  white-space: nowrap;
}
.tracking-sidebar-order .status.pending { color: var(--warning); }
.tracking-sidebar-order .status.paid { color: var(--accent); }
.tracking-sidebar-order .status.completed { color: var(--success); }
.tracking-sidebar-order .status.cancelled { color: var(--danger); }

.tracking-sidebar-list::-webkit-scrollbar {
  width: 4px;
}
.tracking-sidebar-list::-webkit-scrollbar-track {
  background: transparent;
}
.tracking-sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}

.tracking-main {
  flex: 1;
  min-width: 0;
}

.tracking-order-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.tracking-order-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.tracking-order-field label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.tracking-order-field .form-input {
  min-height: 38px;
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
}
.tracking-order-field button {
  min-height: 38px;
  margin-top: auto;
}

.tracking-order-empty {
  padding: 2rem 0.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.tracking-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.tracking-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.tracking-table thead tr {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-strong);
}
.tracking-table th {
  padding: 0.7rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
}
.tracking-table td {
  padding: 0.65rem 0.65rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
.tracking-table tbody tr:last-child td {
  border-bottom: none;
}
.tracking-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
.tracking-table td.num {
  font-family: var(--font-display);
  text-align: right;
}
.tracking-table td.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}
.tracking-table .status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.tracking-table .status.pending { color: var(--warning); border-color: rgba(245,158,11,0.35); }
.tracking-table .status.paid { color: var(--accent); border-color: rgba(37,99,235,0.35); }
.tracking-table .status.completed { color: var(--success); border-color: rgba(34,197,94,0.35); }
.tracking-table .status.cancelled { color: var(--danger); border-color: rgba(239,68,68,0.35); }

/* ==========================================================
   Operaciones P2P — Chat layout
   ========================================================== */

.operations-page .main {
  padding-top: 80px;
  padding-bottom: 0;
  height: 100vh;
  max-width: 100%;
}

.operations-layout {
  display: flex;
  height: calc(100vh - 80px);
  border-top: 1px solid var(--border);
  background: rgba(5,5,5,0.6);
  backdrop-filter: blur(8px);
}

.operations-sidebar {
  width: 340px;
  min-width: 300px;
  max-width: 380px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: rgba(8,8,8,0.7);
}

.operations-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.1rem 0.75rem;
}

.operations-sidebar-head h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.operations-unread-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: 11px;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.operations-search-wrap {
  position: relative;
  padding: 0 1rem 0.75rem;
}

.operations-search-wrap svg {
  position: absolute;
  left: 1.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.operations-search {
  width: 100%;
  height: 38px;
  padding: 0 0.85rem 0 2.4rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.operations-search:focus {
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.05);
}

.operations-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.75rem 0.75rem;
}

.operations-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  min-height: 180px;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
}

.operations-empty .spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

.operations-empty p {
  margin: 0;
  line-height: 1.4;
  max-width: 220px;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ad-group {
  margin-bottom: 0.5rem;
  animation: fade-in-up 0.3s ease-out both;
}

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

.order-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.6rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid transparent;
  margin-bottom: 0.25rem;
  animation: fade-in-up 0.25s ease-out both;
}

.order-list-item:hover {
  background: rgba(255,255,255,0.05);
}

.order-list-item.active {
  background: rgba(37,99,235,0.10);
  border-color: rgba(37,99,235,0.25);
}

.order-list-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.order-list-body {
  flex: 1;
  min-width: 0;
}

.order-list-top,
.order-list-middle,
.order-list-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.order-list-name {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-list-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.order-list-order {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
}

.order-list-status {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  border-radius: 20px;
}

.order-list-status.pending { color: #f59e0b; background: rgba(245,158,11,0.10); }
.order-list-status.paid { color: #3b82f6; background: rgba(59,130,246,0.10); }
.order-list-status.completed { color: #22c55e; background: rgba(34,197,94,0.10); }
.order-list-status.cancelled { color: #ef4444; background: rgba(239,68,68,0.10); }

.order-list-bottom {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.order-list-unread {
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.operations-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
}

.chat-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.chat-empty-icon svg {
  width: 28px;
  height: 28px;
}

.chat-empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 500;
}

.chat-empty-state p {
  max-width: 320px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-header {
  height: 66px;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,8,8,0.5);
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.chat-header-text {
  min-width: 0;
}

.chat-counterpart {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-order-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chat-status {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

.chat-status.pending { color: #f59e0b; background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.25); }
.chat-status.paid { color: #3b82f6; background: rgba(59,130,246,0.10); border: 1px solid rgba(59,130,246,0.25); }
.chat-status.completed { color: #22c55e; background: rgba(34,197,94,0.10); border: 1px solid rgba(34,197,94,0.25); }
.chat-status.cancelled { color: #ef4444; background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.25); }

.chat-alert-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.25rem;
  background: rgba(245,158,11,0.08);
  border-bottom: 1px solid rgba(245,158,11,0.18);
  color: #f59e0b;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.chat-alert-banner svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.chat-alert-banner span {
  flex: 1;
}

.chat-alert-banner button {
  background: transparent;
  border: none;
  color: #f59e0b;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(5,5,5,0.4);
}

.chat-welcome,
.chat-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.chat-date-separator {
  align-self: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  margin: 0.5rem 0;
}

.chat-bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  animation: fadeIn 0.2s ease;
}

.chat-bubble-own {
  align-self: flex-end;
  background: rgba(37,99,235,0.18);
  border: 1px solid rgba(37,99,235,0.25);
  border-bottom-right-radius: 4px;
}

.chat-bubble-their {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble-system {
  align-self: center;
  max-width: 90%;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.22);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
}

.chat-system-text {
  font-size: 0.82rem;
  color: #fbbf24;
  text-align: center;
}

.chat-sync-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.1rem;
  background: rgba(59,130,246,0.08);
  border-bottom: 1px solid rgba(59,130,246,0.18);
  color: #93c5fd;
  font-size: 0.78rem;
}

.chat-header-actions .btn-success {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-header-actions .btn-success:hover {
  background: rgba(34,197,94,0.2);
  border-color: rgba(34,197,94,0.5);
}

.chat-bubble-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chat-bubble-text {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.chat-bubble-time {
  font-size: 0.7rem;
  opacity: 0.7;
}

.chat-image-preview {
  max-width: 260px;
  max-height: 320px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid var(--border);
}

.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(8,8,8,0.5);
  flex-shrink: 0;
}

.chat-attach-btn,
.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.chat-attach-btn:hover,
.chat-send-btn:hover {
  background: rgba(255,255,255,0.10);
  border-color: var(--border-strong);
  color: var(--text);
}

.chat-send-btn {
  background: rgba(37,99,235,0.12);
  border-color: rgba(37,99,235,0.30);
  color: var(--accent);
}

.chat-send-btn:hover {
  background: rgba(37,99,235,0.20);
  border-color: rgba(37,99,235,0.45);
}

.chat-input-wrap {
  flex: 1;
  min-width: 0;
}

.chat-input {
  width: 100%;
  min-height: 40px;
  max-height: 120px;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
  line-height: 1.4;
}

.chat-input:focus {
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.07);
}

/* Toast de orden entrante */
.incoming-order-toast {
  position: fixed;
  top: 86px;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(10,10,10,0.95);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  max-width: 360px;
  animation: slideInRight 0.3s ease;
}

.incoming-order-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(37,99,235,0.12);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.incoming-order-icon svg {
  width: 18px;
  height: 18px;
}

.incoming-order-body {
  flex: 1;
  min-width: 0;
}

.incoming-order-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.incoming-order-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-order-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.2rem;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

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

/* Responsive operaciones */
@media (max-width: 900px) {
  .operations-layout {
    position: relative;
    overflow: hidden;
  }
  .operations-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    border-right: none;
    display: flex;
  }
  .operations-main {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111115;
    z-index: 10;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, visibility 0.45s;
    display: flex !important;
    border-left: none;
  }
  .operations-layout.chat-open .operations-main {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }
  .chat-back-btn {
    display: inline-flex !important;
  }
  .chat-bubble {
    max-width: 85% !important;
  }
}

/* ==========================================================
   COMPREHENSIVE MOBILE RESPONSIVE
   ========================================================== */

/* --- NAVBAR MOBILE --- */
@media (max-width: 768px) {
  .top-nav {
    height: 60px;
    padding: 0 1rem;
  }
  .brand-text {
    display: none;
  }
  .user-nav {
    max-width: 120px;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem 0.2rem 0.2rem;
  }
  .user-avatar {
    width: 26px;
    height: 26px;
  }
  .user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px;
  }
  .btn-pill-ghost {
    display: none;
  }
  .main {
    padding-top: 80px;
    padding-bottom: 5rem;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .page-title {
    font-size: 1.6rem;
  }
  .page-desc {
    font-size: 0.85rem;
  }
  .page-actions {
    width: 100%;
  }
}

/* --- ADMIN TABLE: converts to cards on mobile --- */
@media (max-width: 640px) {
  .table-scroll table {
    min-width: 0;
  }
  .table-scroll table thead {
    display: none;
  }
  .table-scroll table tbody tr {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
  }
  .table-scroll table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0;
    border-bottom: none;
    font-size: 0.82rem;
  }
  .table-scroll table tbody td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    margin-right: 0.5rem;
  }
  .table-scroll table tbody td:last-child {
    justify-content: flex-end;
    padding-top: 0.5rem;
  }
  .row-actions {
    flex-wrap: wrap;
  }

  /* Metrics stack */
  .metrics {
    flex-direction: column;
    gap: 1rem;
    border: none;
  }
  .metric {
    border: none;
    padding: 0.5rem 0;
  }
  .metric:last-child {
    border: none;
  }
  .metric .num {
    font-size: 1.3rem;
  }
  .icon-box {
    width: 32px;
    height: 32px;
  }
  .icon-box svg {
    width: 16px;
    height: 16px;
  }
}

/* --- FORM GRID single column --- */
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* --- DRAWERS full screen on mobile --- */
@media (max-width: 640px) {
  .drawer {
    width: 100%;
    border-left: none;
    border-radius: 0;
  }
  .drawer-right {
    width: 100%;
  }
  .drawer-wide {
    width: 100%;
  }
  .drawer-top {
    padding: 1rem 1.25rem;
  }
  .drawer-content {
    padding: 1.25rem;
  }
  .drawer-actions {
    padding: 1rem 1.25rem;
    gap: 0.5rem;
  }
  .drawer-actions .btn {
    flex: 1;
    height: 44px;
  }
}

/* --- MODAL responsive --- */
@media (max-width: 640px) {
  .modal-card {
    width: calc(100vw - 2rem);
    padding: 1.25rem;
  }
  .modal-btns {
    flex-direction: column;
  }
  .modal-btns .btn {
    width: 100%;
    height: 44px;
  }
}

/* --- P2P GRID mobile --- */
@media (max-width: 640px) {
  .p2p-ads-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .p2p-ads-status {
    width: 100%;
    justify-content: space-between;
  }
  .p2p-bank-header {
    padding: 0.75rem 0.85rem;
  }
  .p2p-bank-ads th,
  .p2p-bank-ads td {
    padding: 0.5rem 0.85rem;
  }
  .fx-ticker {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.75rem;
  }
}

/* --- TRACKING / SEGUIMIENTO mobile --- */
@media (max-width: 640px) {
  .tracking-layout {
    flex-direction: column;
  }
  .tracking-sidebar {
    width: 100%;
    max-width: 100%;
    max-height: 250px;
    position: static;
  }
  .tracking-grid {
    grid-template-columns: 1fr;
  }
  .tracking-sync-widget {
    width: 100%;
    justify-content: space-between;
  }
  .tracking-sync-info {
    flex-direction: column;
    gap: 0.15rem;
  }
  .tracking-table {
    min-width: 700px;
  }
  .tracking-order-toolbar {
    flex-direction: column;
    gap: 0.5rem;
  }
  .tracking-order-field {
    width: 100%;
  }
  .tracking-order-field .form-input {
    width: 100%;
  }
}

/* --- OPERATIONS / P2P CHAT mobile --- */
@media (max-width: 640px) {
  main.operations-page {
    padding-top: 75px;
    padding-bottom: 0;
  }
  .operations-layout {
    height: calc(100dvh - 140px); /* 75px top nav + 65px bottom nav */
  }
  .operations-sidebar-head {
    padding: 0.85rem 0.85rem 0.6rem;
  }
  .operations-sidebar-head h2 {
    font-size: 1rem;
  }
  .chat-bubble {
    max-width: 90%;
    font-size: 0.85rem;
  }
  .chat-input-wrap {
    padding: 0.6rem;
  }
  .chat-input {
    font-size: 15px;
  }
  .chat-header {
    padding: 0.6rem 0.75rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
    height: auto;
    min-height: 66px;
  }
  .chat-header-info {
    flex: 1;
    min-width: 0; /* allows text truncation */
  }
  .chat-header-actions {
    flex-shrink: 0;
  }
  .chat-order-meta {
    font-size: 0.7rem;
    white-space: normal;
    line-height: 1.2;
    margin-top: 2px;
  }
}

/* --- TOAST mobile --- */
@media (max-width: 640px) {
  .toast-wrap {
    right: 0.75rem;
    left: 0.75rem;
    top: 0.75rem;
  }
  .toast {
    font-size: 0.78rem;
    padding: 0.65rem 0.85rem;
  }
}

/* --- GLASS WIDGET mobile --- */
@media (max-width: 640px) {
  .glass-widget {
    bottom: 0.75rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.7rem;
    max-width: 90vw;
  }
}

/* Custom styling for native selects */
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.9rem;
  padding-right: 2.25rem !important;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-primary);
  transition: border-color 0.25s, box-shadow 0.25s;
}
select.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
select.form-input option {
  background-color: #161618;
  color: #ffffff;
  padding: 0.5rem;
}

/* Styled buttons for Binance status badges in Admin view */
.badge-bnb-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
}
.badge-bnb-btn.ok {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.06);
}
.badge-bnb-btn.no {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
}
.badge-bnb-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.badge-bnb-btn.ok:hover {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.15);
}
.badge-bnb-btn.no:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.15);
}
.badge-bnb-btn:active {
  transform: translateY(0);
}

/* P2P Operations UI improvements */

/* Collapsible Ad Groups (Persianas) */
.ad-group {
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}
.ad-group-header {
  transition: background 0.2s, border-color 0.2s;
}
.ad-group-header:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
.ad-group-orders {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}
.ad-group.collapsed .ad-group-orders {
  max-height: 0;
}
.ad-group.collapsed .ad-group-chevron {
  transform: rotate(-90deg);
}

/* Connection status dot */
.connection-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  display: inline-block;
  transition: all 0.3s ease;
}
.connection-status-dot.connected {
  background-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}
.connection-status-dot.disconnected {
  background-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

/* Active chat pulse indicators on avatars */
.active-pulse-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #22c55e; /* Green */
  border: 2px solid #16161a;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  animation: pulse-green 2s infinite;
}
.active-pulse-dot.unread-pulse {
  background-color: #ef4444; /* Red */
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@keyframes pulse-red {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Chat bubble styling updates (More aesthetic, anchor lines on left/right) */
.chat-bubble-their {
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-left: 3px solid #f3ba2f !important; /* Gold bar on the left representing incoming customer message */
  border-bottom-left-radius: 4px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.chat-bubble-own {
  background: rgba(37, 99, 235, 0.12) !important;
  border: 1px solid rgba(37, 99, 235, 0.22) !important;
  border-right: 3px solid #3b82f6 !important; /* Blue bar on the right representing our sent message */
  border-bottom-right-radius: 4px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chat-bubble-their .chat-bubble-sender {
  color: #f3ba2f !important; /* Highlight sender name in gold (Binance yellow) */
  font-weight: 600;
}
.chat-bubble-own .chat-bubble-sender {
  color: #3b82f6 !important; /* Highlight sender name in blue */
  font-weight: 600;
}

/* ============================================================
   P2P Dashboard Layout
   ============================================================ */

.p2p-dashboard {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Stats Bar ────────────────────────────────────────────── */
.p2p-stats-bar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-lg);
}

.p2p-stat {
  flex: 1 1 auto;
  min-width: 100px;
  background: transparent;
  border: none;
  padding: 0.4rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.p2p-stat-time {
  min-width: 140px;
}

.p2p-stat-num {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.p2p-stat-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Main Grid ────────────────────────────────────────────── */
.p2p-main-grid {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 0.75rem;
  min-height: 0;
}

@media (max-width: 860px) {
  .p2p-main-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Top Sidebar ──────────────────────────────────────────── */
.p2p-top-sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
}

.p2p-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.p2p-sidebar-head h3 {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0;
}

.p2p-sidebar-live {
  font-size: 0.6rem;
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.p2p-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  animation: pulse-green 2s infinite;
}

.p2p-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.p2p-sidebar-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.p2p-sidebar-title.sell {
  color: #ef4444;
}

.p2p-sidebar-title.buy {
  color: #22c55e;
}

.p2p-top-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.p2p-top-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: border-color 0.25s, background 0.25s;
}

.p2p-top-item:hover {
  border-color: var(--border);
  background: rgba(255,255,255,0.04);
}

.p2p-top-item.best {
  border-color: rgba(243, 186, 47, 0.35);
  background: rgba(243, 186, 47, 0.06);
}

.p2p-top-bank {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p2p-top-price-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
}

.p2p-top-price {
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.p2p-top-price.sell {
  color: #ef4444;
}

.p2p-top-price.buy {
  color: #22c55e;
}

.p2p-top-time {
  font-size: 0.55rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.p2p-top-empty {
  font-size: 0.7rem;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  text-align: center;
}

/* ── Banks Area ───────────────────────────────────────────── */
.p2p-banks-area {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.p2p-banks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.p2p-banks-tabs {
  display: flex;
  gap: 0.2rem;
}

.p2p-banks-tab {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.p2p-banks-tab.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}

.p2p-banks-tab:hover:not(.active) {
  background: rgba(255,255,255,0.03);
}

/* ── Bank Columns Grid ────────────────────────────────────── */
.p2p-bank-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.6rem;
  align-items: start;
}

.p2p-ads-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── Bank Column Card ─────────────────────────────────────── */
.p2p-bank-col {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.p2p-bank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.p2p-bank-name {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p2p-bank-count {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.06);
  border-radius: 50px;
  padding: 0.1rem 0.45rem;
}

.p2p-bank-body {
  display: flex;
  flex-direction: column;
  max-height: 350px;
  overflow-y: auto;
}

/* ── Ad Row ───────────────────────────────────────────────── */
.p2p-ad-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}

.p2p-ad-row:last-child {
  border-bottom: none;
}

.p2p-ad-row:hover {
  background: rgba(255,255,255,0.03);
}

.p2p-ad-row.best-row {
  background: rgba(243, 186, 47, 0.05);
}

.p2p-ad-side-badge {
  width: 4px;
  height: 28px;
  border-radius: 3px;
  flex-shrink: 0;
}

.p2p-ad-side-badge.sell {
  background: #ef4444;
}

.p2p-ad-side-badge.buy {
  background: #22c55e;
}

.p2p-ad-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.p2p-ad-price {
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.p2p-ad-price.sell {
  color: #ef4444;
}

.p2p-ad-price.buy {
  color: #22c55e;
}

.p2p-ad-meta {
  font-size: 0.6rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p2p-ad-amount-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
}

.p2p-ad-amount {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.p2p-ad-limits {
  font-size: 0.55rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.p2p-ad-empty {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Top 3 price colors */
.p2p-ad-row.rank-1 { background-color: rgba(239, 68, 68, 0.15) !important; border-left: 3px solid rgba(239, 68, 68, 0.8); }
.p2p-ad-row.rank-2 { background-color: rgba(249, 115, 22, 0.15) !important; border-left: 3px solid rgba(249, 115, 22, 0.8); }
.p2p-ad-row.rank-3 { background-color: rgba(251, 146, 60, 0.1) !important; border-left: 3px solid rgba(251, 146, 60, 0.5); }

/* Bank status panel */
.bank-status-panel { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; margin-bottom: 1.5rem; }
.bank-status-panel h4 { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
.bank-status-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bank-status-badge { font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: var(--radius-xl); border: 1px solid var(--border); background: rgba(255,255,255,0.04); }
.bank-status-badge.active { border-color: rgba(34,197,94,0.3); color: var(--success); }
.bank-status-badge.inactive { border-color: rgba(239,68,68,0.3); color: var(--text-muted); }

/* Ad card actions (my ads drawer) */
.ad-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.ad-card-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.ad-card-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.ad-card-btn:active {
  transform: scale(0.98);
}
.ad-card-btn-assign {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--accent);
}
.ad-card-btn-assign:hover {
  background: rgba(37, 99, 235, 0.08);
}
.ad-card-btn-activate {
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--success);
}
.ad-card-btn-activate:hover {
  background: rgba(34, 197, 94, 0.08);
}
.ad-card-btn-pause,
.ad-card-btn-close {
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--warning);
}
.ad-card-btn-pause:hover,
.ad-card-btn-close:hover {
  background: rgba(245, 158, 11, 0.08);
}
.ad-card-btn-bot {
  margin-left: auto;
}
.ad-card-btn-bot.bot-on {
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--success);
}
.ad-card-btn-bot.bot-off {
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--danger);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
  animation: pulse-dot 1.6s infinite;
}
@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.bot-on { color: var(--success); }
.bot-off { color: var(--danger); }

.order-card .status.online { color: var(--success); border-color: rgba(34,197,94,0.35); }
.order-card .status.paused { color: var(--warning); border-color: rgba(245,158,11,0.35); }
.order-card .status.closed { color: var(--danger); border-color: rgba(239,68,68,0.35); }
.order-card .status.offline { color: var(--text-secondary); border-color: var(--border); }

/* ===== Módulo Operador v2 ===== */
.op-ciclo-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all .2s;
}
.op-ciclo-badge.on {
  color: var(--success);
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.35);
}
.op-no-ads {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.08);
}

/* Secciones */
.op-section { margin-bottom: 36px; }
.op-sec-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.op-sec-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.op-sec-hint {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Bloques internos (sin marco) */
.op-block { }
.op-block-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.op-block h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0;
}
.op-block-top h3 { margin: 0; }

.op-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 768px) { .op-grid-2 { grid-template-columns: 1fr; } }

.op-sync-count {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Tablas */
.op-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.op-table th, .op-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.op-table th { color: var(--text-secondary); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.op-table tfoot td { font-weight: 600; border-bottom: none; border-top: 2px solid var(--border); }
.op-td-actions { width: 40px; text-align: right; }
.op-inp { padding: 6px 10px !important; font-size: 14px !important; width: 130px; }
.op-mono { font-family: monospace; font-size: 13px; color: var(--text-secondary); }
.op-muted { opacity: 0.45; }

/* Grupos expandibles */
.op-group-row { cursor: pointer; transition: background .15s; }
.op-group-row:hover { background: rgba(255,255,255,0.03); }
.op-group-row.expanded { background: rgba(37,99,235,0.06); }
.op-group-row td:first-child::before { content: '▶'; display: inline-block; margin-right: 6px; font-size: 10px; color: var(--text-secondary); transition: transform .2s; }
.op-group-row.expanded td:first-child::before { transform: rotate(90deg); }
.op-detail-rows td { padding: 0 !important; border-bottom: 1px solid var(--border); }
.op-detail-wrap { padding: 0; overflow-x: auto; max-height: 400px; overflow-y: auto; }
.op-table-detail { font-size: 13px; }
.op-table-detail th { font-size: 11px; background: rgba(255,255,255,0.02); position: sticky; top: 0; }
.op-table-detail td { padding: 5px 8px !important; white-space: nowrap; }
.op-table-detail tr:hover { background: rgba(255,255,255,0.02); }
/* Saldos en tiempo real */
.op-saldos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.op-saldo-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; transition: border-color .2s;
}
.op-saldo-card:hover { border-color: var(--accent); }
.op-saldo-card span { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.op-saldo-card span small { font-size: 10px; text-transform: none; letter-spacing: 0; }
.op-saldo-card strong { display: block; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.op-saldo-card small { display: block; font-size: 10px; color: var(--text-secondary); margin-top: 1px; }
.op-saldo-total-bar {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
  padding: 14px 18px; border-radius: 12px;
  background: rgba(37,99,235,0.06); border: 1px solid var(--accent);
}
.op-saldo-total-bar span { font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
.op-saldo-total-bar strong { font-size: 24px; font-variant-numeric: tabular-nums; color: var(--accent); flex: 1; }
.op-saldo-total-bar small { font-size: 12px; color: var(--text-secondary); }
.op-saldo-total-bar.op-pos { border-color: #22c55e; background: rgba(34,197,94,0.04); }
.op-saldo-total-bar.op-pos strong { color: #22c55e; }
.op-saldo-total-bar.op-neg { border-color: #ef4444; background: rgba(239,68,68,0.04); }
.op-saldo-total-bar.op-neg strong { color: #ef4444; }
.op-saldo-bs-total { border-color: #f59e0b; background: rgba(245,158,11,0.04); }
.op-saldo-bs-total strong { color: #f59e0b; }
.op-saldo-bs { border-color: #f59e0b; background: rgba(245,158,11,0.03); }
.op-saldo-bs strong { color: #f59e0b; }
.op-saldo-usdt { border-color: #3b82f6; background: rgba(59,130,246,0.03); }
.op-saldo-usdt strong { color: #3b82f6; }
.op-saldo-disponible { border-color: #22c55e; background: rgba(34,197,94,0.03); }
.op-saldo-disponible strong { color: #22c55e; }
/* Caja chica buttons */
.op-caja-chica { min-width: 260px; vertical-align: top; }
.op-caja-btn {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px; margin: 2px 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: all .15s; font-size: 12px; color: var(--text-primary);
  width: 100%; text-align: left;
}
.op-caja-btn:hover { border-color: var(--accent); background: rgba(37,99,235,0.06); }
.op-caja-icon { font-size: 14px; }
.op-caja-label { flex: 1; color: var(--text-secondary); }
.op-caja-val { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Popup overlay */
.op-popup-overlay {
  position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s;
}
.op-popup {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  width: 440px; max-width: 95vw; max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4); animation: slideUp .2s;
}
.op-popup-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.op-popup-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.op-popup-total { font-size: 14px; color: var(--accent); font-weight: 600; }
.op-popup-close {
  background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-secondary);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: background .15s;
}
.op-popup-close:hover { background: rgba(255,255,255,0.08); }
.op-popup-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.op-popup-form { margin-bottom: 12px; }
.op-popup-row { display: flex; gap: 8px; }
.op-popup-row .form-input { flex: 1; min-width: 0; }
.op-popup-row .btn-primary { white-space: nowrap; }
.op-popup-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.op-popup-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: rgba(255,255,255,0.02); border-radius: 8px; font-size: 13px;
}
.op-popup-item-desc { flex: 1; color: var(--text-primary); }
.op-popup-item-desc small { color: var(--text-secondary); }
.op-popup-item-monto { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.op-popup-empty { text-align: center; color: var(--text-secondary); padding: 20px; font-size: 13px; }
.op-popup-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px;
  color: var(--text-secondary);
}
.op-popup-footer strong { color: var(--text-primary); }
.op-popup-ganancia { font-size: 12px; }
.op-popup-ganancia strong { font-size: 14px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.op-detail-loading, .op-detail-empty { padding: 16px 20px; color: var(--text-secondary); font-size: 13px; text-align: center; }
.op-date-input {
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-display);
  cursor: pointer;
}
.op-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
  opacity: 1;
  padding: 2px;
}

/* Botón palpitante */
.op-pulse {
  transition: all .25s ease;
  position: relative;
}
.op-pulse-off { background: rgba(239,68,68,0.12) !important; border-color: rgba(239,68,68,0.45) !important; color: var(--danger) !important; }
.op-pulse-on {
  background: rgba(34,197,94,0.12) !important;
  border-color: rgba(34,197,94,0.45) !important;
  color: var(--success) !important;
  animation: op-heartbeat 1.4s ease-in-out infinite;
}
@keyframes op-heartbeat {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.45); }
  50% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
}

/* Modal confirmación inline */
.op-toast-confirm {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--danger);
  border-radius: 14px;
  padding: 16px 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.op-toast-confirm-msg { font-size: 15px; color: var(--text-primary); font-weight: 500; }
.op-toast-confirm-btns { display: flex; gap: 10px; justify-content: flex-end; }

/* Config & forms */
.op-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.op-form-mov {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}
.op-form-btn { display: flex; align-items: flex-end; }
.op-form-btn .btn { width: 100%; }

/* Motor / valores calculados */
.op-motor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.op-motor-item {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.op-motor-item span { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; }
.op-motor-item strong { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.op-motor-big { grid-column: 1 / -1; border: 1px solid var(--accent); background: rgba(37,99,235,0.06); }
.op-motor-big strong { font-size: 24px; }

.op-pos { color: var(--success) !important; }
.op-neg { color: var(--danger) !important; }

/* Badges trade type */
.badge-buy { color: var(--success); border: 1px solid rgba(34,197,94,0.35); padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 600; }
.badge-sell { color: var(--danger); border: 1px solid rgba(239,68,68,0.35); padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 600; }

/* Order list item - sin órdenes */
.order-list-item.no-orders {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); font-size: 13px;
  flex-wrap: wrap;
}
.order-list-price { font-weight: 600; color: var(--text-primary); min-width: 70px; }
.order-list-status { font-size: 12px; }
.order-list-nick { color: var(--text-secondary); font-size: 12px; }
.status-offline { color: var(--danger); opacity: 0.7; }

/* ===== Welcome - sin ciclo activo ===== */
.op-welcome {
  text-align: center;
  padding: 32px 20px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border);
}
.op-welcome-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(37,99,235,0.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.op-welcome-icon svg { width: 28px; height: 28px; }
.op-welcome h3 { font-size: 20px; margin-bottom: 18px; font-weight: 600; }
.op-welcome-steps { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin: 0 auto 20px; text-align: left; }
.op-welcome-step {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.03); font-size: 14px; color: var(--text-secondary);
  border: 1px solid transparent;
}
.op-welcome-step span {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
  background: var(--border); color: var(--text-secondary);
}
.op-welcome-step.done { color: var(--text-primary); border-color: rgba(34,197,94,0.2); background: rgba(34,197,94,0.05); }
.op-welcome-step.done span { background: var(--success); color: #000; }
.op-btn-start { font-size: 16px; padding: 14px 40px; }
.op-welcome-hint { font-size: 13px; color: var(--text-secondary); margin-top: 14px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* ===== Mobile: sticky bottom ===== */
@media (max-width: 900px) {
  .op-welcome { padding: 24px 14px; }
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-head .page-desc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .op-date-input { width: 130px; }
  .op-grid-2 { grid-template-columns: 1fr; gap: 14px; }
  .op-config-grid { grid-template-columns: 1fr 1fr; }
  .op-form-mov { grid-template-columns: 1fr 1fr; }
  .op-motor { grid-template-columns: 1fr 1fr; }
  .op-table { font-size: 13px; }
  .op-table th, .op-table td { padding: 6px 7px; }
  .op-inp { width: 100px !important; }
  .metrics { gap: 8px; }
  .metric { min-width: 0; flex: 1 1 calc(50% - 4px); }
  .metric .num { font-size: 1.1rem; }
  .metric .label { font-size: 11px; }
  .op-section { margin-bottom: 24px; }
  .op-sec-head { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .op-config-grid, .op-form-mov, .op-motor { grid-template-columns: 1fr; }
  .metric .icon-box { width: 32px; height: 32px; }
  .metric .icon-box svg { width: 16px; height: 16px; }
}

/* ===== Notificación entrante ===== */
.op-notif {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  min-width: 300px;
  max-width: 420px;
  background: #0d1117 !important;
  border: 1px solid var(--accent) !important;
  box-shadow: 0 4px 24px rgba(37,99,235,0.25) !important;
}
.op-notif-body { font-size: 14px; line-height: 1.4; }
.op-notif-body strong { display: block; font-size: 13px; margin-bottom: 2px; letter-spacing: 0.5px; }

/* ===== Drawer de notificaciones ===== */
.op-notif-drawer {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 500;
  width: 380px;
  max-height: calc(100vh - 100px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0,0,0,0.55);
  transform: translateX(calc(100% + 30px));
  transition: transform .35s cubic-bezier(0.16,1,0.3,1);
}
.op-notif-drawer.open { transform: translateX(0); }
.op-notif-drawer-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
  border-radius: 16px 16px 0 0;
}
.op-notif-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.op-notif-title-row h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.op-notif-title-row .btn-icon-only {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.op-notif-tabs {
  display: flex;
  gap: 8px;
}
.op-notif-tab {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.op-notif-tab:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
.op-notif-tab.active {
  background: rgba(37,99,235,0.12);
  border-color: rgba(37,99,235,0.45);
  color: var(--text-primary);
}
.op-notif-tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--warning);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.op-notif-tab.active .op-notif-tab-badge { background: var(--accent); color: #fff; }
.op-notif-drawer-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.op-notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 8px;
}
.op-notif-list.active {
  display: flex;
}
.op-notif-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  animation: slideInRight .35s cubic-bezier(0.16,1,0.3,1);
  position: relative;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.op-notif-card:hover {
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}
.op-notif-card-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.op-notif-card-icon svg { width: 18px; height: 18px; }
.op-notif-card-icon.venta { background: rgba(239,68,68,0.12); color: var(--danger); }
.op-notif-card-icon.compra { background: rgba(34,197,94,0.12); color: var(--success); }
.op-notif-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.op-notif-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.op-notif-card-type {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.op-notif-card-type.venta { color: var(--danger); }
.op-notif-card-type.compra { color: var(--success); }
.op-notif-card-id {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.op-notif-card-amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.op-notif-card-amount strong {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.op-notif-card-amount span {
  font-size: 13px;
  color: var(--text-secondary);
}
.op-notif-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.op-notif-card-close {
  position: absolute;
  top: 6px; right: 8px;
  width: 24px; height: 24px;
  border: none; background: none; color: var(--text-secondary);
  cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; opacity: 0;
  transition: opacity .15s, background .15s;
}
.op-notif-card:hover .op-notif-card-close { opacity: 0.5; }
.op-notif-card-close:hover { opacity: 1 !important; background: rgba(255,255,255,0.08); }
.op-notif-empty { text-align: center; padding: 28px 16px; color: var(--text-secondary); font-size: 13px; opacity: .8; }

@media (max-width: 900px) {
  .op-notif-drawer {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; max-height: 55vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .op-notif-drawer.open { transform: translateY(0); }
  .op-notif-drawer-head { border-radius: 20px 20px 0 0; }
}

/* ===== FAB flotante ===== */
.op-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transition: transform .2s, box-shadow .2s;
}
.op-fab.show { display: flex; animation: fabIn .3s ease; }
@keyframes fabIn { from { transform: scale(0); opacity:0; } to { transform: scale(1); opacity:1; } }
.op-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,0.6); }
.op-fab svg { width: 22px; height: 22px; }
.op-fab.has-pending { border-color: rgba(245,158,11,0.5); }
.op-fab.all-done { border-color: rgba(34,197,94,0.3); }

.op-fab-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 20px; height: 20px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.has-pending .op-fab-badge { background: var(--warning); color: #000; }
.all-done .op-fab-badge { background: var(--success); }

/* Drawer mobile */
@media (max-width: 900px) {
  .op-fab { bottom: 80px; right: 16px; }
}

/* ===== Panel detalle de orden ===== */
.op-detail-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
.op-detail-panel {
  width: 380px; max-width: 95vw; max-height: 85vh;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 48px rgba(0,0,0,0.7);
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.op-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 15px;
}
.op-detail-head .btn-icon-only { font-size: 20px; width: 32px; height: 32px; }
.op-detail-body { padding: 18px; overflow-y: auto; flex: 1; }
.op-detail-status {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 8px;
  padding: 3px 10px; border-radius: 8px;
  display: inline-block;
  background: rgba(255,255,255,0.05);
}
.op-detail-amount {
  font-size: 28px; font-weight: 700; margin-bottom: 16px;
}
.op-detail-amount small { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.op-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; font-size: 14px;
}
.op-detail-row span { color: var(--text-secondary); }
.op-detail-row strong { font-weight: 600; text-align: right; max-width: 60%; word-break: break-all; }
.op-detail-divider { height: 1px; background: var(--border); margin: 6px 0; }

@media (max-width: 900px) {
  .op-detail-panel { width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; max-height: 80vh; margin-top: auto; }
  .op-detail-overlay { align-items: flex-end; }
}
.op-sugerido { border-color: rgba(34,197,94,0.5) !important; background: rgba(34,197,94,0.04) !important; }
.op-hint-inline { display: block; font-size: 11px; color: var(--success); margin-top: 3px; opacity: 0.8; }

/* Toolbar minimalista */
.op-toolbar {
  display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap;
}
.op-tool-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .2s;
}
.op-tool-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.op-tool-btn svg { width: 18px; height: 18px; opacity: 0.6; }
.op-tool-btn small {
  background: var(--border); color: var(--text-secondary);
  border-radius: 8px; padding: 1px 7px; font-size: 11px; font-weight: 700; min-width: 18px; text-align: center;
}

/* Content drawer */
.op-drawer-overlay {
  position: fixed; inset: 0; z-index: 650;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
.op-drawer-panel {
  width: 450px; max-width: 95vw; max-height: 80vh;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 48px rgba(0,0,0,0.7);
}
.op-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 16px;
}
.op-drawer-body { padding: 16px; overflow-y: auto; flex: 1; }

@media (max-width: 900px) {
  .op-drawer-panel { width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; max-height: 85vh; margin-top: auto; }
  .op-drawer-overlay { align-items: flex-end; }
  .op-tool-btn { flex: 1; justify-content: center; }
}

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-bottom-nav,
.mb-bottom-sheet {
  display: none;
}

@media (max-width: 900px) {
  /* Ocultar elementos de escritorio */
  .nav-toggle, .nav-menu { display: none !important; }
  
  /* Ajustar padding principal para evitar que el nav tape contenido */
  body { padding-bottom: calc(70px + var(--sab)); }
  
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(65px + var(--sab));
    padding-bottom: var(--sab);
    background: #0a0a0a; /* Fondo sólido oscuro, sin transparencias */
    border-top: 1px solid var(--border);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.8);
  }
  
  .mb-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    flex: 1;
    height: 100%;
    gap: 4px;
    transition: color 0.2s, transform 0.2s;
    cursor: pointer;
  }
  
  .mb-nav-icon {
    width: 22px;
    height: 22px;
    transition: transform 0.2s;
  }
  
  .mb-nav-text {
    font-size: 10px;
    font-weight: 600;
  }
  
  .mb-nav-item:hover, .mb-nav-item.active {
    color: var(--primary);
  }
  
  .mb-nav-item:hover .mb-nav-icon, .mb-nav-item.active .mb-nav-icon {
    transform: translateY(-2px);
    filter: drop-shadow(0 2px 4px rgba(37,99,235,0.4));
  }
  
  /* BOTTOM SHEETS PARA SUBMENÚS */
  .mb-bottom-sheet {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .mb-bottom-sheet.show {
    opacity: 1;
    pointer-events: auto;
  }
  
  .mb-sheet-content {
    background: #111111;
    border-radius: 20px 20px 0 0;
    padding: 20px 24px calc(30px + var(--sab));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
  }
  .mb-bottom-sheet.show .mb-sheet-content {
    transform: translateY(0);
  }
  
  .mb-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    margin: 0 auto 16px;
  }
  
  .mb-sheet-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
    text-align: center;
  }
  
  .mb-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0 10px;
  }
  
  .mb-sheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    color: var(--text-primary);
    gap: 10px;
    transition: transform 0.2s;
  }
  
  .mb-sheet-item:active {
    transform: scale(0.95);
  }
  
  .mb-sheet-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.2s ease;
  }
  
  .mb-sheet-icon-wrapper svg {
    width: 24px;
    height: 24px;
  }
  
  .mb-sheet-item:hover .mb-sheet-icon-wrapper {
    background: rgba(37,99,235,0.15); /* primary con opacidad */
    border-color: rgba(37,99,235,0.3);
    color: var(--primary);
  }
  
  .mb-sheet-item span {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.2;
  }
  
  .mb-sheet-item:hover span {
    color: var(--text-primary);
  }
}

@keyframes pulseYellow {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.7)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0)); }
}

.pulse-yellow {
  animation: pulseYellow 1.5s infinite ease-in-out;
  color: #f59e0b;
}

/* ===== FLOATING PAYMENT WIDGET (MODAL) ===== */
.chat-payment-floating {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex !important; /* Override JS inline display */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.chat-payment-floating.show {
  opacity: 1;
  pointer-events: auto;
}

.chat-payment-panel {
  width: 100%;
  max-width: 560px;
  background: rgba(15,15,15,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  transform: scale(0.95) translateY(15px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-height: 85vh;
  overflow-y: auto;
}

.chat-payment-floating.show .chat-payment-panel {
  transform: scale(1) translateY(0);
}





/* ===== PARTÍCULAS TRANSFERENCIA (PAGO <-> ANUNCIOS) ===== */
.data-transfer-particles {
  position: absolute;
  top: 35%;
  left: -25px;
  display: flex;
  gap: 3px;
  pointer-events: none;
  z-index: 10;
}
.data-transfer-particles.active {
  display: flex !important;
}
.dt-dot {
  width: 4px;
  height: 4px;
  background-color: #f59e0b;
  border-radius: 50%;
  opacity: 0;
  animation: data-transfer-anim 1.5s infinite ease-in-out;
}
.dt-dot-1 { animation-delay: 0s; }
.dt-dot-2 { animation-delay: 0.2s; }
.dt-dot-3 { animation-delay: 0.4s; }

@keyframes data-transfer-anim {
  0% { transform: translateX(15px); opacity: 0; }
  50% { opacity: 1; box-shadow: 0 0 8px #f59e0b, 0 0 4px #f59e0b; }
  100% { transform: translateX(-10px); opacity: 0; }
}

/* ================================================================
   ADMIN MOBILE REDESIGN — Optimized for phone consumption
   ================================================================ */

/* --- ADMIN PAGE HEADER MOBILE --- */
@media (max-width: 640px) {
  .main {
    padding: 70px 0.75rem 5rem;
  }

  .page-head {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .page-head > div:first-child {
    width: 100%;
  }

  .page-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
  }

  .page-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
  }

  .page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .page-actions .btn-widget {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 500;
  }

  .page-actions .btn-widget svg {
    width: 18px;
    height: 18px;
  }

  .page-actions .btn-widget-label {
    display: none;
  }
}

/* --- METRICS GRID MOBILE (2x2) --- */
@media (max-width: 640px) {
  .metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0;
    border: none;
  }

  .metric {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .metric .num {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
  }

  .metric .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
  }

  .metric .icon-box {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .metric .icon-box svg {
    width: 15px;
    height: 15px;
  }
}

/* --- APK DOWNLOAD CARD MOBILE --- */
@media (max-width: 640px) {
  .card[style*="animation-delay:.2s"] {
    margin-bottom: 1rem;
  }

  .card[style*="animation-delay:.2s"] .card-body {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .card[style*="animation-delay:.2s"] a {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1rem;
  }
}

/* --- USER TABLE CARDS MOBILE --- */
@media (max-width: 640px) {
  .card[style*="animation-delay:.25s"] {
    margin-bottom: 0;
    background: transparent;
  }

  .card[style*="animation-delay:.25s"] .card-head {
    display: none;
  }

  .card[style*="animation-delay:.25s"] .card-body {
    padding: 0;
  }

  .table-scroll {
    overflow: visible;
  }

  .table-scroll table {
    min-width: 0;
    border: none;
  }

  .table-scroll table thead {
    display: none;
  }

  .table-scroll table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .table-scroll table tbody tr {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    gap: 0;
  }

  .table-scroll table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.8rem;
    min-height: 28px;
  }

  .table-scroll table tbody td:last-child {
    border-bottom: none;
    padding-top: 0.5rem;
  }

  .table-scroll table tbody td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    min-width: 80px;
  }

  /* User name row - make it prominent */
  .table-scroll table tbody td[data-label="Nombre"] {
    font-size: 0.9rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
  }

  .table-scroll table tbody td[data-label="Nombre"]::before {
    display: none;
  }

  /* Hide ID on mobile */
  .table-scroll table tbody td[data-label="ID"] {
    display: none;
  }

  /* Pills and badges */
  .pill {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  .badge-bnb-btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }

  /* Action buttons row */
  .table-scroll table tbody td:last-child {
    justify-content: flex-end;
  }

  .row-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .btn-icon-only {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
  }

  .btn-icon-only svg {
    width: 14px;
    height: 14px;
  }
}

/* --- FORMS MOBILE --- */
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .form-group {
    margin-bottom: 0;
  }

  .form-group label {
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
  }

  .form-input {
    font-size: 0.9rem;
    padding: 0.65rem 0.75rem;
  }

  .drawer-content {
    padding: 1rem;
  }

  .drawer-top {
    padding: 1rem;
  }

  .drawer-actions {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .drawer-actions .btn {
    flex: 1;
    padding: 0.65rem;
  }
}

/* --- CONFIRM MODAL MOBILE --- */
@media (max-width: 640px) {
  .modal-card {
    width: calc(100% - 2rem);
    max-width: 320px;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }

  .modal-card h3 {
    font-size: 1rem;
  }

  .modal-card p {
    font-size: 0.85rem;
  }
}

/* ================================================================
   P2P MOBILE REDESIGN — Optimized for phone consumption
   ================================================================ */

/* --- P2P PAGE HEADER MOBILE --- */
@media (max-width: 640px) {
  .p2p .main,
  .main[style*="max-width:100%"] {
    padding: 70px 0.75rem 5rem;
  }

  .p2p .page-head,
  .main[style*="max-width:100%"] .page-head {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }

  .p2p .page-title,
  .main[style*="max-width:100%"] .page-title {
    font-size: 1.3rem;
  }

  .p2p .page-actions,
  .main[style*="max-width:100%"] .page-actions {
    display: flex;
    gap: 0.4rem;
    width: 100%;
  }

  .p2p .page-actions select,
  .main[style*="max-width:100%"] .page-actions select {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .p2p .page-actions .btn-radio,
  .p2p .page-actions .btn-refresh,
  .main[style*="max-width:100%"] .page-actions .btn-radio,
  .main[style*="max-width:100%"] .page-actions .btn-refresh {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* --- P2P STATS BAR MOBILE --- */
@media (max-width: 640px) {
  .p2p-stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .p2p-stat {
    padding: 0.5rem;
    text-align: center;
    background: transparent;
    border: none;
  }

  .p2p-stat-num {
    font-size: 0.9rem;
    font-weight: 600;
  }

  .p2p-stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
  }

  .p2p-stat-time {
    grid-column: span 3;
  }
}

/* --- P2P MAIN GRID MOBILE --- */
@media (max-width: 640px) {
  .p2p-main-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .p2p-top-sidebar {
    position: static;
    max-height: none;
    order: -1;
  }

  .p2p-sidebar-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .p2p-sidebar-title {
    grid-column: span 2;
  }

  .p2p-top-item {
    padding: 0.3rem;
  }

  .p2p-top-price {
    font-size: 0.8rem;
  }

  .p2p-top-bank {
    font-size: 0.6rem;
  }
}

/* --- P2P BANKS AREA MOBILE --- */
@media (max-width: 640px) {
  .p2p-banks-area {
    order: 0;
  }

  .p2p-banks-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .p2p-banks-tabs {
    display: flex;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
  }

  .p2p-banks-tab {
    flex: 1;
    padding: 0.4rem;
    font-size: 0.75rem;
    text-align: center;
  }

  .p2p-bank-columns {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .p2p-bank-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .p2p-bank-head {
    padding: 0.6rem 0.75rem;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
  }

  .p2p-bank-name {
    font-size: 0.85rem;
    font-weight: 600;
  }

  .p2p-bank-count {
    font-size: 0.7rem;
    color: var(--text-muted);
  }

  .p2p-bank-body {
    max-height: none;
  }

  .p2p-ad-row {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .p2p-ad-info {
    flex: 1;
    min-width: 0;
  }

  .p2p-ad-price {
    font-size: 0.85rem;
    font-weight: 600;
  }

  .p2p-ad-meta {
    font-size: 0.65rem;
  }

  .p2p-ad-amount-col {
    align-items: flex-end;
  }

  .p2p-ad-amount {
    font-size: 0.75rem;
  }

  .p2p-ad-limits {
    font-size: 0.6rem;
  }
}

/* --- FX TICKER MOBILE --- */
@media (max-width: 640px) {
  .fx-ticker {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .fx-ticker::-webkit-scrollbar {
    display: none;
  }

  .fx-ticker-item {
    flex-shrink: 0;
    padding: 0.4rem 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    white-space: nowrap;
  }

  .fx-ticker-loading {
    font-size: 0.75rem;
    color: var(--text-muted);
  }
}

/* --- BANK STATUS PANEL MOBILE --- */
@media (max-width: 640px) {
  .bank-status-panel {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .bank-status-panel h4 {
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
  }

  .bank-status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .bank-status-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }
}

/* Dashboard floating widgets */
.dashboard-widgets {
  position: fixed;
  bottom: calc(1.5rem + var(--sab));
  left: calc(1.5rem + env(safe-area-inset-left, 0px));
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  pointer-events: auto;
}

.dash-widget {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  background: rgba(12, 12, 12, 0.92);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  flex-direction: row-reverse;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dash-widget:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(18, 18, 18, 0.95);
  transform: translateX(4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.6);
}

.dash-widget-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-widget-icon svg {
  width: 14px;
  height: 14px;
}

.dash-widget-icon.amber { color: #f59e0b; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25); }
.dash-widget-icon.red { color: #ef4444; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); }

.dash-widget-badge {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.dash-widget-badge.zero {
  color: var(--text-muted);
}

.dash-widget-label {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

@media (max-width: 640px) {
  .dashboard-widgets {
    bottom: calc(1rem + var(--sab));
    left: calc(1rem + env(safe-area-inset-left, 0px));
    right: calc(1rem + env(safe-area-inset-right, 0px));
    z-index: 9999;
    flex-direction: row;
    align-items: stretch;
  }
  .dash-widget {
    flex: 1;
    justify-content: center;
    flex-direction: row;
    padding: 0.6rem 0.75rem;
  }
}

/* --- P2P ADS TABLE MOBILE --- */
@media (max-width: 640px) {
  .p2p-bank-ads table {
    font-size: 0.7rem;
  }

  .p2p-bank-ads th,
  .p2p-bank-ads td {
    padding: 0.35rem 0.4rem;
  }

  .p2p-bank-ads th:nth-child(n+4),
  .p2p-bank-ads td:nth-child(n+4) {
    display: none;
  }
}


/* ════════════════════════════════════════════════════════════
   DASHBOARD — BENTO GRID v3 (desktop-first)
   ════════════════════════════════════════════════════════════ */

.bento-main { padding: 1.5rem 0 4rem; }
@media (min-width: 641px) {
  .bento-main { padding-top: calc(110px + 1.5rem); }
}

/* ── Root grid ─────────────────────────────────────────────── */
.bento-root {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  align-items: stretch;
  width: 100%;
}

/* ── Base cell ─────────────────────────────────────────────── */
.bento-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  min-width: 0;
  transition: border-color .25s, box-shadow .25s;
}
.bento-cell:hover {
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}

/* ── Column assignments ────────────────────────────────────── */
.cell-header        { grid-column: span 12; margin-top: 1.5rem; }
.cell-volume        { display: none; }
.cell-kpi           { grid-column: span 3; }
.cell-finance       { grid-column: span 4; }
.cell-finance-half  { grid-column: span 6; }
.cell-finance-full  { grid-column: span 12; }
.cell-orders        { grid-column: span 7; }
.cell-ads           { grid-column: span 5; }
.cell-history       { grid-column: span 7; }
.cell-admin         { grid-column: span 5; }

/* ── Alert tints ───────────────────────────────────────────── */
.bento-cell.kpi-warn   { border-color: rgba(245,158,11,0.35); background: linear-gradient(180deg, rgba(245,158,11,0.08), rgba(245,158,11,0.02)); }
.bento-cell.kpi-ok     { border-color: rgba(34,197,94,0.35);  background: linear-gradient(180deg, rgba(34,197,94,0.08), rgba(34,197,94,0.02)); }
.bento-cell.kpi-danger { border-color: rgba(239,68,68,0.35);  background: linear-gradient(180deg, rgba(239,68,68,0.08), rgba(239,68,68,0.02)); }

/* ── Pulse dots ────────────────────────────────────────────── */
.bento-pulse {
  position: absolute; top: 12px; right: 12px;
  width: 8px; height: 8px; border-radius: 50%;
  animation: bentoPulse 1.4s ease-in-out infinite;
  z-index: 2;
}
.amber-pulse { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,.6); }
.green-pulse { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,.6); }
@keyframes bentoPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}

/* ── Alert dot in greeting ─────────────────────────────────── */
.bento-alert-dot {
  display: inline-block; width: 8px; height: 8px; margin-left: .45rem;
  border-radius: 50%; background: #f59e0b;
  animation: bentoPulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}

/* ── Section dividers (full-width) ─────────────────────────── */
.cell-section {
  background: transparent;
  border-color: transparent;
}
.cell-section:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.cell-section::before {
  content: "";
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 28px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), rgba(37,99,235,0.15));
}
.bento-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 0 .7rem .6rem; min-height: 56px;
}
.bento-section-left  { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.bento-section-right { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.bento-section-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  background: rgba(37,99,235,0.1); border: 1px solid rgba(37,99,235,0.22);
}
.bento-section-icon.amber { color: #f59e0b; background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.24); }
.bento-section-icon svg { width: 17px; height: 17px; }
.bento-section-title { font-size: .95rem; font-weight: 700; letter-spacing: .01em; margin: 0 0 .15rem; }
.bento-section-sub   { font-size: .7rem; color: var(--text-secondary); margin: 0; }

/* ── HEADER cell ───────────────────────────────────────────── */
.cell-header::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), rgba(37,99,235,0.1));
}
.bento-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.15rem 1.35rem;
}
.bento-greet-time { font-size: .68rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 .2rem; }
.bento-greet-name { font-size: 1.45rem; font-weight: 700; margin: 0; display: flex; align-items: center; }
.bento-greet-sub  { font-size: .72rem; color: var(--text-secondary); margin: .25rem 0 0; }
.bento-clock-box  { text-align: right; flex-shrink: 0; }
.bento-clock-label { display: block; font-size: .6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.bento-clock-val  { display: block; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.bento-clock-date { display: block; font-size: .66rem; color: var(--text-secondary); text-transform: capitalize; margin-top: .1rem; }

/* ── Cell head (shared) ────────────────────────────────────── */
.bento-cell-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .8rem 1rem .7rem; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.bento-cell-title {
  display: flex; align-items: center; gap: .45rem;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-secondary); white-space: nowrap;
}
.bento-cell-title svg { width: 13px; height: 13px; flex-shrink: 0; }
.bento-count-badge {
  font-size: .6rem; font-weight: 700; white-space: nowrap;
  padding: .12rem .5rem; border-radius: 999px;
}
.bento-count-badge.amber   { color: #f59e0b; background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.28); }
.bento-count-badge.red     { color: #ef4444; background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.28); }
.bento-count-badge.neutral { color: var(--text-secondary); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); }
.bento-link-action, .bento-attend-btn {
  font-size: .68rem; font-weight: 600; color: var(--accent);
  text-decoration: none; white-space: nowrap; transition: opacity .2s;
}
.bento-link-action:hover, .bento-attend-btn:hover { opacity: .65; }

/* ── KPI cells ─────────────────────────────────────────────── */
.bento-kpi-box {
  display: flex; align-items: center; gap: .85rem;
  padding: .95rem 1.1rem; flex: 1;
}
.bento-kpi-icon-lg {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.bento-kpi-icon-lg svg { width: 20px; height: 20px; }
.bento-kpi-icon-lg.amber  { color: #f59e0b; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.22); }
.bento-kpi-icon-lg.green  { color: #22c55e; background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.22); }
.bento-kpi-icon-lg.red    { color: #ef4444; background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.22); }
.bento-kpi-icon-lg.accent { color: var(--accent); background: rgba(37,99,235,.12); border: 1px solid rgba(37,99,235,.22); }
.bento-kpi-info { display: flex; flex-direction: column; min-width: 0; }
.bento-kpi-big  { font-size: 1.55rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bento-kpi-lbl  { font-size: .64rem; color: var(--text-secondary); margin-top: .15rem; line-height: 1.3; }

/* ── Tables / scroll areas ─────────────────────────────────── */
.bento-orders-scroll { overflow-y: auto; max-height: 264px; flex: 1; }
.bento-orders-scroll::-webkit-scrollbar { width: 4px; height: 4px; }
.bento-orders-scroll::-webkit-scrollbar-track { background: transparent; }
.bento-orders-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.bento-orders-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.bento-orders-table thead th {
  text-align: left; padding: .5rem .9rem; white-space: nowrap;
  font-size: .6rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(8,8,8,.85);
}
.bento-orders-table thead th:first-child,
.bento-orders-table tbody td:first-child { padding-left: 1rem; }
.bento-orders-table tbody tr { border-bottom: 1px solid rgba(255,255,255,.04); transition: background .15s; }
.bento-orders-table tbody tr:hover { background: rgba(255,255,255,.03); }
.bento-orders-table tbody tr:last-child { border-bottom: none; }
.bento-orders-table tbody tr:nth-child(even) { background: rgba(255,255,255,.012); }
.bento-orders-table tbody tr:nth-child(even):hover { background: rgba(255,255,255,.035); }
.bento-orders-table td { padding: .6rem .9rem; vertical-align: middle; }
.txt-right { text-align: right !important; }

.finance-total-row td {
  border-top: 1px solid rgba(255,255,255,.12);
  font-weight: 700; color: var(--text);
  background: rgba(37,99,235,.06);
}

/* ── Order rows ────────────────────────────────────────────── */
.bento-order-nick   { font-weight: 600; font-size: .78rem; white-space: nowrap; }
.bento-order-num    { font-size: .6rem; color: var(--text-muted); font-family: monospace; margin-top: .12rem; }
.bento-order-bank   { font-size: .7rem; color: var(--text-secondary); white-space: nowrap; }
.bento-order-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bento-order-fiat   { font-size: .65rem; color: var(--text-secondary); margin-top: .1rem; font-variant-numeric: tabular-nums; }
.muted-unit         { font-size: .62rem; color: var(--text-muted); }
.bento-status-pill {
  display: inline-block; font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: .15rem .5rem; border-radius: 5px; white-space: nowrap;
}
.bento-timer   { font-size: .66rem; font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }
.bento-attend-btn {
  display: inline-block; padding: .2rem .6rem; border-radius: 6px;
  border: 1px solid rgba(37,99,235,.3); background: rgba(37,99,235,.08);
}

/* ── Ads cell ──────────────────────────────────────────────── */
.bento-ads-scroll { overflow-y: auto; max-height: 264px; flex: 1; }
.bento-ads-scroll::-webkit-scrollbar { width: 3px; }
.bento-ads-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.bento-ad-item {
  padding: .65rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s;
}
.bento-ad-item:hover { background: rgba(255,255,255,.03); }
.bento-ad-item:last-child { border-bottom: none; }
.bento-ad-row1 { display: flex; align-items: center; gap: .45rem; }
.bento-ad-row2 { display: flex; align-items: center; gap: .35rem; margin-top: .35rem; flex-wrap: wrap; }
.bento-trade-pill {
  font-size: .6rem; font-weight: 700; text-transform: uppercase;
  padding: .12rem .4rem; border-radius: 5px; flex-shrink: 0;
}
.bento-trade-pill.sell { color: #22c55e; background: rgba(34,197,94,.12); }
.bento-trade-pill.buy  { color: #ef4444; background: rgba(239,68,68,.12); }
.bento-ad-pair  { font-size: .78rem; font-weight: 700; white-space: nowrap; }
.bento-ad-price { font-size: .7rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bento-ad-dot   { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; flex-shrink: 0; }
.bento-ad-pill  { font-size: .6rem; font-weight: 600; padding: .1rem .35rem; border-radius: 5px; white-space: nowrap; }
.bento-ad-pill.purple { color: #8b5cf6; background: rgba(139,92,246,.12); }
.bento-ad-pill.red    { color: #ef4444; background: rgba(239,68,68,.1); }
.bento-ad-pill.green  { color: #22c55e; background: rgba(34,197,94,.1); }
.bento-ad-pill.amber  { color: #f59e0b; background: rgba(245,158,11,.1); }
.bento-ad-last { font-size: .62rem; color: var(--text-muted); margin-left: auto; white-space: nowrap; }

/* ── History cell ──────────────────────────────────────────── */
.bento-history-scroll { overflow-y: auto; max-height: 244px; flex: 1; }
.bento-history-scroll::-webkit-scrollbar { width: 3px; }
.bento-history-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.bento-hist-row {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s;
}
.bento-hist-row:hover { background: rgba(255,255,255,.03); }
.bento-hist-row:last-child { border-bottom: none; }
.bento-hist-who { flex: 1; min-width: 0; }
.bento-hist-nick  { font-size: .78rem; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bento-hist-bank  { font-size: .62rem; color: var(--text-secondary); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bento-hist-amount { text-align: right; flex-shrink: 0; }
.bento-hist-val  { display: block; font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bento-hist-fiat { display: block; font-size: .62rem; color: var(--text-secondary); margin-top: .05rem; font-variant-numeric: tabular-nums; }
.bento-hist-time { font-size: .62rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ── Admin cell ────────────────────────────────────────────── */
.bento-admin-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: rgba(255,255,255,.06);
}
.bento-admin-stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .25rem; padding: 1.1rem .5rem;
  background: rgba(8,8,8,.6);
}
.bento-admin-num { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.bento-admin-num.green { color: #22c55e; }
.bento-admin-num.amber { color: #f59e0b; }
.bento-admin-num.blue  { color: #3b82f6; }
.bento-admin-lbl { font-size: .64rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .07em; }

/* ── Empty states ──────────────────────────────────────────── */
.bento-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; padding: 2rem 1rem; flex: 1;
  color: var(--text-secondary); font-size: .8rem; text-align: center;
}
.bento-empty-state svg { opacity: .25; }

/* ── Responsive (desktop → tablet) ─────────────────────────── */
@media (max-width: 1240px) {
  .cell-finance { grid-column: span 6; }
  .cell-finance-half { grid-column: span 12; }
}

@media (max-width: 1100px) {
  .cell-kpi       { grid-column: span 6; }
  .cell-finance   { grid-column: span 6; }
  .cell-orders    { grid-column: span 12; }
  .cell-ads       { grid-column: span 6; }
  .cell-history   { grid-column: span 12; }
  .cell-admin     { grid-column: span 6; }
}

@media (max-width: 768px) {
  .bento-root { gap: .6rem; }
  .cell-kpi       { grid-column: span 6; }
  .cell-orders    { grid-column: span 12; }
  .cell-ads       { grid-column: span 12; }
  .cell-history   { grid-column: span 12; }
  .cell-admin     { grid-column: span 12; }
  .cell-finance,
  .cell-finance-half,
  .cell-finance-full { grid-column: span 12; }
  .bento-orders-table thead { display: none; }
  .bento-orders-table tbody tr {
    display: grid; grid-template-columns: 1fr 1fr;
    padding: .55rem .8rem; gap: .3rem;
  }
  .bento-orders-table td { padding: .1rem 0; border: none; }
  .bento-kpi-big { font-size: 1.45rem; }
  .bento-section-head { flex-wrap: wrap; }
  .cell-section::before { height: 100%; width: 3px; top: 0; transform: none; }
}

@media (max-width: 480px) {
  .cell-kpi { grid-column: span 6; }
  .bento-greet-name { font-size: 1.15rem; }
  .bento-header-inner { flex-wrap: wrap; padding: .9rem 1rem; }
  .bento-kpi-box { padding: .75rem .85rem; gap: .7rem; }
  .bento-kpi-icon-lg { width: 38px; height: 38px; }
  .bento-kpi-big { font-size: 1.3rem; }
  .bento-count-badge { display: none; }
}
/* ══════════════════════════════════════════════════════════════
   INTELIGENCIAS — v1 · Control de bots de precio
   ══════════════════════════════════════════════════════════════ */
.intel-main {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: clamp(1rem, 3vw, 2.2rem);
  padding-right: clamp(1rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.intel-head {
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
}

.intel-kicker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.intel-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 38px;
  padding: 0 1.05rem;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.intel-refresh svg { width: 15px; height: 15px; }
.intel-refresh:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
}
.intel-refresh:active { transform: translateY(1px); }
.intel-refresh.loading { pointer-events: none; opacity: 0.75; }
.intel-refresh.loading svg { animation: intelSpin 0.8s linear infinite; }
@keyframes intelSpin { to { transform: rotate(360deg); } }

.intel-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  padding: 0 0.1rem;
}

.intel-sum-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.intel-sum-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
}
.intel-sum-num.green { color: var(--success); }
.intel-sum-num.amber { color: var(--warning); }
.intel-sum-num.bad { color: var(--danger); }

.intel-sum-lbl {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.intel-warning {
  background: rgba(245, 158, 11, 0.07);
  border: none;
  border-left: 3px solid var(--warning);
  color: var(--warning);
  border-radius: 0;
  padding: 0.8rem 1rem;
  font-size: 0.86rem;
}

.intel-list {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.intel-empty {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 2.5rem 1.2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.intel-empty a { color: var(--accent); }

.intel-row {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 1.15rem 1.4rem;
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) 2.2fr;
  gap: 1.1rem;
  align-items: center;
  transition: background var(--transition);
}
.intel-row:last-child { border-bottom: none; }
.intel-row:hover { background: rgba(255, 255, 255, 0.02); }

.intel-ad-main {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.intel-ad-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.intel-pill {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
}
.intel-pill.buy { background: rgba(34, 197, 94, 0.14); color: var(--success); }
.intel-pill.sell { background: rgba(59, 130, 246, 0.14); color: #60a5fa; }

.intel-pair {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.intel-adstate {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.intel-adstate::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.intel-adstate.active { color: var(--success); }
.intel-adstate.muted { color: var(--text-muted); }

.intel-bank {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.intel-bank svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.75;
}

.intel-adnum {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.intel-adprice {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.intel-bot {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.intel-bot-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.intel-range {
  display: flex;
  gap: 0.8rem;
  flex: 1;
  min-width: 200px;
}
.intel-range label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.intel-range label span {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.intel-range .form-input {
  width: 100%;
  min-width: 80px;
  height: 34px;
  padding: 0 0.55rem;
  font-size: 0.88rem;
  text-align: right;
}

.intel-bot-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.intel-bot-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.intel-err {
  font-size: 0.74rem;
  color: var(--danger);
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intel-ok {
  font-size: 0.72rem;
  color: var(--success);
}

.intel-hint {
  font-size: 0.72rem;
  color: var(--warning);
}

.intel-updated {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.intel-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.intel-switch input { opacity: 0; width: 0; height: 0; }
.intel-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  transition: background var(--transition);
}
.intel-switch .slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}
.intel-switch input:checked + .slider { background: var(--accent); }
.intel-switch input:checked + .slider::before { transform: translateX(18px); }

.intel-note {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 1.2rem 0.2rem 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.intel-note strong { color: var(--text); }

.intel-bot-actions .btn {
  background: transparent;
  border: none;
  box-shadow: none;
  height: auto;
  padding: 0.32rem 0.5rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}
.intel-bot-actions .intel-save { color: var(--text-muted); }
.intel-bot-actions .intel-save:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.intel-bot-actions .intel-adjust,
.intel-bot-actions .intel-create { color: var(--accent); font-weight: 500; }
.intel-bot-actions .intel-adjust:hover,
.intel-bot-actions .intel-create:hover { color: var(--accent-hover); background: rgba(59, 130, 246, 0.08); }
.intel-bot-actions .btn:disabled { opacity: 0.4; cursor: not-allowed; background: none; }

@media (max-width: 980px) {
  .intel-summary { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .intel-row { grid-template-columns: 1fr; gap: 0.9rem; }
  .intel-bot-status { margin-left: 0; }
}
@media (max-width: 520px) {
  .intel-summary { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .intel-range { flex-direction: column; }
}

/* --- INTELIGENCIAS MOBILE (teléfono / Capacitor) --- */
@media (max-width: 768px) {
  .intel-main { padding-left: 1rem; padding-right: 1rem; }
  .intel-head .page-actions { width: 100%; }
  .intel-refresh { width: 100%; justify-content: center; height: 44px; }
}

@media (max-width: 640px) {
  .intel-summary { grid-template-columns: 1fr 1fr; gap: 0.9rem; }
  .intel-sum-num { font-size: 1.5rem; }

  .intel-row { padding: 1rem 0.6rem; gap: 0.9rem; }
  .intel-adprice { font-size: 1.3rem; }

  .intel-bot-top { align-items: flex-start; gap: 1rem; }

  .intel-range { flex-direction: row; }
  .intel-range label {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }
  .intel-range label span { font-size: 0.66rem; }
  .intel-range .form-input {
    height: 44px;
    font-size: 1rem;
    padding: 0 0.7rem;
  }

  .intel-switch { width: 48px; height: 28px; }
  .intel-switch .slider::before { height: 22px; width: 22px; left: 3px; top: 3px; }
  .intel-switch input:checked + .slider::before { transform: translateX(20px); }

  .intel-bot-actions { gap: 0.5rem; }
  .intel-bot-actions .btn {
    flex: 1;
    justify-content: center;
    height: 44px;
    padding: 0 0.6rem;
    font-size: 0.92rem;
  }
  .intel-bot-status { width: 100%; margin-left: 0; margin-top: 0.2rem; }
  .intel-err { white-space: normal; max-width: none; }

  .intel-note { font-size: 0.78rem; padding: 1rem 0.2rem 0; }
}

/* --- INTELIGENCIAS DRAWER (historial del bot) --- */
.intel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.intel-overlay.visible { opacity: 1; visibility: visible; }

.intel-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  width: min(440px, 92vw);
  background: #0d0d0d;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  padding-top: var(--sat);
}
.intel-drawer.open { transform: translateX(0); }

.intel-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.4rem 1rem;
  border-bottom: 1px solid var(--border);
}
.intel-drawer-kicker {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.intel-drawer-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.intel-drawer-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.5;
}
.intel-drawer-sub strong { color: var(--text-secondary); }

.intel-drawer-close {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.intel-drawer-close:hover { color: var(--text); border-color: var(--border-strong); }

.intel-drawer-bar {
  padding: 0.8rem 1.4rem;
  border-bottom: 1px solid var(--border);
}
.intel-refresh-sm { height: 34px; padding: 0 0.9rem; font-size: 0.8rem; }

.intel-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.4rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.intel-drawer-loading,
.intel-drawer-empty {
  color: var(--text-muted);
  font-size: 0.86rem;
  text-align: center;
  padding: 2rem 0;
}
.intel-drawer-empty strong { color: var(--text); }

.intel-log {
  padding: 0.7rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
}
.intel-log:last-child { border-bottom: none; }

.intel-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.intel-log-badge {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.16rem 0.5rem;
  border-radius: 4px;
}
.intel-log-badge.ajuste { background: rgba(34, 197, 94, 0.14); color: var(--success); }
.intel-log-badge.omitido { background: rgba(148, 163, 184, 0.14); color: #94a3b8; }
.intel-log-badge.error { background: rgba(239, 68, 68, 0.14); color: var(--danger); }
.intel-log-badge.info { background: rgba(59, 130, 246, 0.14); color: #60a5fa; }

.intel-log-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.intel-log-detail {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.intel-log-prices {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
}
.intel-log-prices em {
  font-style: normal;
  color: var(--text-muted);
}

/* --- INTELIGENCIAS EDITAR ANUNCIO (drawer del bot) --- */
.intel-edit-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.intel-edit-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.4rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.intel-edit-validation {
  display: none;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  white-space: pre-line;
}
.intel-edit-validation.show { display: block; }

.intel-edit-fieldset {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.intel-edit-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.intel-edit-field label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.intel-edit-field textarea.form-input {
  resize: vertical;
  min-height: 66px;
}

.intel-edit-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  padding: 1rem 1.4rem calc(1.4rem + var(--sab));
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  background: #0d0d0d;
  flex-shrink: 0;
}
.intel-edit-actions .btn {
  height: 42px;
  padding: 0 1.1rem;
  font-size: 0.85rem;
}

/* --- INTELIGENCIAS EVALUACIÓN EN VIVO (posible precio en la tarjeta) --- */
.intel-eval {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  margin-top: 0.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.015);
}

.intel-eval-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.intel-eval-pos {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
  letter-spacing: 0.04em;
}

.intel-eval-chip {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  white-space: nowrap;
}
.intel-eval-chip.top3 { background: rgba(34, 197, 94, 0.13); color: var(--success); }
.intel-eval-chip.ajuste { background: rgba(59, 130, 246, 0.13); color: #60a5fa; }
.intel-eval-chip.off { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }
.intel-eval-chip.filtro { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

.intel-eval-src {
  margin-left: auto;
  font-size: 0.64rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.intel-eval-top3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding-top: 0.15rem;
}

.intel-eval-top3-lbl {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.intel-eval-top3-list {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.intel-eval-top3-list b { color: var(--accent); font-weight: 700; }
.intel-eval-top3-list em {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.intel-eval-bar-track {
  position: relative;
  height: 4px;
  background: linear-gradient(to right, rgba(34, 197, 94, 0.25), rgba(148, 163, 184, 0.25), rgba(239, 68, 68, 0.25));
  border-radius: 2px;
}

.intel-eval-marker {
  position: absolute;
  top: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translateX(-50%);
  border: 2px solid #0d0d0d;
  box-sizing: border-box;
}
.intel-eval-marker.cur { background: #cbd5e1; }
.intel-eval-marker.obj { background: #60a5fa; }
.intel-eval-marker.obj.same { background: var(--success); }

.intel-eval-bar-lbl {
  display: flex;
  justify-content: space-between;
  font-size: 0.64rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.intel-eval-bar-lbl span:last-child { color: var(--danger); }
.intel-eval-bar-lbl span:first-child { color: var(--success); }
.intel-eval-bar-lbl span:nth-child(2) {
  color: var(--text-secondary);
  font-weight: 600;
}

@media (max-width: 640px) {
  .intel-eval { padding: 0.55rem 0.4rem; }
  .intel-eval-src { display: none; }
  .intel-eval-chip { white-space: normal; }
}

@media (max-width: 640px) {
  .intel-edit-grid2 { grid-template-columns: 1fr; }
  .intel-edit-form { padding: 0; }
  .intel-edit-scroll { padding: 1rem 1rem 0; }
  .intel-edit-field input.form-input { height: 44px; font-size: 1rem; }
  .intel-edit-actions { padding: 1rem 1rem calc(1rem + var(--sab)); }
  .intel-edit-actions .btn { flex: 1; justify-content: center; }
}

@media (max-width: 640px) {
  .intel-drawer { width: 100%; }
}

/* --- INTELIGENCIAS CONFIG AVANZADA DEL BOT (drawer + resumen) --- */
.intel-cfgline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-secondary);
}
.intel-cfgline em {
  font-style: normal;
  color: var(--text-muted);
}

.intel-cfg-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 0.3rem;
}

.intel-cfg-monto-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}
.intel-cfg-monto-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.intel-cfg-monto-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.intel-cfg-monto-row input {
  min-width: 0;
  width: 100%;
}
.intel-cfg-monto-slot input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
  font-style: italic;
}

.intel-cfg-switchline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.intel-cfg-switchline > label:first-child {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0;
}

#intelCfgSalto:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.intel-edit-field select.form-input {
  height: 42px;
  color-scheme: dark;
}

/* ── Indicador de conexión en vivo (socket) ── */
.intel-ws-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 4px;
  align-self: center;
  flex-shrink: 0;
  transition: background .2s, box-shadow .2s;
}
.intel-ws-dot.on {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, .8);
  animation: intelWsPulse 2s ease-in-out infinite;
}
.intel-ws-dot.off {
  background: #64748b;
  box-shadow: 0 0 6px rgba(100, 116, 139, .5);
}
@keyframes intelWsPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.intel-suggestion { margin-top: 8px; padding: 8px 12px; background: rgba(245, 158, 11, 0.1); border-left: 3px solid #f59e0b; color: #fcd34d; font-size: 0.85rem; border-radius: 0 4px 4px 0; line-height: 1.4; }

/* ── Selector Multiselect de Operadores (Global) ── */
.ops-user-select {
  color-scheme: dark;
  background-color: #121218 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f3f4f6 !important;
  border-radius: 6px !important;
  height: 34px !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  padding: 0 28px 0 10px !important;
  outline: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 9px center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
}
.ops-user-select:hover {
  border-color: rgba(255, 255, 255, 0.3) !important;
  background-color: #181824 !important;
}
.ops-user-select:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25) !important;
}
