/* ===========================================================================
   Revive — brand layer
   ---------------------------------------------------------------------------
   Loaded AFTER main_style.css / history_style.css, and it only overrides.
   Nothing here is required for a page to work; remove the <link> and the app
   falls back to the old skin intact.

   The important part is the block right below. Every existing view is already
   written against --text-color, --outgoing-chat-bg, --incoming-chat-bg and
   --incoming-chat-border, so re-pointing those four re-skins /stats, /engaged,
   /roas and the rest in one place instead of in fifteen templates.

   Palette follows the mark: a cool blue-grey for the dormant lead, a warm
   ember for the part we bring back. The ember is the only saturated colour in
   the product, so it always means "this is the thing that matters".
   ========================================================================= */

:root {
  /* Brand */
  --rv-ember:       #F2694A;
  --rv-ember-deep:  #D6452B;
  --rv-amber:       #F0A94F;
  --rv-dormant:     #55697A;

  /* Surfaces — blue-biased neutrals, not pure grey */
  --rv-ground:      #101820;
  --rv-surface:     #1A242E;
  --rv-surface-2:   #212E3A;
  --rv-line:        #2A3845;
  --rv-ink:         #E8EFF5;
  --rv-muted:       #93A6B7;

  --rv-font-ui:     "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rv-font-display:"Fraunces", Georgia, "Times New Roman", serif;
  --rv-font-mono:   "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Re-point the app's existing tokens at the brand palette. */
  --text-color:            var(--rv-ink);
  --outgoing-chat-bg:      var(--rv-ground);
  --incoming-chat-bg:      var(--rv-surface);
  --outgoing-chat-border:  var(--rv-line);
  --incoming-chat-border:  var(--rv-line);
  --icon-color:            var(--rv-muted);
  --icon-hover-bg:         var(--rv-surface-2);
  --placeholder-color:     #7A8B9A;
}

/* main_style.css sets the family on `*`, so matching that specificity later in
   the cascade is the only way to replace it without !important everywhere. */
* {
  font-family: var(--rv-font-ui);
}

body {
  background: var(--rv-ground);
  color: var(--rv-ink);
  -webkit-font-smoothing: antialiased;
}

/* Digits that sit in columns should line up: every table in this app is
   numbers the team compares down a column. */
table, .en-num, .st-slots-legend, code, pre {
  font-variant-numeric: tabular-nums;
}

code, pre, .rv-mono { font-family: var(--rv-font-mono); }

/* ---------------------------------------------------------------- header -- */

.rv-header {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  padding: 0 22px;
  background: var(--rv-ground);
  border-bottom: 1px solid var(--rv-line);
}

.rv-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--rv-ink);
}

.rv-brand:hover .rv-word { color: var(--rv-ember); }

.rv-mark { width: 28px; height: 28px; display: block; flex: none; }

.rv-word {
  font-family: var(--rv-font-display);
  font-variation-settings: "opsz" 60, "WONK" 1;
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: -0.02em;
  line-height: 1;
  transition: color 0.18s ease;
}

/* The one place the product says what it is. Hidden on narrow screens rather
   than wrapped, because a broken tagline is worse than no tagline. */
.rv-claim {
  font-size: 0.76rem;
  color: var(--rv-muted);
  padding-left: 14px;
  border-left: 1px solid var(--rv-line);
  letter-spacing: 0.01em;
}

@media screen and (max-width: 720px) {
  .rv-claim { display: none; }
}

/* The hamburger was a floating icon with nothing to sit against. Now it has a
   bar, so it belongs to it. */
.nav-toggle-btn {
  position: static !important;
  margin-left: auto;
  font-size: 1.7rem !important;
  color: var(--rv-muted) !important;
  line-height: 1;
}

.nav-toggle-btn:hover { color: var(--rv-ember) !important; }

/* La variante flotante, para vistas cuyo layout ya ocupa la pantalla entera
   (el buzon de /history). Se sale del flujo para no empujar paneles fijos, y
   se queda con lo minimo: marca y acceso al menu. */
.rv-header--float {
  position: fixed;
  top: 10px;
  right: 12px;
  left: auto;
  width: auto;
  height: auto;
  gap: 10px;
  padding: 7px 12px 7px 14px;
  background: var(--rv-surface);
  border: 1px solid var(--rv-line);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.34);
  z-index: 40;
}

.rv-header--float .rv-claim { display: none; }
.rv-header--float .rv-mark { width: 22px; height: 22px; }
.rv-header--float .rv-word { font-size: 1.05rem; }
.rv-header--float .nav-toggle-btn { margin-left: 4px; font-size: 1.45rem !important; }

/* --------------------------------------------------------------- sidebar -- */

.nav-sidebar {
  background-color: var(--rv-surface) !important;
  border-left: 1px solid var(--rv-line);
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.36) !important;
}

.nav-sidebar-header {
  background-color: transparent !important;
  align-items: center;
  justify-content: space-between !important;
  padding: 14px 16px 12px !important;
  border-bottom: 1px solid var(--rv-line);
}

.nav-sidebar-header .rv-brand { gap: 9px; }
.nav-sidebar-header .rv-mark { width: 24px; height: 24px; }
.nav-sidebar-header .rv-word { font-size: 1.15rem; }

.nav-close-btn { font-size: 1.6rem !important; color: var(--rv-muted) !important; }
.nav-close-btn:hover { color: var(--rv-ember) !important; }

.nav-sidebar-links { padding: 8px 0 26px !important; }

.nav-sidebar-link {
  padding: 11px 20px !important;
  font-size: 0.92rem;
  color: var(--rv-muted) !important;
  border-left: 2px solid transparent;
}

.nav-sidebar-link:hover {
  background-color: var(--rv-surface-2) !important;
  color: var(--rv-ink) !important;
}

/* Active state is the ember, and it is a rail rather than a fill: the fill
   competed with every panel on the page behind it. */
.nav-sidebar-link.active {
  color: var(--rv-ink) !important;
  background-color: var(--rv-surface-2) !important;
  border-left-color: var(--rv-ember);
  font-weight: 600;
}

.nav-sidebar-link.active::after { display: none !important; }

/* A divider before the admin-only half of the menu, so the daily tools and the
   configuration read as two different kinds of thing. */
.nav-group-label {
  display: block;
  padding: 18px 20px 6px;
  font-family: var(--rv-font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--rv-dormant);
  border-top: 1px solid var(--rv-line);
  margin-top: 8px;
}

/* ----------------------------------------------------------------- login -- */

.rv-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(58rem 32rem at 50% -12%, rgba(242, 105, 74, 0.13), transparent 62%),
    var(--rv-ground);
}

.rv-login-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.rv-login .rv-mark-lg { width: 66px; height: 66px; margin: 0 auto 20px; display: block; }

.rv-login h1 {
  font-family: var(--rv-font-display);
  font-variation-settings: "opsz" 120, "WONK" 1;
  font-weight: 600;
  font-size: 3.1rem;
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0;
  color: var(--rv-ink);
}

.rv-login h1 .dot { color: var(--rv-ember); }

.rv-login .rv-login-claim {
  margin: 14px auto 30px;
  max-width: 25em;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--rv-muted);
}

.rv-login form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  background: var(--rv-surface);
  border: 1px solid var(--rv-line);
  border-radius: 6px;
  padding: 22px;
}

.rv-login label {
  font-family: var(--rv-font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--rv-muted);
  display: block;
  margin-bottom: 6px;
}

.rv-login input[type="text"],
.rv-login input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  font-size: 0.96rem;
  color: var(--rv-ink);
  background: var(--rv-ground);
  border: 1px solid var(--rv-line);
  border-radius: 4px;
  transition: border-color 0.16s ease;
}

.rv-login input:focus {
  outline: none;
  border-color: var(--rv-ember);
  box-shadow: 0 0 0 3px rgba(242, 105, 74, 0.18);
}

.rv-login button {
  margin-top: 4px;
  width: 100%;
  padding: 12px 18px;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #FFF;
  background: var(--rv-ember-deep);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.rv-login button:hover { background: var(--rv-ember); }

.rv-login button:focus-visible,
.rv-login a:focus-visible {
  outline: 2px solid var(--rv-ember);
  outline-offset: 2px;
}

.rv-login .rv-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 0.86rem;
  color: #FFD9CE;
  background: rgba(214, 69, 43, 0.18);
  border: 1px solid rgba(242, 105, 74, 0.4);
}

.rv-login .rv-foot {
  margin: 22px 0 0;
  font-size: 0.74rem;
  color: var(--rv-dormant);
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
