/* ROSS brand system — see Brand Book & Design System ed. 2026 v1.0.
   Navy = base institucional, Azul acción = acento único, Celeste = highlight
   puntual; verde/amarillo/rojo/aqua son funcionales, nunca decorativos. */
:root {
  --bg: #f7f9fc;
  --panel: #ffffff;
  --border: #dbe3ee;
  --text: #1A2B4A;
  --muted: #5c6987;
  --primary: #2263A2;
  --primary-dark: #1b4c7c;
  --danger: #FA0715;
  --positive: #0EB596;
  /* --positive and --danger are fills (dots, bars). Text on the light panels needs darker
     versions to reach 4.5:1 (#0EB596 on white is 2.6:1, #FA0715 is 3.9:1). */
  --positive-text: #0B7A64;
  --danger-text: #C4101A;
  --warning: #E0A400;
  --highlight: #eaf1f8;
  --celeste: #7DB8D9;
  --navy: #1A2B4A;
  --tinta: #0C1730;
  --chart-spend: #1A2B4A;
  --radius: 10px;
}

/* Dark mode — Tinta profunda como base, no un gris genérico invertido. */
:root[data-theme="dark"] {
  --bg: #0C1730;
  --panel: #11203f;
  --border: #223354;
  --text: #EEF2F8;
  --muted: #8593b3;
  --primary: #2263A2;
  --primary-dark: #2d7bc4;
  --highlight: rgba(125, 184, 217, 0.14);
  --chart-spend: #7DB8D9;
  --positive-text: #2FD3AD;
  --danger-text: #FF8A84;
}
/* The active item's blue sat at 2:1 on the dark highlight. */
:root[data-theme="dark"] .nav-item.active,
:root[data-theme="dark"] .store-list li.active { color: var(--celeste); }
:root[data-theme="dark"] .connector-dot.none { background: #445070; }
:root[data-theme="dark"] .auth-tab.active { box-shadow: 0 1px 2px rgba(0,0,0,0.3); }

/* Textura de fondo (flujo/nodos) — fija detrás de todo, solo visible en
   dark mode, para que los espacios vacíos entre paneles no queden en
   negro liso. */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.app-bg svg { width: 100%; height: 100%; }
:root[data-theme="dark"] .app-bg { opacity: 1; }

.theme-toggle { display: flex; align-items: center; justify-content: center; padding: 8px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.push-toggle { display: flex; align-items: center; justify-content: center; padding: 8px; flex: none; }
.push-toggle .icon-bell-active { display: none; color: var(--primary); }
.push-toggle.subscribed .icon-bell { display: none; }
.push-toggle.subscribed .icon-bell-active { display: block; }

* { box-sizing: border-box; }

/* Several elements below set their own `display` (flex/grid) for when they're
   shown — that rule's specificity beats the UA default `[hidden]{display:none}`,
   so a hidden .modal/.dashboard-view/.auth-view would still render (and eat
   clicks) unless this wins explicitly. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "DM Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

/* Inter for titulares, display y datos; DM Sans (body, arriba) para todo lo demás. */
.brand, h2, .stat-value, .stat-label, .store-name {
  font-family: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.topbar-left { display: flex; align-items: center; gap: 6px; }

.brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

/* Hamburger: only meaningful once .sidebar becomes an off-canvas drawer
   below, so it stays hidden above that breakpoint. `.btn.` because `.btn` (declared
   later, same specificity) would otherwise win and show it on desktop too. */
.btn.sidebar-toggle { display: none; padding: 8px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-account {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--primary);
  /* Concentric-ring texture (the login hero's orbit motif, scaled down)
     instead of a flat fill — gives buttons some depth. */
  background-image: repeating-radial-gradient(circle at 88% -40%, rgba(255,255,255,0.22) 0, rgba(255,255,255,0.22) 1px, transparent 1px, transparent 9px);
  color: white;
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 16px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--celeste);
}
.btn-primary:hover { background-color: var(--primary-dark); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg); }

.btn-block { width: 100%; margin-top: 8px; }

/* Auth */
.auth-view {
  display: flex;
  /* 66 px = the topbar's height (38 px buttons + 2 x 14 px padding); 57 px was an older topbar
     and left the login page scrolling by 9 px. */
  min-height: calc(100vh - 66px);
}

.auth-hero {
  flex: 1 1 55%;
  min-width: 360px;
  position: relative;
  background: var(--tinta);
  color: var(--bg);
  overflow: hidden;
  display: flex;
  align-items: center;
}
.auth-hero-flow { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.9; }
.auth-hero-content { position: relative; padding: 48px; max-width: 460px; }
.auth-hero-brand { font-family: "Inter", sans-serif; font-weight: 800; font-size: 16px; letter-spacing: -0.01em; color: #ffffff; margin-bottom: 36px; }
.auth-hero-title { font-family: "Inter", sans-serif; font-weight: 700; font-size: 30px; line-height: 1.25; margin: 0 0 14px; color: #ffffff; }
.auth-hero-sub { font-size: 14px; line-height: 1.6; color: #aebbd6; margin: 0 0 32px; }

.auth-hero-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid #223354;
  border-radius: var(--radius);
  padding: 16px 18px;
  width: 220px;
  margin-bottom: 26px;
}
.auth-hero-preview-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--celeste); }
.auth-hero-preview-value { font-family: "Inter", sans-serif; font-size: 32px; font-weight: 700; color: #ffffff; }
.auth-hero-preview-sub { font-size: 11px; color: #8593b3; }

.auth-hero-trust { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #8593b3; }

.auth-formside {
  flex: 1 1 45%;
  min-width: 340px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  /* A fading wash from the hero's dark tone softens the hard seam between
     the two panels instead of an abrupt color jump. */
  background: linear-gradient(to right, rgba(12, 23, 48, 0.4), rgba(12, 23, 48, 0) 160px), var(--bg);
}
.auth-formside-flow { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.7; transition: opacity 0.25s ease; }
/* The right panel goes solid dark in dark mode (no seam to soften there),
   so this light-mode-only texture would just read as stray streaks. */
:root[data-theme="dark"] .auth-formside-flow { opacity: 0; }

.auth-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 340px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 12px 32px rgba(12, 23, 48, 0.08);
}

.auth-formside-footer {
  position: relative;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

@media (max-width: 860px) {
  .auth-view { flex-direction: column; }
  .auth-hero { flex: none; min-width: 0; }
  .auth-formside { flex: none; padding: 32px 0; }
}

.auth-card-heading { margin-bottom: 20px; }
.auth-card-heading h2 { font-family: "Inter", sans-serif; font-size: 19px; margin: 0 0 4px; }
.auth-card-heading p { margin: 0; font-size: 13px; color: var(--muted); }

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  color: var(--muted);
}
.auth-tab.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.input-wrap { position: relative; display: block; }
.input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.auth-form input, .auth-form select {
  font-size: 14px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
}
.auth-form .input-wrap input { width: 100%; padding-left: 34px; }
.auth-form input::placeholder { color: var(--muted); opacity: 1; }
.auth-form button { margin-top: 4px; }

.error-text { color: var(--danger-text); font-size: 13px; margin-top: 14px; }

.pw-meter { margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.pw-meter-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.pw-meter-bar span { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--danger); transition: width 0.15s ease, background 0.15s ease; }
.pw-meter-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pw-meter[data-level="2"] .pw-meter-bar span { background: var(--warning); }
.pw-meter[data-level="3"] .pw-meter-bar span { background: var(--positive); }
.pw-meter[data-level="2"] .pw-meter-label, .pw-meter[data-level="3"] .pw-meter-label { color: var(--text); }
.success-text { color: var(--positive-text); font-size: 13px; margin-top: 14px; }

.auth-forgot-link { text-align: right; margin-top: -6px; }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* Dashboard layout */
.dashboard-view {
  display: flex;
  min-height: calc(100vh - 57px);
}

.sidebar {
  width: 220px;
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  background: var(--panel);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: none; border-radius: 7px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--highlight); color: var(--primary); }
.nav-item svg { flex: none; }

.sidebar-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 10px; }

.store-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.store-list li {
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
}
.store-list li:hover { background: var(--bg); }
.store-list li.active { background: var(--highlight); color: var(--primary-dark); font-weight: 600; }

.content { flex: 1; padding: 24px 32px; min-width: 0; }

.sidebar-backdrop { display: none; }

@media (max-width: 860px) {
  .btn.sidebar-toggle { display: flex; }

  .dashboard-view { position: relative; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: 260px;
    max-width: calc(100vw - 48px);
    transform: translateX(-100%);
    /* Closed = invisible too, so Tab cannot land on links nobody can see; visibility only
       flips after the slide-out finishes, and immediately when opening. */
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
    overflow-y: auto;
    box-shadow: 0 0 24px rgba(12, 23, 48, 0.18);
  }
  .dashboard-view.sidebar-open .sidebar { transform: translateX(0); visibility: visible; transition-delay: 0s; }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(12, 23, 48, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .dashboard-view.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

  /* Off-canvas nav rows get more room to be comfortably tappable. */
  .nav-item, .store-list li { min-height: 44px; }
  .nav-item { font-size: 14.5px; }

  .content { padding: 18px 16px; }

  /* Bigger hit areas for the small icon-only controls once we're on touch. */
  .widget-ctrl { width: 30px; height: 30px; }
  .theme-toggle { padding: 10px; }

  /* iOS Safari auto-zooms on focusing any input under 16px — keep every
     form field at/above that threshold on small screens without changing
     the denser desktop look. */
  .auth-form input, .auth-form select,
  .modal-card input, .modal-card select,
  .store-panel-actions select {
    font-size: 16px;
  }

  /* Topbar: account name + "Cerrar sesión" don't fit next to the brand and
     theme toggle on a phone-width row — wrap to a second row instead of
     squeezing everything until the text itself wraps mid-word. */
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar-right { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; }
  .topbar-account { flex-wrap: nowrap; }
  #account-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
}

.empty-state { text-align: center; padding: 80px 20px; color: var(--muted); }

.store-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.store-panel-header h2 { margin: 0 0 2px; }
.muted { color: var(--muted); font-size: 13px; }

.store-panel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sync-status { font-size: 13px; color: var(--muted); padding: 0 4px; }
.sync-status-error { color: #b42318; font-weight: 600; }
:root[data-theme="dark"] .sync-status-error { color: #ff9b94; }
.more-menu-wrap { position: relative; }
.metric-help-btn {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel);
  color: var(--primary); font: 700 12px "Inter", sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
/* 24px drawn, 44px to tap. */
.metric-help-btn::before { content: ""; position: absolute; inset: -10px; }
.metric-help-btn[aria-expanded="true"] { background: var(--primary); color: #ffffff; border-color: var(--primary); }
.metric-help-panel { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg); font-size: 13px; line-height: 1.5; color: var(--text); }
.metric-help-panel p { margin: 0; }
.metric-help-formula { margin-top: 6px !important; font-weight: 700; color: var(--primary); }
.more-btn { display: inline-flex; align-items: center; gap: 6px; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(12, 23, 48, 0.16);
}
.more-menu[hidden] { display: none; }
@media (max-width: 600px) { .more-menu { right: auto; left: 0; } }
.more-menu button {
  min-height: 40px; padding: 0 12px; text-align: left; border: none; border-radius: 7px;
  background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
}
.more-menu button:hover, .more-menu button:focus-visible { background: var(--bg); outline: none; }
.more-menu button:disabled { color: var(--muted); cursor: default; }
.store-panel-actions select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}

.bento-grid {
  display: grid;
  /* minmax(0, …): a plain 1fr won't shrink below its content, so a long amount widened the page. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}
.stat-hero {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
  background: var(--highlight);
  border-color: var(--celeste);
  padding: 22px;
}
.stat-hero-value { font-family: "Inter", sans-serif; font-size: 44px; }

.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat-value { font-family: "Inter", sans-serif; font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 420px) { .stat-value { font-size: 19px; } }
.stat-value.negative { color: var(--danger-text); }
.stat-value.positive { color: var(--positive-text); }

.stat-delta { font-size: 11.5px; font-weight: 600; min-height: 14px; }
.stat-delta.positive { color: var(--positive-text); }
.stat-delta.negative { color: var(--danger-text); }
.stat-delta.neutral { color: var(--muted); }

@media (max-width: 900px) {
  .bento-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-hero { grid-column: 1 / 3; grid-row: auto; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.panel h3 { margin: 0 0 14px; font-size: 14px; }

/* Dashboard widget customize mode */
.widget-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.widget-card-header .stat-label { min-width: 0; }
.panel .widget-card-header { margin-bottom: 14px; }
.panel .widget-card-header h3 { margin: 0; }

.stat-header-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.quick-alert-btn {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: none; background: transparent;
  border-radius: 4px; color: var(--muted); cursor: pointer; padding: 0;
}
.quick-alert-btn:hover { background: var(--panel); color: var(--primary); }
.quick-alert-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.quick-alert-row input {
  width: 50px; padding: 5px 7px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; text-align: center;
  background: var(--panel); color: var(--text);
}
.quick-alert-row .btn { padding: 5px 10px; font-size: 11.5px; }
.quick-alert-status { font-size: 11px; color: var(--positive-text); }

.widget-controls {
  display: flex;
  flex: none;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
}
.widget-ctrl {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.widget-ctrl:hover { background: var(--panel); color: var(--text); }
.widget-ctrl.active { color: var(--primary); }
.widget-ctrl-remove:hover { color: var(--danger); }

.widget-add-list { display: flex; flex-direction: column; gap: 4px; }
.widget-add-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}
.widget-add-row:first-child { border-top: none; }

.chart-container { position: relative; }
.chart-container svg { display: block; width: 100%; height: auto; }
.chart-empty { color: var(--muted); font-size: 13px; }
.chart-bar { cursor: pointer; }

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
}
.chart-tooltip strong { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; font-weight: 600; }
.chart-tooltip-row { display: flex; align-items: center; gap: 6px; }
.chart-tooltip-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }

.connector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.connector-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
}
.connector-card .connector-name { font-weight: 600; text-transform: capitalize; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.connector-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Mi plan (Perfil) */
.plan-current { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 13.5px; }
.plan-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.plan-option {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px;
}
.plan-option.current { border-color: var(--primary); background: var(--highlight); }
.plan-option-name { font-weight: 600; }
.plan-option-price { color: var(--muted); }
.plan-option .btn { margin-top: auto; }
.plan-options > .link-danger { grid-column: 1 / -1; justify-self: start; }
#plan-invoices h4 { margin: 16px 0 4px; font-size: 13px; }
#plan-invoices .invoice-row { justify-content: space-between; font-size: 13px; }

/* Members / invites */
.members-panel .panel:last-child { margin-bottom: 0; }
.member-row, .invite-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--border);
}
.member-row:first-child, .invite-row:first-child { border-top: none; padding-top: 0; }
.member-email { font-size: 13.5px; font-weight: 600; }
.member-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.you-tag { font-weight: 400; color: var(--muted); }

.notification-matrix { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.notification-matrix th { text-align: center; font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 8px 10px; }
.notification-matrix th:first-child { text-align: left; }
.notification-matrix td { padding: 10px 8px; border-top: 1px solid var(--border); }
.notification-matrix tr:first-child td { border-top: none; }
.notification-matrix input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.team-summary-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.team-avatars { display: flex; }
.team-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--highlight); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-family: "Inter", sans-serif; font-weight: 700; font-size: 12px;
  border: 2px solid var(--panel); margin-left: -8px; flex: none;
}
.team-avatar:first-child { margin-left: 0; }
.team-avatar-extra { background: var(--bg); color: var(--muted); }
.team-summary-text { font-size: 13.5px; font-weight: 600; }

.role-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.02em; flex: none;
}
.role-badge.owner { background: var(--highlight); color: var(--primary); }
.role-badge.admin { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.role-badge.viewer { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

.member-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.member-actions select {
  font-size: 12.5px; padding: 5px 7px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--panel); color: var(--text);
}
.link-danger {
  font-size: 12.5px; font-weight: 600; color: var(--danger-text);
  background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
}
.link-danger:hover { text-decoration: underline; }
.connector-dot.ok { background: var(--positive); }
.connector-dot.error { background: var(--danger); }
.connector-dot.none { background: #c7cbd1; }
.connector-connect-btn { margin-top: 8px; width: 100%; padding: 5px 10px; font-size: 12.5px; }
.connector-backfill { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.connector-backfill select {
  width: 100%; padding: 4px 6px; font-size: 12.5px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text);
}
.connector-backfill .connector-connect-btn { margin-top: 0; }
.connector-backfill-msg { font-size: 12px; color: var(--positive-text); }
.connector-backfill-msg.error { color: var(--danger-text); }

/* Creative performance */
.creative-table-wrap { overflow-x: auto; }
.creative-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.creative-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--border);
}
.creative-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); }
.creative-table tr:last-child td { border-bottom: none; }
.creative-table th:not(:first-child), .creative-table td:not(:first-child) { text-align: right; }
.creative-table th:nth-child(2), .creative-table td:nth-child(2) { text-align: left; }
.creative-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.creative-best { color: var(--positive-text); font-weight: 700; }

.platform-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.platform-badge.platform-meta { background: var(--highlight); color: var(--primary); }
.platform-badge.platform-google { background: var(--bg); color: var(--text); border: 1px solid var(--border); }

/* LTV by cohort + CAC payback */
.widget-info { color: var(--muted); font-size: 12px; margin: -4px 0 12px; }
.ltv-cohorts-table-wrap { overflow-x: auto; }
.ltv-cohorts-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.ltv-cohorts-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--border);
}
.ltv-cohorts-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); }
.ltv-cohorts-table tr:last-child td { border-bottom: none; }
.ltv-cohorts-table th:not(:first-child), .ltv-cohorts-table td:not(:first-child) { text-align: right; }
.ltv-payback-cell { color: var(--positive-text); font-weight: 700; }
.ltv-payback-pending { color: var(--muted); font-size: 12px; }

.cac-by-channel-table-wrap { overflow-x: auto; }
.cac-by-channel-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.cac-by-channel-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--border);
}
.cac-by-channel-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); }
.cac-by-channel-table tr:last-child td { border-bottom: none; }
.cac-by-channel-table th:not(:first-child), .cac-by-channel-table td:not(:first-child) { text-align: right; }
.cac-by-channel-table th:nth-child(2), .cac-by-channel-table td:nth-child(2) { text-align: left; }

.attribution-by-channel-table-wrap { overflow-x: auto; }
.attribution-by-channel-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.attribution-by-channel-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--border);
}
.attribution-by-channel-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); }
.attribution-by-channel-table tr:last-child td { border-bottom: none; }
.attribution-by-channel-table th:not(:first-child), .attribution-by-channel-table td:not(:first-child) { text-align: right; }

.pnl-table-wrap { max-width: 360px; }
.pnl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pnl-table td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.pnl-table td:last-child { text-align: right; font-weight: 600; }
.pnl-table td.negative { color: var(--danger-text); }
.pnl-table td.positive { color: var(--positive-text); }
.pnl-table tr.pnl-total td { border-top: 2px solid var(--border); border-bottom: none; padding-top: 12px; font-weight: 700; font-size: 15px; }

.audit-log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit-log-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--border);
}
.audit-log-table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--border); }
.audit-log-table tr:last-child td { border-bottom: none; }

.forecast-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.forecast-stat {
  background: var(--highlight);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
@media (max-width: 480px) { .forecast-grid { grid-template-columns: 1fr; } }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px;
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.modal-card-wide { width: 440px; max-width: calc(100vw - 32px); }
.modal-card-wide .member-row { justify-content: space-between; }
.modal-card-wide .member-row > div:first-child { flex: 1; min-width: 0; }
.modal-card-wide .role-select { flex: none; }
.modal-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.modal-card label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.modal-card input, .modal-card select {
  font-size: 14px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.modal-card label.checkbox-label { flex-direction: row; align-items: center; gap: 8px; }
.modal-card label.checkbox-label input { width: auto; padding: 0; }
.report-preview {
  white-space: pre-wrap;
  font-size: 12px;
  font-family: inherit;
  background: var(--highlight);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--text);
  max-height: 220px;
  overflow-y: auto;
}

.demo-banner {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: center;
  padding: 10px 16px; background: var(--highlight); color: var(--text); font-size: 13.5px; text-align: center;
  border-bottom: 1px solid var(--border);
}
.demo-banner[hidden] { display: none; }
.demo-banner a { color: var(--primary); font-weight: 700; }
:root[data-theme="dark"] .demo-banner a { color: var(--celeste); }

/* Landing de presentación (frontend/landing.html) */
.l-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.l-nav-links { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.l-nav-links a { color: var(--muted); }
.l-nav-cta { padding: 9px 16px; }
.l-nav-links a.btn-primary { color: #ffffff; }
.l-placeholder { display: inline-block; padding: 2px 14px; border: 2px dashed var(--celeste); border-radius: 10px; color: var(--celeste); }

.l-hero {
  position: relative; overflow: hidden; background: var(--tinta); color: #ffffff;
  padding: 90px 40px 110px; text-align: center;
}
.l-hero-content { position: relative; max-width: 640px; margin: 0 auto; }
.l-hero-title { font-family: "Inter", sans-serif; font-weight: 700; font-size: 44px; line-height: 1.2; margin: 0 0 18px; }
.l-hero-sub { font-size: 16px; line-height: 1.6; color: #aebbd6; margin: 0 0 34px; }
.l-hero-actions { display: flex; gap: 12px; justify-content: center; }
.l-hero-note { margin: 18px auto 0; max-width: 460px; font-size: 14px; color: #dbe3ee; }
/* Ross, the app's own mascot, greets on the landing too (frontend/agentes). */
.l-hero-ross { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-top: 36px; }
.l-hero-ross-scene { flex: none; width: 110px; }
.l-hero-ross-box { margin: 0 0 18px; max-width: 230px; }
.l-agents-pause {
  position: absolute; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid #2b3f63; background: transparent; color: #dbe3ee; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.l-agents-pause:hover, .l-agents-pause:focus-visible { background: rgba(255, 255, 255, 0.08); outline: 2px solid var(--celeste); outline-offset: 2px; }
.l-agents-pause[aria-pressed="true"] { color: var(--celeste); }
.l-shot-heading { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 36px; }
.l-shot-heading .pxa-scene { flex: none; width: min(140px, 30vw); }
.l-shot-heading .l-section-title { margin: 0; }
.btn-ghost-inverse {
  border: 1px solid #2b3f63; color: #ffffff; background: transparent;
  padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.btn-ghost-inverse:hover { background: rgba(255,255,255,0.06); }

.l-section { padding: 64px 40px; max-width: 1040px; margin: 0 auto; }
.l-section-tint { background: var(--panel); max-width: none; }
.l-section-tint > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
.l-section-title { font-family: "Inter", sans-serif; font-size: 28px; font-weight: 700; text-align: center; margin: 0 0 36px; }

.l-eyebrow { display: block; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.l-step-num {
  flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--highlight); color: var(--primary);
  font-family: "Inter", sans-serif; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center;
}

.l-problem { max-width: 640px; margin: 0 auto; text-align: center; }
.l-problem p { font-size: 16px; line-height: 1.65; color: var(--muted); margin: 0 0 12px; }
.l-problem p:last-child { color: var(--text); font-weight: 700; }

.l-steps { list-style: none; padding: 0; margin: 0 auto 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.l-steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 18px; }
.l-steps h3 { font-family: "Inter", sans-serif; font-size: 15.5px; margin: 4px 0 6px; }
.l-steps p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }

.l-shot { margin: 0; }
.l-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px rgba(26, 43, 74, 0.12); }
.l-shot figcaption { text-align: center; font-size: 13px; color: var(--muted); margin-top: 12px; }

.l-benefits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.l-benefit { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 18px; background: var(--bg); }
.l-benefit h3 { font-family: "Inter", sans-serif; font-size: 15.5px; margin: 0; }
.l-benefit p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.l-benefit-where { margin-top: auto; font-size: 12.5px; font-weight: 700; color: var(--primary); }
@media (max-width: 1000px) { .l-benefits { grid-template-columns: repeat(2, 1fr); } }

.l-industries { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.l-industries span {
  border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 13px; color: var(--muted); background: var(--panel);
}

.l-cta { text-align: center; padding: 80px 40px; background: var(--tinta); color: #ffffff; }
.l-cta-tagline { font-family: "Inter", sans-serif; font-weight: 700; font-size: 30px; margin: 0 0 10px; }
.l-cta-sub { font-size: 14.5px; color: #aebbd6; margin: 0 0 30px; }
.l-cta-btn { padding: 12px 26px; font-size: 15px; }
.l-demo-form { max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.l-demo-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 700; color: #dbe3ee; }
.l-demo-form input, .l-demo-form select {
  min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid #2b3f63; background: #ffffff; color: #1A2B4A; font-size: 15px; font-family: inherit;
}
.l-demo-form input:focus-visible, .l-demo-form select:focus-visible { outline: 3px solid var(--celeste); outline-offset: 2px; }
.l-demo-form .l-cta-btn { min-height: 48px; margin-top: 6px; }
.l-demo-error { margin: 0; font-size: 14px; color: #ffd2cf; }
.l-demo-done h3 { font-family: "Inter", sans-serif; font-size: 22px; margin: 0 0 8px; }
.l-demo-done p { margin: 0; color: #aebbd6; font-size: 15px; }

.l-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 40px; font-size: 12.5px; color: var(--muted); background: var(--panel);
}

@media (max-width: 760px) {
  .l-steps, .l-benefits { grid-template-columns: 1fr; }
  .l-section { padding: 48px 16px; }
  .l-section-title { font-size: 23px; }
  .l-hero { padding: 64px 16px 80px; }
  .l-hero-actions { flex-wrap: wrap; }
  .l-cta { padding: 64px 16px; }
  .l-hero-title { font-size: 30px; }
  .l-nav { padding: 14px 16px; }
  .l-nav-links { gap: 10px; font-size: 12.5px; }
  .l-nav-cta { padding: 7px 10px; white-space: nowrap; }
}

/* Pricing page (frontend/pricing.html) */
.pricing-hero { text-align: center; padding: 56px 24px 8px; }
.pricing-hero h1 { font-family: "Inter", sans-serif; font-weight: 800; font-size: 36px; margin: 0 0 12px; }
.pricing-hero p { color: var(--muted); font-size: 15px; max-width: 560px; margin: 0 auto; }

.pricing-slider-section { max-width: 900px; margin: 40px auto 0; padding: 0 24px; }
.pricing-slider-track { position: relative; display: flex; justify-content: space-between; padding: 0 20px; }
.pricing-slider-line { position: absolute; top: 9px; left: 20px; right: 20px; height: 2px; background: var(--border); }
.pricing-slider-fill { position: absolute; top: 9px; left: 20px; height: 2px; background: var(--primary); transition: width 0.2s ease; }
.pricing-slider-stop {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer; font-family: "DM Sans", sans-serif; flex: 1; padding: 4px;
}
.pricing-slider-dot { width: 18px; height: 18px; border-radius: 50%; box-sizing: border-box; border: 3px solid var(--border); background: var(--panel); transition: all 0.15s ease; }
.pricing-slider-dot.active { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 5px var(--highlight); }
.pricing-slider-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pricing-slider-label.active { color: var(--text); font-weight: 700; }

.pricing-explain { text-align: center; font-size: 14px; background: var(--highlight); border-radius: 10px; padding: 12px 20px; max-width: 640px; margin: 24px auto 0; }
.pricing-explain b { color: var(--primary); }

.pricing-plans { display: flex; gap: 24px; max-width: 1040px; margin: 36px auto 0; padding: 0 24px 8px; align-items: stretch; }
.pricing-card {
  flex: 1; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 26px 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: opacity 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.pricing-card.recommended { border-color: var(--primary); box-shadow: 0 8px 24px rgba(34, 99, 162, 0.14); }
/* Not opacity: it faded the text under the contrast minimum. The recommended card stands out by its border and shadow. */
.pricing-card.dimmed { background: var(--bg); box-shadow: none; }
.pricing-card-name { font-family: "Inter", sans-serif; font-weight: 800; font-size: 18px; }
.pricing-price-placeholder { display: inline-block; padding: 1px 10px; border: 1.5px dashed var(--celeste); border-radius: 6px; color: var(--primary); font-weight: 700; font-size: 26px; }
.pricing-price { display: inline-block; color: var(--text); font-family: "Inter", sans-serif; font-weight: 800; font-size: 26px; }
.pricing-feature { font-size: 12.5px; display: flex; gap: 6px; }
.pricing-recommended-tag { font-size: 11px; font-weight: 700; color: #0B7A64; text-transform: uppercase; letter-spacing: 0.03em; }
.pricing-capacity-label { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.pricing-capacity-track { height: 6px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.pricing-capacity-fill { height: 6px; border-radius: 4px; background: var(--positive); }
.pricing-reassurance { text-align: center; font-size: 12px; color: var(--muted); padding: 20px 24px 56px; }

@media (max-width: 760px) {
  .pricing-plans { flex-direction: column; }
  .pricing-slider-label { font-size: 10px; }
  .pricing-hero h1 { font-size: 26px; }
}
