/* Luiz Ramos · Dashboard · 2026-05-20 v3 · Dark-vibrant com accent dinâmico
   Padrão accent: vermelho marca #a1191c. Seletor: red/green/cyan/magenta/chumbo.
   Semânticos --ok e --error são FIXOS (verde/vermelho) independente do accent. */

/* ============ Tokens base ============ */
:root {
  --canvas:      #0a0a0a;
  --canvas-2:    #0e0e0e;
  --surface:     #171717;
  --surface-2:   #1f1f1f;
  --surface-3:   #242424;
  --ink:         #ededed;
  --body:        #a3a3a3;
  --muted:       #6e6e6e;
  --hairline:    #262626;
  --hairline-2:  #2e2e2e;

  /* Accent padrão = vermelho marca */
  --accent:      #a1191c;
  --accent-hov:  #7a1316;
  --accent-soft: rgba(161, 25, 28, 0.12);
  --accent-glow: rgba(161, 25, 28, 0.28);
  --accent-on:   #ffffff;

  /* Semânticos FIXOS (não mudam com accent) */
  --ok:          #00c573;
  --ok-soft:     rgba(0, 197, 115, 0.12);
  --warn:        #f5a524;
  --error:       #ef4444;

  /* Cores fixas pros cards (não mudam com accent) */
  --c-green:     #00c573;
  --c-cyan:      #06b6d4;
  --c-magenta:   #d946ef;
  --c-chumbo:    #6e6e6e;
  --c-red:       #a1191c;
  --c-amber:     #f5a524;

  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "Fira Code", "Consolas", "Courier New", monospace;

  --text-display-xl: 4.5rem;
  --text-display:    3rem;
  --text-h1:         2rem;
  --text-h2:         1.5rem;
  --text-h3:         1.25rem;
  --text-h4:         1rem;
  --text-body-lg:    1rem;
  --text-body:       0.9375rem;
  --text-sm:         0.875rem;
  --text-xs:         0.8125rem;
  --text-caption:    0.75rem;

  --leading-body:    1.5;
  --leading-heading: 1.15;

  --space-xxxs: 4px;
  --space-xxs:  8px;
  --space-xs:   12px;
  --space-sm:   16px;
  --space-md:   24px;
  --space-lg:   32px;
  --space-xl:   48px;
  --space-xxl:  64px;

  --radius-none: 0;
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-xl:   12px;
  --radius-full: 9999px;

  --sidebar-w: 240px;
  --topbar-h:  52px;
}

/* ============ Accent overrides (seletor de cores) ============ */
[data-accent="red"] {
  --accent:      #a1191c;
  --accent-hov:  #7a1316;
  --accent-soft: rgba(161, 25, 28, 0.12);
  --accent-glow: rgba(161, 25, 28, 0.28);
  --accent-on:   #ffffff;
}
[data-accent="green"] {
  --accent:      #00c573;
  --accent-hov:  #00a35e;
  --accent-soft: rgba(0, 197, 115, 0.12);
  --accent-glow: rgba(0, 197, 115, 0.28);
  --accent-on:   #000000;
}
[data-accent="cyan"] {
  --accent:      #06b6d4;
  --accent-hov:  #0891b2;
  --accent-soft: rgba(6, 182, 212, 0.12);
  --accent-glow: rgba(6, 182, 212, 0.28);
  --accent-on:   #000000;
}
[data-accent="magenta"] {
  --accent:      #d946ef;
  --accent-hov:  #c026d3;
  --accent-soft: rgba(217, 70, 239, 0.12);
  --accent-glow: rgba(217, 70, 239, 0.28);
  --accent-on:   #000000;
}
[data-accent="chumbo"] {
  --accent:      #6e6e6e;
  --accent-hov:  #525252;
  --accent-soft: rgba(110, 110, 110, 0.16);
  --accent-glow: rgba(110, 110, 110, 0.28);
  --accent-on:   #ffffff;
}

/* ============ Base ============ */
* { box-sizing: border-box; }

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: var(--leading-body);
  color: var(--body);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-feature-settings: "ss01", "cv11";
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: color 120ms ease;
}
a:hover { color: var(--accent); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  line-height: var(--leading-heading);
  font-feature-settings: "ss01", "cv11";
}

::selection { background: var(--accent); color: var(--accent-on); }

/* ============ Layout ============ */
body.dash {
  margin: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--canvas);
}

/* ============ Sidebar ============ */
.sidebar {
  background: var(--canvas);
  border-right: 1px solid var(--hairline);
  padding: var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 0 8px;
}
.sidebar__brand:hover { color: var(--ink); }
.sidebar__brand svg {
  color: var(--ink);
  height: 22px;
  width: auto;
  flex-shrink: 0;
}

.sidebar__version {
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 16px 8px;
  margin-top: -4px;
  user-select: none;
}
.sidebar__version::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 6px;
  vertical-align: 1px;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
}

.sidebar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--muted);
  transition: border-color 120ms;
}
.sidebar__search:focus-within {
  border-color: var(--accent);
  background: var(--canvas);
}
.sidebar__search svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}
.sidebar__search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
  min-width: 0;
}
.sidebar__search input::placeholder { color: var(--muted); }
.sidebar__search kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--muted);
  flex-shrink: 0;
}

.sidebar__section { display: flex; flex-direction: column; gap: 2px; }
.sidebar__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px var(--space-xxs);
  font-weight: 500;
}
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  color: var(--body);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  border-radius: var(--radius-md);
  transition: background 120ms, color 120ms;
  position: relative;
}
.sidebar__nav a:hover {
  background: var(--surface);
  color: var(--ink);
}
.sidebar__nav a.active {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 500;
}
.sidebar__nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.sidebar__user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
}
.sidebar__user__avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hov) 100%);
  color: var(--accent-on);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.sidebar__user__meta { flex: 1; min-width: 0; line-height: 1.2; }
.sidebar__user__meta strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-sm);
}
.sidebar__user__meta span {
  color: var(--muted);
  font-size: var(--text-xs);
}
.sidebar__user a {
  color: var(--muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 120ms, background 120ms;
  font-size: 16px;
  line-height: 1;
}
.sidebar__user a:hover {
  color: var(--error);
  background: var(--canvas);
}

/* ============ Main ============ */
.dash-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============ Topbar ============ */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
}
.dash-breadcrumb {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--muted);
}
.dash-breadcrumb strong {
  color: var(--ink);
  font-weight: 500;
}
.dash-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Topbar chips (nav Intra) — globais, antes vinham só de jornada.css ---- */
.topbar-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin: 0 16px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline-2, var(--hairline)) transparent;
}
.topbar-chips::-webkit-scrollbar { height: 4px; }
.topbar-chips::-webkit-scrollbar-thumb { background: var(--hairline-2, var(--hairline)); border-radius: 2px; }

.topbar-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.topbar-chip:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--muted) 30%, transparent);
}
.topbar-chip--active {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

/* ---- Topbar search (movido do sidebar) ---- */
.topbar__search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 4px 8px;
  min-width: 240px;
  max-width: 320px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.topbar__search:focus-within {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}
.topbar__search svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}
.topbar__search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  padding: 4px 2px;
  min-width: 0;
}
.topbar__search input::placeholder { color: var(--muted); }
.topbar__search kbd {
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 1px 4px;
  flex-shrink: 0;
}
.topbar__search .search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface, #141414);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 60;
  max-height: 60vh;
  overflow-y: auto;
}
@media (max-width: 900px) {
  .topbar__search { min-width: 160px; }
  .topbar__search kbd { display: none; }
}
@media (max-width: 640px) {
  .topbar__search { display: none; }
}

/* ---- Topbar datepicker (substitui selects mes/ano inline) ---- */
.topbar-datepicker {
  position: relative;
  display: inline-block;
}
.topbar-datepicker__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  cursor: pointer;
  list-style: none;
  border-radius: 6px;
}
.topbar-datepicker__trigger::-webkit-details-marker,
.topbar-datepicker__trigger::marker { display: none; content: ""; }
.topbar-datepicker__label {
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-transform: capitalize;
  margin-right: 50px;
}
.topbar-datepicker[open] > .topbar-datepicker__trigger {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
}
.topbar-datepicker__panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface, #141414);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 10px;
  display: flex;
  gap: 6px;
  z-index: 60;
  min-width: 220px;
}
.topbar-datepicker__panel select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  flex: 1;
}
.topbar-datepicker__panel select:focus {
  outline: 0;
  border-color: var(--accent);
}

/* dash-topbar layout — actions vão pra direita, search dentro de actions */
.dash-topbar { gap: 12px; }
.dash-topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.dash-topbar > .topbar-chips {
  min-width: 0;        /* permite shrink */
  flex: 1 1 auto;
}
.dash-topbar > .dash-breadcrumb {
  flex-shrink: 0;
  white-space: nowrap;
}
/* tighten search dentro do actions */
.dash-topbar__actions .topbar__search {
  min-width: 180px;
  max-width: 280px;
}
@media (max-width: 1100px) {
  .dash-topbar__actions .topbar__search { min-width: 140px; max-width: 220px; }
}
@media (max-width: 900px) {
  .dash-topbar__actions .topbar__search { display: none; }
}

/* ---- Tutorial modal (centralizado, abre via 💡 do topbar) ---- */
dialog.tutorial-modal {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 0;
  background: var(--surface, #141414);
  color: var(--ink);
  max-width: 640px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
dialog.tutorial-modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}
.tutorial-modal__wrap {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}
.tutorial-modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
}
.tutorial-modal__icon {
  font-size: 16px;
  color: var(--accent);
  flex-shrink: 0;
}
.tutorial-modal__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  letter-spacing: 0.01em;
}
.tutorial-modal__close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
}
.tutorial-modal__close:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}
.tutorial-modal__list {
  list-style: decimal;
  padding: 16px 24px 16px 44px;
  margin: 0;
  overflow-y: auto;
  font-size: 0.92rem;
  line-height: 1.55;
}
.tutorial-modal__list li {
  margin-bottom: 12px;
}
.tutorial-modal__list strong {
  color: var(--accent);
  margin-right: 4px;
}
.tutorial-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--hairline);
}
.tutorial-modal__btn {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 8px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}
.tutorial-modal__btn:hover { filter: brightness(1.1); }

/* Sector colors no border-top do modal */
.tutorial-modal--sector-c { border-top: 3px solid var(--sector-c, #06B6D4); }
.tutorial-modal--sector-m { border-top: 3px solid var(--sector-m, #D946EF); }
.tutorial-modal--sector-y { border-top: 3px solid var(--sector-y, #EAB308); }
.tutorial-modal--sector-k { border-top: 3px solid var(--sector-k, #71717A); }

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
  font-size: 14px;
}
.icon-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

/* ============ Accent picker (5 pills) ============ */
.accent-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
}
.accent-picker__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 2px;
  user-select: none;
}
.accent-pill {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, border-color 120ms ease;
  position: relative;
}
.accent-pill:hover { transform: scale(1.15); }
.accent-pill[aria-pressed="true"] {
  border-color: var(--ink);
}
.accent-pill[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--hairline-2);
}
.accent-pill[data-color="red"]     { background: #a1191c; }
.accent-pill[data-color="green"]   { background: #00c573; }
.accent-pill[data-color="cyan"]    { background: #06b6d4; }
.accent-pill[data-color="magenta"] { background: #d946ef; }
.accent-pill[data-color="chumbo"]  { background: #6e6e6e; }

/* ============ Hero band ============ */
.hero-band {
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--hairline);
  background: var(--canvas);
}
.hero-band h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h1);
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.025em;
}
.hero-band p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-body);
}
.hero-band time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  display: inline-block;
  margin-top: var(--space-sm);
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
}

/* ============ Widgets grid ============ */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-md);
  padding: var(--space-md);
}
.widget-slot {
  grid-column: span var(--span, 6);
  min-width: 0;
}
.widget {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  height: 100%;
  transition: border-color 120ms;
}
.widget:hover { border-color: var(--hairline-2); }
.widget--accent {
  border-top: 1px solid var(--accent);
  box-shadow: 0 -1px 0 0 var(--accent);
}
.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.widget-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}
.widget-body { flex: 1; }

/* ============ Stats cards ============ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}
.stat-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: border-color 120ms;
}
.stat-card:hover { border-color: var(--hairline-2); }
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--c, var(--accent));
  opacity: 0.7;
}
.stat-card__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.stat-card__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
}
.stat-card__delta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat-card__delta.up { color: var(--ok); }
.stat-card__delta.down { color: var(--error); }
.stat-card__bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 4px;
}
.stat-card__bar > span {
  display: block;
  height: 100%;
  background: var(--c, var(--accent));
  border-radius: var(--radius-full);
  transition: width 300ms ease;
}

/* ============ Mono labels ============ */
.mono-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 500;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-sm);
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
  min-height: 36px;
  line-height: 1;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-hov);
  border-color: var(--accent-hov);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline-2);
}
.btn-outline:hover {
  background: var(--surface);
  border-color: var(--ink);
}

/* ============ Login page ============ */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  padding: var(--space-md);
  font-family: var(--font-body);
  color: var(--body);
  background-image: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 50%);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.login-logo {
  margin: 0 auto var(--space-md);
  display: block;
  color: var(--ink);
  height: 48px;
  width: auto;
}
.login-card h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.75rem;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.login-sub {
  color: var(--muted);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-lg);
}
.login-card form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  text-align: left;
}
.login-card label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--body);
  font-weight: 500;
}
.login-card input[type="password"] {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  outline: 0;
  transition: border-color 120ms, box-shadow 120ms;
}
.login-card input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.login-card .btn {
  margin-top: var(--space-xs);
  width: 100%;
  padding: 12px;
}
.login-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-align: left;
  margin-bottom: 4px;
}
.login-foot {
  margin: var(--space-lg) 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb { background: var(--hairline-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* ============ Responsive ============ */
@media (max-width: 768px) {
  body.dash { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .widget-slot { grid-column: span 12; }
  .hero-band { padding: var(--space-lg) var(--space-md) var(--space-md); }
  .hero-band h1 { font-size: var(--text-h2); }
  .accent-picker__label { display: none; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .stat-card__value { font-size: 1.75rem; }
}

/* ============ Botões mockup no topbar ============ */
.topbar__mockup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  color: var(--muted);
  border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.topbar__mockup:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--muted) 60%, transparent);
  background: color-mix(in srgb, var(--muted) 8%, transparent);
}
.topbar__mockup--install:hover {
  color: #22c55e;
  border-color: rgba(34,197,94,0.5);
  background: rgba(34,197,94,0.08);
}
.topbar__mockup--reset:hover {
  color: var(--brand-red, #e61217);
  border-color: rgba(230,18,23,0.5);
  background: rgba(230,18,23,0.08);
}
.topbar__mockup[disabled] { opacity: 0.4; cursor: wait; }
.topbar__mockup.is-success { color: #22c55e; border-color: rgba(34,197,94,0.6); }
.topbar__mockup.is-error { color: var(--brand-red, #e61217); border-color: rgba(230,18,23,0.6); }
@media (max-width: 900px) {
  .topbar__mockup-label { display: none; }
  .topbar__mockup { padding: 6px 8px; }
}

/* BUGFIX 2026-05-24 — color-scheme for native date pickers */
html { color-scheme: dark; }

/* ============ Light mode tokens (toggle global · 2026-05-26) ============
   Sobrescreve os tokens base quando /* Topbar theme toggle button */
/* ============ Button small modifier · 2026-05-25 ============
   Use no topo de páginas onde botões de export precisam ficar compactos
   (não roubam foco do hero). Aplicar como `.btn .btn-outline .btn--sm`. */
.btn--sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: auto;
  gap: 6px;
}


/* === Sidebar masters: contorno animado · 2026-05-26 === */
@property --lr-master-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.sidebar__masters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 8px 8px 0;
  margin-bottom: 4px;
}
.sidebar__master {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--hairline, #2a2a2a);
  color: var(--ink, #e8e8e8);
  font-family: var(--font-body, Inter), sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  position: relative;
  isolation: isolate;
  transition: border-color 140ms ease, transform 80ms ease;
}
.sidebar__master:hover { border-color: var(--accent, #a1191c); }
.sidebar__master:active { transform: translateY(1px); }
.sidebar__master.active {
  border: 1px solid transparent;
  color: var(--ink, #fff);
}
.sidebar__master.active::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--lr-master-angle),
    var(--accent, #a1191c) 0deg,
    transparent 90deg,
    var(--accent, #a1191c) 180deg,
    transparent 270deg,
    var(--accent, #a1191c) 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: lr-master-rotate 3.5s linear infinite;
  pointer-events: none;
  z-index: -1;
}
@keyframes lr-master-rotate { to { --lr-master-angle: 360deg; } }
@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .sidebar__master.active { border-color: var(--accent, #a1191c); }
  .sidebar__master.active::before { display: none; }
}
.sidebar__master .lr-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent, #a1191c);
  stroke-width: 1.75;
}
.sidebar__divider {
  margin: 12px 12px 8px;
  border: none;
  height: 1px;
  background: var(--hairline, #2a2a2a);
}
.sidebar__section { padding: 0 8px; margin-bottom: 4px; }
.sidebar__section summary {
  cursor: pointer;
  padding: 6px 8px 4px;
  list-style: none;
  outline: none;
}
.sidebar__section summary::-webkit-details-marker { display: none; }
.sidebar__section[open] summary { margin-bottom: 4px; }
.sidebar__nav { padding: 0 4px; }
