/* ============================================================
   DESIGN TOKENS
   Paleta validada (ver dataviz skill / js/engine/CONTRACT.md).
   Light es el valor por defecto; dark vía prefers-color-scheme
   y vía [data-theme] cuando el usuario fuerza el tema con el
   selector del topbar (el selector manual siempre gana).
   ============================================================ */
:root {
  color-scheme: light;
  --surface:      #fcfcfb;
  --plane:        #f9f9f7;
  --surface-2:    #ffffff;
  --surface-3:    #f2f1ed;
  --ink:          #0b0b0b;
  --ink-2:        #52514e;
  --ink-muted:    #898781;
  --grid:         #e1e0d9;
  --baseline:     #c3c2b7;
  --border:       rgba(11,11,11,0.10);
  --border-strong:rgba(11,11,11,0.18);

  --pos:          #006300;
  --neg:          #d03b3b;
  --warn:         #fab219;

  --accent:       #2a78d6;
  --accent-2:     #1c5cab;

  /* paleta categórica (orden fijo, no se recicla) */
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100;
  --cat-5: #e87ba4; --cat-6: #008300; --cat-7: #4a3aa7; --cat-8: #e34948;

  --radius:   14px;
  --radius-sm:8px;
  --font-ui:  system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shadow-card: 0 2px 10px rgba(11,11,11,0.06);
  --shadow-pop:  0 20px 48px rgba(11,11,11,0.22);
  --shadow-hover:0 12px 28px rgba(42,120,214,0.16);

  /* acentos vibrantes: gradiente construido con dos tonos ya validados de
     la paleta categórica (cat-1 y cat-7), nunca colores inventados fuera
     del sistema */
  --grad-brand:  linear-gradient(135deg, var(--cat-1) 0%, var(--cat-7) 100%);
  --grad-pos:    linear-gradient(135deg, #1baf7a 0%, #0f8f5f 100%);
  --grad-neg:    linear-gradient(135deg, #e34948 0%, #b8302f 100%);
  --tone-pos-bg:    color-mix(in srgb, var(--pos) 14%, var(--surface));
  --tone-pos-border:color-mix(in srgb, var(--pos) 38%, var(--border));
  --tone-neg-bg:    color-mix(in srgb, var(--neg) 12%, var(--surface));
  --tone-neg-border:color-mix(in srgb, var(--neg) 34%, var(--border));
  --tone-accent-bg:    color-mix(in srgb, var(--cat-1) 12%, var(--surface));
  --tone-accent-border:color-mix(in srgb, var(--cat-1) 34%, var(--border));
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface:      #1a1a19;
    --plane:        #0d0d0d;
    --surface-2:    #202020;
    --surface-3:    #262625;
    --ink:          #ffffff;
    --ink-2:        #c3c2b7;
    --ink-muted:    #898781;
    --grid:         #2c2c2a;
    --baseline:     #383835;
    --border:       rgba(255,255,255,0.10);
    --border-strong:rgba(255,255,255,0.18);

    --pos:          #0ca30c;
    --neg:          #e66767;
    --accent:       #3987e5;
    --accent-2:     #86b6ef;

    --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500;
    --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9; --cat-8: #e66767;

    --shadow-card: 0 1px 2px rgba(0,0,0,0.35);
    --shadow-pop:  0 16px 40px rgba(0,0,0,0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface:      #1a1a19;
  --plane:        #0d0d0d;
  --surface-2:    #202020;
  --surface-3:    #262625;
  --ink:          #ffffff;
  --ink-2:        #c3c2b7;
  --ink-muted:    #898781;
  --grid:         #2c2c2a;
  --baseline:     #383835;
  --border:       rgba(255,255,255,0.10);
  --border-strong:rgba(255,255,255,0.18);
  --pos:          #0ca30c;
  --neg:          #e66767;
  --accent:       #3987e5;
  --accent-2:     #86b6ef;
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500;
  --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9; --cat-8: #e66767;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-pop:  0 16px 40px rgba(0,0,0,0.55);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================ RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font-ui);
  background: var(--plane);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ============================================================ ACCESS */
[hidden] { display: none !important; }
body.login-active { overflow: hidden; }
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--cat-1) 18%, transparent), transparent 34%),
    radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--cat-7) 16%, transparent), transparent 32%),
    var(--plane);
}
.login-card {
  width: min(100%, 430px);
  padding: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-pop);
  text-align: center;
  animation: rise-in .45s cubic-bezier(.2,.8,.2,1);
}
.login-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 15px;
  background: var(--grad-brand);
  color: white;
  font-size: 22px;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--cat-1) 28%, transparent);
}
.login-eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.login-card h1 { margin-top: 6px; font-size: 27px; line-height: 1.2; }
.login-copy { margin-top: 10px; color: var(--ink-2); }
.login-form { margin-top: 26px; text-align: left; }
.login-form label { display: block; margin-bottom: 7px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.password-field { position: relative; }
.password-field input {
  width: 100%;
  height: 48px;
  padding: 0 88px 0 14px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.password-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  padding: 5px 7px;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.login-error { min-height: 21px; padding-top: 5px; color: var(--neg); font-size: 12px; }
.login-submit {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--grad-brand);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: transform .15s, box-shadow .15s;
}
.login-submit:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.login-contact { display: inline-block; margin-top: 22px; font-size: 12px; font-weight: 650; }
@media (max-width: 480px) {
  .login-card { padding: 30px 22px; }
  .login-card h1 { font-size: 24px; }
}

/* ============================================================ TOPBAR */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; }
.brand-mark {
  font-size: 1.3rem;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 6px color-mix(in srgb, var(--cat-1) 45%, transparent));
}
.brand-name { color: var(--ink-2); font-weight: 500; }

.demo-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--warn); border: 1px solid var(--warn); border-radius: 20px; padding: 2px 8px;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }
.utime { font-size: 11px; color: var(--ink-muted); white-space: nowrap; }

.icon-btn {
  background: transparent; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--ink-2); cursor: pointer; font-size: 13px; padding: 5px 10px;
  transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.icon-btn:hover { color: var(--ink); background: var(--tone-accent-bg); border-color: var(--tone-accent-border); transform: translateY(-1px); }
.icon-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.icon-btn:disabled#refreshBtn { animation: spin 1s linear infinite; display: inline-flex; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: .03em; }
.badge-ok { color: var(--pos); border: 1px solid currentColor; background: var(--tone-pos-bg); }
.badge-ok::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse-dot 1.8s ease-in-out infinite; }
.badge-loading { color: var(--accent); border: 1px solid currentColor; background: var(--tone-accent-bg); }
.badge-loading::before { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
.badge-err { color: var(--neg); border: 1px solid currentColor; background: var(--tone-neg-bg); }
.badge-err::before { content: '!'; display: inline-flex; align-items: center; justify-content: center; width: 12px; height: 12px; border-radius: 50%; background: currentColor; color: var(--surface); font-size: 9px; font-weight: 800; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.7); } }

/* ============================================================ NAV TABS */
.tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  padding: 0 20px;
  gap: 4px;
  overflow-x: auto;
  position: sticky;
  top: 52px;
  z-index: 190;
}
.tab {
  position: relative;
  font-size: 13px; font-weight: 600; color: var(--ink-muted);
  padding: 11px 14px; cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap; transition: color .15s, transform .15s; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--ink); transform: translateY(-1px); }
.tab.active { color: var(--ink); }
.tab.active::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--grad-brand); border-radius: 2px 2px 0 0;
}
.tab-icon { font-size: 14px; filter: saturate(1.15); }

.view { display: none; padding: 18px 20px 60px; max-width: 1320px; margin: 0 auto; }
.view.active { display: block; animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.rise-in { animation: rise-in .45s cubic-bezier(.2,.8,.2,1) backwards; }

/* ============================================================ SECTION HEADS */
.section-title {
  font-size: 11px; font-weight: 700; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: .08em; margin: 22px 0 10px;
}
.section-title:first-child { margin-top: 0; }

/* ============================================================ STAT TILES */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 10px; }
.stat-row.hero .stat-tile { padding: 18px 20px; }

.stat-tile {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 15px; box-shadow: var(--shadow-card);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, border-color .18s;
}
.stat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.stat-tile.tone-pos { background: var(--tone-pos-bg); border-color: var(--tone-pos-border); }
.stat-tile.tone-neg { background: var(--tone-neg-bg); border-color: var(--tone-neg-border); }
.stat-tile.tone-accent { background: var(--tone-accent-bg); border-color: var(--tone-accent-border); }
.stat-tile.tone-pos:hover, .stat-tile.tone-neg:hover, .stat-tile.tone-accent:hover { box-shadow: var(--shadow-hover); }
.stat-tile::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-brand); opacity: 0; transition: opacity .18s;
}
.stat-tile.tone-pos::before { background: var(--grad-pos); opacity: 1; }
.stat-tile.tone-neg::before { background: var(--grad-neg); opacity: 1; }
.stat-tile.tone-accent::before { opacity: 1; }
.stat-tile:hover::before { opacity: 1; }

.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.stat-lbl { font-size: 10px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-icon { font-size: 15px; line-height: 1; opacity: .85; filter: saturate(1.2); }
.stat-val { font-size: 22px; font-weight: 700; line-height: 1.1; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.stat-row.hero .stat-val { font-size: 28px; }
.stat-sub { font-size: 11px; color: var(--ink-muted); margin-top: 4px; }

/* ============================================================ CARDS */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card);
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.card-head {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-head-title { font-size: 11.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 7px; }
.card-body { padding: 16px; }

.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 300px; }
.chart-box.short { height: 190px; }

/* ============================================================ MINI LISTS (top contribuyentes, actividad reciente) */
.mini-list { display: flex; flex-direction: column; }
.mini-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 2px; border-bottom: 1px solid var(--border);
}
.mini-row:last-child { border-bottom: none; }
.mini-row-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mini-swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.mini-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 10.5px; color: var(--ink-muted); }
.mini-val { font-size: 12.5px; font-weight: 700; font-family: var(--font-num); white-space: nowrap; }

/* ============================================================ QUALITY BANNER */
.quality-banner {
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border));
  border-radius: var(--radius); padding: 10px 14px; font-size: 12px; color: var(--ink-2);
  margin-bottom: 14px;
}
.quality-banner strong { color: var(--ink); }
.quality-icon { font-size: 14px; flex: none; }

/* ============================================================ PERIOD PILLS */
.period-bar { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.period-btn {
  font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 20px; padding: 5px 13px;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.period-btn:hover { background: var(--surface-3); color: var(--ink); transform: translateY(-1px); }
.period-btn.active {
  background: var(--grad-brand); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--cat-1) 45%, transparent);
}

/* ============================================================ WATERFALL LEGEND / NOTE */
.waterfall-note { font-size: 11px; color: var(--ink-muted); margin-top: 8px; }

/* ============================================================ TABLES */
.table-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.search-input, .select-input {
  font-family: inherit; font-size: 12.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px 10px;
}
.search-input { min-width: 200px; }
.search-input:focus, .select-input:focus { outline: none; border-color: var(--accent); }

.tcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card);
  transition: box-shadow .2s, border-color .2s;
}
.tcard:hover { box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.tcard-head { padding: 11px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.tcard-title { font-size: 11.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.tcard-count { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--tone-accent-bg); border: 1px solid var(--tone-accent-border); border-radius: 20px; padding: 1px 9px; }

.ox { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  background: var(--surface-3); color: var(--ink-muted); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; text-align: right;
  white-space: nowrap; border-bottom: 1px solid var(--border-strong); cursor: pointer; user-select: none;
}
thead th:first-child, thead th:nth-child(2) { text-align: left; }
thead th:hover { color: var(--ink); }
thead th.sort-asc::after { content: ' \2191'; }
thead th.sort-desc::after { content: ' \2193'; }
thead th.no-sort { cursor: default; }

tbody tr.data-row { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s, transform .12s; }
tbody tr.data-row:hover { background: var(--tone-accent-bg); }
tbody tr.data-row:active { transform: scale(.998); }
tbody tr.data-row.is-open { background: var(--tone-accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
td { padding: 8px 10px; text-align: right; white-space: nowrap; font-size: 12px; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
td:first-child, td:nth-child(2) { text-align: left; font-family: var(--font-ui); }

.cell-name { font-weight: 600; font-size: 12.5px; }
.cell-sub { display: block; font-size: 10px; color: var(--ink-muted); font-weight: 400; margin-top: 1px; }
.tag { display: inline-block; background: var(--surface-3); border: 1px solid var(--border); border-radius: 3px; font-size: 10px; font-weight: 600; color: var(--ink-2); padding: 1px 6px; }
.tag-warn { color: var(--warn); border-color: currentColor; }

.state-loading, .state-error, .state-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 44px; color: var(--ink-muted); font-size: 13px; text-align: center; }
.state-error { color: var(--neg); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ DRAWER */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-pop);
  z-index: 301; transform: translateX(100%); transition: transform .2s ease; overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-head { position: sticky; top: 0; background: var(--surface); padding: 16px 18px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.drawer-title { font-size: 16px; font-weight: 700; }
.drawer-sub { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }
.drawer-close { background: transparent; border: none; color: var(--ink-muted); font-size: 20px; cursor: pointer; line-height: 1; padding: 2px 4px; }
.drawer-close:hover { color: var(--ink); }
.drawer-body { padding: 14px 18px 30px; display: flex; flex-direction: column; gap: 18px; }
.drawer-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer-stats .stat-tile { padding: 10px 12px; }
.drawer-stats .stat-val { font-size: 17px; }

/* ============================================================ ACTIVITY LIST */
.activity-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ============================================================ QUALITY VIEW */
.quality-list { display: flex; flex-direction: column; gap: 10px; }
.quality-item {
  display: flex; gap: 12px; padding: 12px 14px;
  background: var(--tone-accent-bg); border: 1px solid var(--tone-accent-border); border-radius: var(--radius);
  transition: transform .15s, box-shadow .15s;
}
.quality-item:hover { transform: translateX(3px); box-shadow: var(--shadow-hover); }
.quality-item-icon {
  font-size: 17px; flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); box-shadow: var(--shadow-card);
}
.quality-item-title { font-size: 12.5px; font-weight: 700; }
.quality-item-detail { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.quality-all-good { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px; color: var(--ink-muted); text-align: center; }
.quality-all-good .big { font-size: 28px; }

.methodology { margin-top: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 12px; }
.method-item {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s;
}
.method-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.method-item::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad-brand); opacity: .8; }
.method-term { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.method-def { font-size: 11.5px; color: var(--ink-2); line-height: 1.55; }

/* ============================================================ RESPONSIVE ============================================================ */
@media (max-width: 720px) {
  .view { padding: 14px 12px 50px; }
  .topbar, .tabs { padding: 0 12px; }
  .utime { display: none; }
  .stat-val { font-size: 18px; }
  .stat-row.hero .stat-val { font-size: 20px; }
  .drawer { width: 100vw; }
  table { font-size: 11px; }
}

@media (max-width: 480px) {
  .brand-name, .demo-badge { display: none; } /* el badge de estado ya dice "Demo" */
  .topbar { gap: 6px; }
  .topbar-right { gap: 6px; }
}

.hide-mobile { }
@media (max-width: 640px) { .hide-mobile { display: none; } }

/* ============================================================ FOOTNOTE ============================================================ */
.footnote { font-size: 11px; color: var(--ink-muted); margin-top: 26px; text-align: center; }
