:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: var(--bg-080808);
  --surface-elevated: var(--bg-0f0f0f);
  --surface-hover: #141414;
  --field: var(--bg-050505);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-hover: rgba(255, 255, 255, 0.24);
  --text: var(--white);
  --text-secondary: #b4b4b4;
  --muted: #767676;
  --dim: #4a4a4a;
  --accent: var(--white);
  --accent-dark: #000000;
  --status-ok: #10b981;
  --status-ok-bg: rgba(16, 185, 129, 0.10);
  --status-warn: #f59e0b;
  --status-warn-bg: rgba(245, 158, 11, 0.10);
  --status-crit: #ef4444;
  --status-crit-bg: rgba(239, 68, 68, 0.10);
  --btc-gold: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Geist", "Segoe UI", Roboto, sans-serif;
  --bg-020202: #020202;
  --bg-030303: #030303;
  --bg-040404: #040404;
  --bg-050505: #050505;
  --bg-060606: #060606;
  --bg-070709: #070709;
  --bg-080808: #080808;
  --bg-09090b: #09090b;
  --bg-0c0c0c: #0c0c0c;
  --bg-0d0d0d: #0d0d0d;
  --bg-0e0e0e: #0e0e0e;
  --bg-0f0f0f: #0f0f0f;
  --white: #ffffff;
  --hb-fill: var(--white);
  --hash-color: var(--text);
  --font-mono: "Geist Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  overflow-x: hidden;
}
/* O <body> NÃO pode virar um contêiner de rolagem próprio: no iPhone/Android isso trava a rolagem com o dedo,
   o "sticky" do cabeçalho e a roda do mouse. "clip" corta o que vaza para o lado sem criar rolagem. */
body { overflow-x: clip; }
@supports not (overflow-x: clip) { body { overflow-x: visible; } }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---- Top Market Ticker Minimalista ---- */
.market-ticker {
  display: none !important;
  position: sticky;
  top: 0;
  z-index: 50;
  height: 28px;
  background: #000000;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  overflow: hidden;
  font-size: 11.5px;
  user-select: none;
}

.market-ticker::before,
.market-ticker::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}

.market-ticker::before {
  left: 0;
  background: linear-gradient(90deg, #000000, transparent);
}

.market-ticker::after {
  right: 0;
  background: linear-gradient(270deg, #000000, transparent);
}

.market-ticker-track {
  display: flex;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
  padding-left: 24px;
  animation: ticker-scroll 140s linear infinite;
}

.market-ticker:hover .market-ticker-track {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.ticker-symbol {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ticker-price {
  color: var(--text);
  font-weight: 600;
}

.ticker-chg {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.ticker-chg.up {
  color: var(--status-ok);
  background: var(--status-ok-bg);
}

.ticker-chg.down {
  color: var(--status-crit);
  background: var(--status-crit-bg);
}

/* ---- Header Minimalista Super Tela ---- */
.header {
  position: relative; /* PATCH-007 item 87: o menu faz parte da página e rola junto (não fica fixo no topo) */
  top: auto;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 13px max(3vw, 20px);
  background: rgba(0, 0, 0, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.brand:hover {
  opacity: 0.82;
}

.brand-logo {
  width: 28px;
  height: 28px;
  color: var(--white);
  flex-shrink: 0;
}

.brand-text {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 15.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.brand-text strong {
  font-weight: 800;
  color: var(--white);
}

.brand-text em {
  font-style: normal;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.62);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.main-nav button {
  position: relative;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.main-nav button:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.18);
}

.main-nav button.active {
  background: var(--white);
  color: #000000;
  font-weight: 600;
  border-color: var(--white);
}

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

.agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-ok);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.lang-select {
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.lang-select:hover {
  border-color: var(--border-hover);
}

/* ---- Botões Padrão Super Tela ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--border-hover);
  background: var(--surface-elevated);
}

.btn-primary {
  background: var(--white);
  color: #000000;
  border-color: var(--white);
}

.btn-primary:hover {
  background: #e5e5e5;
  border-color: #e5e5e5;
  color: #000000;
}

.btn-danger {
  color: var(--status-crit);
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.06);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
}

.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 11.5px;
}

.btn-lg {
  height: 44px;
  padding: 0 24px;
  font-size: 14px;
}

/* ---- Containers & Views ---- */
.view-container {
  max-width: 1520px;
  margin: 0 auto;
  padding: 28px max(3vw, 20px) 80px;
}

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ---- LANDING VIEW (Minimalista Super Tela) ---- */
.hero-section {
  text-align: center;
  max-width: 860px;
  margin: 36px auto 48px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.hero-title {
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
}

.hero-title span {
  color: var(--muted);
  font-weight: 300;
}

.hero-lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

/* Moldura do Palco Interativo */
.stage-frame {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.04);
  margin-bottom: 64px;
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-050505);
  border-bottom: 1px solid var(--border);
}

.stage-dots {
  display: flex;
  gap: 7px;
}

.stage-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #262626;
  display: block;
}

.stage-url {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 3px 14px;
  border-radius: 999px;
  background: var(--bg-0c0c0c);
  border: 1px solid var(--border);
}

/* Métricas e Bento Grid */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 64px;
}

.metric-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.18s ease;
}

.metric-box:hover {
  border-color: var(--border-hover);
}

.metric-box strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.metric-box span {
  font-size: 13px;
  color: var(--muted);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 64px;
}

.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.bento-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.bento-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.bento-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
}

.bento-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* Fluxo Como Funciona */
.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 64px;
}

.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
}

.flow-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #000000;
  background: var(--white);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.flow-step h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.flow-step p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

/* Pricing Card */
.pricing-card {
  max-width: 680px;
  margin: 0 auto 40px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 36px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: center;
}

.price-big {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.price-unit {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

/* ---- MONITOR AO VIVO (LegacyMonitor em Preto Puro) ---- */
.lm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.lm-farm-title-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.farm-switch-eyebrow-row {
  display: flex;
  align-items: center;
}

.btn-farm-quick-switch {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  width: fit-content;
}

.btn-farm-quick-switch:hover {
  background: #111111;
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--white);
}

.btn-farm-quick-switch .switch-badge {
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--white);
  font-size: 10px;
}

.interactive-farm-title {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
  user-select: none;
}

.interactive-farm-title:hover {
  color: var(--white);
}

.farm-select-caret {
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.2s ease, color 0.15s ease;
}

.interactive-farm-title:hover .farm-select-caret {
  color: var(--white);
  transform: translateY(1px);
}

.farm-quick-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 100;
  width: min(420px, 94vw);
  background: var(--bg-080808);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-040404);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.dropdown-farms-list {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
}

.dropdown-farm-item {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease, border-left-color 0.15s ease;
  border-left: 3px solid transparent;
}

.dropdown-farm-item:last-child {
  border-bottom: none;
}

.dropdown-farm-item:hover {
  background: #111111;
  border-left-color: rgba(255, 255, 255, 0.4);
}

.dropdown-farm-item.active {
  background: var(--bg-0d0d0d);
  border-left-color: var(--status-ok);
}

.dropdown-farm-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dropdown-farm-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--white);
}

.dropdown-farm-loc {
  font-size: 11px;
  color: var(--muted);
}

.dropdown-farm-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin-top: 2px;
}

.dropdown-footer {
  padding: 8px 12px;
  background: var(--bg-040404);
  border-top: 1px solid var(--border);
}

.dropdown-footer .btn {
  width: 100%;
  justify-content: center;
  font-size: 11.5px;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-secondary);
}

.dropdown-footer .btn:hover {
  background: var(--bg-0e0e0e);
  color: var(--white);
}

.lm-farm-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lm-farm-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lm-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}
.lm-actions .btn-sm { padding: 0 8px; white-space: nowrap; }
.lm-farm-title-container { flex: 0 1 auto; min-width: 0; }

/* 5 KPI Cards */
.lm-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.lm-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: border-color 0.16s ease;
}

.lm-kpi:hover {
  border-color: var(--border-hover);
}

.lm-kpi-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.lm-kpi-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.lm-kpi-sub {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Gráficos 24h SVG */
.lm-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.lm-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  position: relative;
}

.lm-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.lm-chart-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.lm-chart-head strong {
  font-family: var(--font-mono);
  font-size: 16px;
}

.svg-chart-wrap {
  width: 100%;
  height: 155px;
  position: relative;
  cursor: crosshair;
}

.svg-chart-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-tooltip {
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #141414;
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  pointer-events: none;
}

/* Barra de Ferramentas e Filtros */
.lm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
}

.lm-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pill-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-040404);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.pill-btn.active {
  background: var(--white);
  color: #000000;
  border-color: var(--white);
}

.lm-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 34px;
  border-radius: 999px;
  background: var(--bg-040404);
  border: 1px solid var(--border);
  width: 240px;
}

.lm-search:focus-within {
  border-color: var(--border-hover);
}

.lm-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 12.5px;
}

.lm-select {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--bg-040404);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

/* Barra de Ações em Lote (Bulk Actions) */
.lm-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

/* Tabela da Frota (Linhas separadas estilo Card) */
.lm-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.lm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  min-width: 1040px;
}

.lm-table th {
  text-align: left;
  padding: 6px 12px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.lm-table th:hover {
  color: var(--text);
}

/* Cabeçalho combinado WORKER / IP / MAC: cada rótulo ordena por si (crescente/decrescente) */
.lm-table th.c-ident { white-space: nowrap; }
.lm-table th.c-ident .th-sort {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.12s ease, color 0.12s ease;
}
.lm-table th.c-ident .th-sort:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.lm-table th.c-ident .th-sort.active { color: var(--text); }
.lm-table th.c-ident .th-sep { opacity: 0.4; margin: 0 1px; pointer-events: none; }

.lm-table tbody tr {
  background: var(--surface);
  transition: background 0.15s ease;
}

.lm-table tbody tr:hover {
  background: var(--surface-elevated);
}

.lm-table tbody tr.row-warn {
  background: rgba(245, 158, 11, 0.05);
}

.lm-table tbody tr.row-crit {
  background: rgba(239, 68, 68, 0.06);
}

.lm-table td {
  padding: 11px 12px;
  font-size: 12.5px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.lm-table td:first-child {
  border-left: 1px solid var(--border);
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.lm-table td:last-child {
  border-right: 1px solid var(--border);
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* Barras de Hashboards */
.hb-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 135px;
}

.hb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.hb-track {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hb-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--hb-fill);
}

.hb-fill.warn {
  background: var(--status-warn);
}

.hb-fill.bad {
  background: var(--status-crit);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge-sm {
  padding: 1px 6px;
  font-size: 8.5px;
  line-height: 1.5;
  gap: 4px;
  letter-spacing: 0.02em;
}

.status-badge.ok {
  color: var(--status-ok);
  background: var(--status-ok-bg);
}

.status-badge.warn {
  color: var(--status-warn);
  background: var(--status-warn-bg);
}

.status-badge.crit {
  color: var(--status-crit);
  background: var(--status-crit-bg);
}

.star-btn {
  background: none;
  border: 0;
  color: #404040;
  font-size: 15px;
  padding: 1px 3px;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
}

.star-btn:hover {
  color: #ffd700;
  transform: scale(1.2);
}

.star-btn.on {
  color: #ffd700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

/* Modo Cards de Hashboard (Grid 4 colunas) */
.lm-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.miner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.16s ease;
}

.miner-card:hover {
  border-color: var(--border-hover);
}

/* Console de Eventos no Rodapé */
.events-console {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.events-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-050505);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}

.events-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.console-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.console-tab-btn:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.console-tab-btn.active {
  background: #181818;
  border-color: var(--border-strong);
  color: var(--white);
}

.command-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg-080808);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-left: 3px solid #10b981;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.command-entry:hover {
  background: var(--bg-0d0d0d);
}

.event-line {
  display: flex;
  gap: 10px;
  color: var(--text-secondary);
}

.event-line .ts {
  color: var(--muted);
}

/* ---- MODAIS OPERACIONAIS ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-box {
  width: min(860px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-080808);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.95);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.modal-close:hover {
  color: var(--white);
  border-color: var(--border-hover);
}

/* Toolbar de Edição do Nome & Refrigeração no Modal de Detalhes */
.det-rename-box {
  background: var(--bg-080808);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.det-rename-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 280px;
}

.det-rename-group input {
  width: 140px;
  max-width: 100%;
}

.det-cooling-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Mapa Físico PCB de Chips */
.pcb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
  padding: 16px;
  background: var(--bg-030303);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 14px 0;
}

.chip-cell {
  padding: 7px 4px;
  border-radius: 6px;
  background: var(--bg-0d0d0d);
  border: 1px solid rgba(255, 255, 255, 0.10);
  text-align: center;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.chip-cell:hover {
  transform: scale(1.06);
  border-color: var(--white);
}

.chip-cell.ok {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.chip-cell.warn {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.12);
}

.chip-cell.bad {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(239, 68, 68, 0.16);
}

.chip-cell small {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
}

.chip-cell b {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

/* ---- Form Controls ---- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: var(--bg-040404);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}

.form-input:focus {
  border-color: var(--white);
  outline: none;
}

/* ---- Watchdog Interativo & Parâmetros Configuráveis ---- */
.wd-rule-card {
  background: var(--bg-060606);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: grid;
  gap: 12px;
  transition: border-color 0.18s ease;
}

.wd-rule-card.disabled {
  opacity: 0.55;
  border-color: rgba(255, 255, 255, 0.04);
}

.wd-rule-card:hover {
  border-color: var(--border-hover);
}

.wd-grid-row {
  display: grid;
  grid-template-columns: 1fr 130px 1.4fr auto;
  align-items: center;
  gap: 12px;
}

@media (max-width: 820px) {
  .wd-grid-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.wd-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wd-field label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.wd-input, .wd-select {
  background: var(--bg-020202);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.wd-input:focus, .wd-select:focus {
  border-color: var(--white);
}

.wd-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.wd-toggle.active {
  background: var(--status-ok-bg);
  border-color: var(--status-ok);
  color: var(--status-ok);
  font-weight: 600;
}

.wd-del-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wd-del-btn:hover {
  background: var(--status-crit-bg);
  color: var(--status-crit);
  border-color: var(--status-crit);
}

/* ---- Painel de Parâmetros Rápidos do Watchdog no Dashboard (Minimalista Super Tela) ---- */
.wd-dashboard-panel {
  background: #000000;
  border: 1px solid #1a1a1f;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
  transition: border-color 0.2s ease;
}

.wd-dashboard-panel:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.wd-dashboard-panel.wd-collapsed {
  padding-bottom: 12px;
}

/* Watchdog Reboot Automático Simplificado - Minimalista Super Tela */
.wd-simple-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wd-simple-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wd-simple-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}

.wd-simple-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--accent, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wd-simple-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.wd-simple-sub {
  font-size: 11.5px;
  color: #71717a;
  margin: 2px 0 0;
  line-height: 1.4;
}

.wd-simple-corner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wd-simple-switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wd-custom-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.wd-custom-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.wd-switch-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #1f1f23;
  border: 1px solid #2e2e33;
  border-radius: 999px;
  transition: 0.2s ease;
}

.wd-switch-track:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--white);
  border-radius: 50%;
  transition: 0.2s ease;
}

.wd-custom-switch input:checked + .wd-switch-track {
  background-color: var(--accent, #22d3ee);
  border-color: var(--accent, #22d3ee);
}

.wd-custom-switch input:checked + .wd-switch-track:before {
  transform: translateX(16px);
  background-color: #000000;
}

.wd-switch-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text, #e4e4e7);
  cursor: pointer;
}

.wd-simple-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 800px) {
  .wd-simple-grid {
    grid-template-columns: 1fr;
  }
}

.wd-simple-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wd-simple-field label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #71717a;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.wd-simple-input-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-09090b);
  border: 1px solid #222226;
  border-radius: 5px;
  padding: 0 10px;
  height: 36px;
  transition: border-color 0.15s ease;
}

.wd-simple-input-wrap:focus-within {
  border-color: var(--accent, #22d3ee);
}

.wd-simple-input {
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  outline: none;
  width: 75px;
  font-family: var(--font-mono);
}

.wd-simple-unit {
  font-size: 11px;
  font-weight: 700;
  color: #71717a;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.wd-simple-hint {
  font-size: 10.5px;
  color: #52525b;
  margin-top: 1px;
}

.wd-simple-explanation {
  background: var(--bg-070709);
  border: 1px solid #1a1a1f;
  border-left: 2px solid var(--accent, #22d3ee);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #a1a1aa;
  line-height: 1.5;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wd-simple-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}
  padding-top: 4px;
}

.wd-dashboard-panel.wd-collapsed .wd-panel-head {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.wd-dashboard-panel.wd-collapsed .wd-quick-grid,
.wd-dashboard-panel.wd-collapsed .wd-feedback-msg {
  display: none !important;
}

.wd-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.wd-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.wd-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wd-quick-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

@media (max-width: 1024px) {
  .wd-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .wd-quick-grid {
    grid-template-columns: 1fr;
  }
}

.wd-quick-item {
  background: var(--bg-040404);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wd-quick-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.wd-quick-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #000000;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

.wd-quick-input {
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  width: 100%;
  outline: none;
}

.wd-quick-unit {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.wd-quick-select {
  background: #000000;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 12.5px;
  padding: 6px 8px;
  outline: none;
  width: 100%;
}

.wd-quick-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.wd-feedback-msg {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   TELA DE ENTRADA & LOGIN MINIMALISTA SUPER TELA
   HashGuard - Eficiência em monitoramento de Hash
   ========================================================================== */
.login-landing-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
  min-height: 82vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

@media (max-width: 960px) {
  .login-landing-container {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 24px 16px;
  }
}

.login-intro-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-080808);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  width: fit-content;
}

.login-intro-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-hero-logo {
  width: 38px;
  height: 38px;
  color: var(--white);
}

.login-intro-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--white);
}

@media (max-width: 720px) {
  .login-intro-title {
    font-size: 26px;
  }
}

.login-intro-desc {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  max-width: 580px;
}

.login-intro-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.login-feat-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-050505);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.login-feat-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bg-080808);
}

.login-feat-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.login-feat-item strong {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 2px;
}

.login-feat-item p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.login-intro-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.intro-stat-box {
  background: var(--bg-040404);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.intro-stat-box strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.intro-stat-box small {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-card-side {
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-logo {
  width: 32px;
  height: 32px;
  color: var(--white);
}

.login-head h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-head p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.login-demo-bar {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.login-footer-meta {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-080808);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

/* ==========================================================================
   RESUMO DAS FARMS CADASTRADAS (ABA INÍCIO)
   ========================================================================== */
.farms-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.farms-main-title {
  font-size: 28px;
  font-weight: 800;
  margin: 2px 0 6px;
  letter-spacing: -0.02em;
}

.farms-main-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  max-width: 650px;
  line-height: 1.5;
}

.farms-global-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

@media (max-width: 1100px) {
  .farms-global-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .farms-global-kpis {
    grid-template-columns: 1fr;
  }
}

.farms-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.farms-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 40px;
  width: 100%;
  max-width: 420px;
}

.farms-search-wrap input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13.5px;
  width: 100%;
  outline: none;
}

.farms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.farm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.farm-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  transform: translateY(-2px);
}

.farm-card.active-farm {
  border-color: rgba(255, 255, 255, 0.45);
}

.farm-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.farm-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--white);
}

.farm-card-loc {
  font-size: 12px;
  color: var(--muted);
}

.farm-token-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--bg-040404);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11.5px;
}

.farm-token-box span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.farm-metrics-grid {
  display: grid;
  grid-template-columns: 1.14fr 0.86fr;
  gap: 8px;
  padding: 10px;
  background: var(--bg-040404);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.farm-metric-cell {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  padding: 9px 11px;
  background: var(--bg-080808);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  min-height: 74px;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}

.farm-metric-cell:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--bg-0c0c0c);
}

.farm-metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.farm-metric-header label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin: 0;
}

.farm-metric-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.farm-metric-main strong {
  font-size: 15px;
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
}

.farm-metric-tag {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.status-pill-mini {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  border: 1px solid transparent;
  line-height: 1.3;
}

.status-pill-mini.ok {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
  color: #4ade80;
}

.status-pill-mini.warn {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.28);
  color: #facc15;
}

.farm-metric-cell small {
  font-size: 10.5px;
  color: var(--text-secondary);
  line-height: 1.25;
}

.farm-card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}

.farm-card-foot .btn-primary {
  flex: 1;
  justify-content: center;
  font-weight: 700;
}

/* Gráfico Consolidado & Status das Máquinas na aba Início */
.inicio-sections-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.inicio-draggable-section {
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.inicio-draggable-section.dragging {
  opacity: 0.45;
  border-style: dashed;
}

.inicio-draggable-section.drag-over-above {
  border-top: 2px solid var(--white) !important;
  transform: translateY(2px);
}

.inicio-draggable-section.drag-over-below {
  border-bottom: 2px solid var(--white) !important;
  transform: translateY(-2px);
}

.section-drag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 14px;
  background: var(--bg-050505);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  user-select: none;
}

.section-drag-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.drag-grip {
  font-size: 14px;
  color: var(--muted);
  cursor: grab;
  padding: 2px 4px;
  transition: color 0.15s ease;
}

.drag-grip:hover {
  color: var(--white);
}

.section-drag-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-sec-reorder {
  background: #111111;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-sec-reorder:hover {
  background: #1c1c1c;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}

/* KPI Draggable Cards */
.kpi-draggable {
  cursor: grab;
  transition: transform 0.15s ease, border-color 0.2s ease, opacity 0.2s ease;
  user-select: none;
}

.kpi-draggable:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.kpi-draggable.kpi-dragging {
  opacity: 0.45;
  border-style: dashed;
}

.kpi-draggable.kpi-drag-over {
  border-color: var(--white);
  transform: scale(1.02);
}

/* Card de Rendimento Consolidado */
.farms-rendimento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.rendimento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 960px) {
  .rendimento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.rend-stat-box {
  background: var(--bg-040404);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rend-stat-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.rend-stat-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}

.rend-stat-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.farms-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 0;
}

.farms-status-breakdown-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 0;
}

.status-breakdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.status-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.status-summary-box {
  background: var(--bg-040404);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.status-summary-box:hover {
  transform: translateY(-2px);
}

.status-summary-box.ok {
  border-left: 3px solid var(--status-ok);
}

.status-summary-box.warn {
  border-left: 3px solid var(--status-warn);
}

.status-summary-box.crit {
  border-left: 3px solid var(--status-crit);
}

.status-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-box-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator-dot.dot-ok {
  background: var(--status-ok);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.status-indicator-dot.dot-warn {
  background: var(--status-warn);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.status-indicator-dot.dot-crit {
  background: var(--status-crit);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.status-box-val {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--white);
}

.status-box-val small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.status-box-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.status-machines-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-machine-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-080808);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.status-machine-item:hover {
  background: #121212;
  border-color: var(--border-strong);
  transform: translateX(3px);
}

.status-machine-item.warn:hover {
  border-color: rgba(234, 179, 8, 0.45);
}

.status-machine-item.crit:hover {
  border-color: rgba(239, 68, 68, 0.45);
}

.status-machine-item .m-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--white);
}

.status-machine-item .m-farm {
  font-size: 11px;
  color: var(--text-secondary);
  background: #141414;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.status-machine-item .m-reason {
  font-size: 11px;
  font-family: var(--font-mono);
}

.status-machine-item.warn .m-reason {
  color: var(--status-warn);
}

.status-machine-item.crit .m-reason {
  color: var(--status-crit);
}

.status-machine-item .m-arrow {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.15s ease, color 0.15s ease;
}

.status-machine-item:hover .m-arrow {
  color: var(--white);
  transform: translateX(2px);
}

.farm-hashboards-count {
  margin-top: 4px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Estilos de Refrigeração: Rotação das Fans e Modo Imersão */
.immersion-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #22d3ee;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.immersion-icon {
  font-size: 11px;
}

.fans-rpm-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}

.fan-rpm-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  font-size: 11px;
  line-height: 1.3;
}

/* ---- Links Locais para Interface Web da ASIC ---- */
.miner-local-link {
  transition: color 0.15s ease, opacity 0.15s ease;
}
.miner-local-link:hover {
  color: var(--accent) !important;
  text-decoration: underline !important;
}
.miner-local-link:hover strong {
  color: var(--accent) !important;
}
.miner-ip-link {
  transition: color 0.15s ease, opacity 0.15s ease;
}
.miner-ip-link:hover {
  color: var(--accent) !important;
  text-decoration: underline !important;
}

/* Responsividade */
@media (max-width: 1100px) {
  .lm-kpis { grid-template-columns: repeat(2, 1fr); }
  .lm-charts, .pricing-card { grid-template-columns: 1fr; }
  .bento-grid, .metrics-strip, .flow-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .header { grid-template-columns: 1fr; gap: 12px; }
  .bento-grid, .metrics-strip, .flow-grid { grid-template-columns: 1fr; }
}

/* ===== TEMAS (Tema 1 = padrão acima; sem data-theme) ===== */
html[data-theme="dark"] {
  --bg-020202: #000000;
  --bg-030303: #000000;
  --bg-040404: #000000;
  --bg-050505: #000000;
  --bg-060606: #000000;
  --bg-070709: #000000;
  --bg-080808: #040506;
  --bg-09090b: #040506;
  --bg-0c0c0c: #040506;
  --bg-0d0d0d: #040506;
  --bg-0e0e0e: #040506;
  --bg-0f0f0f: #07090b;
  --bg: #000000; --surface: #040506; --surface-elevated: #07090b; --surface-hover: #0b0e11; --field: #020303;
  --border: rgba(255,255,255,0.05); --border-strong: rgba(255,255,255,0.10); --border-hover: rgba(255,255,255,0.17);
  --text: #a3a9b1; --text-secondary: #737a84; --muted: #4c525a; --dim: #2e3238;
  --white: #a3a9b1; --accent: #8a929d; --accent-dark: #000000;
  --hb-fill: #5f6773; --hash-color: #a3a9b1;
  --status-ok: #17795a; --status-ok-bg: rgba(23,121,90,0.12);
  --status-warn: #a8721a; --status-warn-bg: rgba(168,114,26,0.12);
  --status-crit: #a33a3a; --status-crit-bg: rgba(163,58,58,0.12); --btc-gold: #a8721a;
}
html[data-theme="color"] {
  --bg-020202: #0d1430;
  --bg-030303: #0d1430;
  --bg-040404: #0d1430;
  --bg-050505: #0d1430;
  --bg-060606: #0d1430;
  --bg-070709: #0d1430;
  --bg-080808: #151d45;
  --bg-09090b: #151d45;
  --bg-0c0c0c: #151d45;
  --bg-0d0d0d: #151d45;
  --bg-0e0e0e: #151d45;
  --bg-0f0f0f: #1e2860;
  --bg: #0a1030; --surface: #151d45; --surface-elevated: #1e2860; --surface-hover: #283476; --field: #10173a;
  --border: rgba(120,150,255,0.22); --border-strong: rgba(120,150,255,0.34); --border-hover: rgba(140,170,255,0.5);
  --text: #f3f5ff; --text-secondary: #c2caf5; --muted: #8f9ad6; --dim: #5d68a8;
  --white: #f3f5ff; --accent: #7c8cff; --accent-dark: #0a1030;
  --hb-fill: linear-gradient(90deg, #14d9b0 0%, #3aa0ff 55%, #a66bff 100%);
  --hash-color: #2ee6c0;
  --status-ok: #22d39a; --status-ok-bg: rgba(34,211,154,0.16);
  --status-warn: #ffb53d; --status-warn-bg: rgba(255,181,61,0.16);
  --status-crit: #ff5c7a; --status-crit-bg: rgba(255,92,122,0.16); --btc-gold: #ffb53d;
}
html[data-theme="dark"] [style*="background:#040404"],
html[data-theme="dark"] [style*="background: #040404"],
html[data-theme="dark"] [style*="background:#050505"],
html[data-theme="dark"] [style*="background: #050505"],
html[data-theme="dark"] [style*="background:#080808"],
html[data-theme="dark"] [style*="background: #080808"],
html[data-theme="dark"] [style*="background:#0f0f0f"],
html[data-theme="dark"] [style*="background: #0f0f0f"],
html[data-theme="dark"] [style*="background:#111"],
html[data-theme="dark"] [style*="background: #111"],
html[data-theme="dark"] [style*="background:#111111"],
html[data-theme="dark"] [style*="background: #111111"],
html[data-theme="dark"] [style*="background:#121212"],
html[data-theme="dark"] [style*="background: #121212"],
html[data-theme="dark"] [style*="background:#141414"],
html[data-theme="dark"] [style*="background: #141414"],
html[data-theme="dark"] [style*="background:#0b0f14"],
html[data-theme="dark"] [style*="background: #0b0f14"],
html[data-theme="dark"] [style*="background:#181818"],
html[data-theme="dark"] [style*="background: #181818"],
html[data-theme="dark"] [style*="background:#171717"],
html[data-theme="dark"] [style*="background: #171717"],
html[data-theme="dark"] [style*="background:#0e0e11"],
html[data-theme="dark"] [style*="background: #0e0e11"],
html[data-theme="dark"] [style*="background:#0b0b0b"],
html[data-theme="dark"] [style*="background: #0b0b0b"],
html[data-theme="dark"] [style*="background:#0a0a0a"],
html[data-theme="dark"] [style*="background: #0a0a0a"] { background-color: var(--surface) !important; }
html[data-theme="color"] [style*="background:#040404"],
html[data-theme="color"] [style*="background: #040404"],
html[data-theme="color"] [style*="background:#050505"],
html[data-theme="color"] [style*="background: #050505"],
html[data-theme="color"] [style*="background:#080808"],
html[data-theme="color"] [style*="background: #080808"],
html[data-theme="color"] [style*="background:#0f0f0f"],
html[data-theme="color"] [style*="background: #0f0f0f"],
html[data-theme="color"] [style*="background:#111"],
html[data-theme="color"] [style*="background: #111"],
html[data-theme="color"] [style*="background:#111111"],
html[data-theme="color"] [style*="background: #111111"],
html[data-theme="color"] [style*="background:#121212"],
html[data-theme="color"] [style*="background: #121212"],
html[data-theme="color"] [style*="background:#141414"],
html[data-theme="color"] [style*="background: #141414"],
html[data-theme="color"] [style*="background:#0b0f14"],
html[data-theme="color"] [style*="background: #0b0f14"],
html[data-theme="color"] [style*="background:#181818"],
html[data-theme="color"] [style*="background: #181818"],
html[data-theme="color"] [style*="background:#171717"],
html[data-theme="color"] [style*="background: #171717"],
html[data-theme="color"] [style*="background:#0e0e11"],
html[data-theme="color"] [style*="background: #0e0e11"],
html[data-theme="color"] [style*="background:#0b0b0b"],
html[data-theme="color"] [style*="background: #0b0b0b"],
html[data-theme="color"] [style*="background:#0a0a0a"],
html[data-theme="color"] [style*="background: #0a0a0a"] { background-color: var(--field) !important; }
html[data-theme="dark"] .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-dark); }
html[data-theme="dark"] .btn-primary:hover { filter: brightness(1.1); background: var(--accent); border-color: var(--accent); color: var(--accent-dark); }
html[data-theme="dark"] body, html[data-theme="dark"] html { background: var(--bg); }
html[data-theme="color"] .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-dark); }
html[data-theme="color"] .btn-primary:hover { filter: brightness(1.1); background: var(--accent); border-color: var(--accent); color: var(--accent-dark); }
html[data-theme="color"] body, html[data-theme="color"] html { background: var(--bg); }

/* Dark: tira o brilho de branco escrito direto nos templates */
html[data-theme="dark"] [style*="color:#fff"], html[data-theme="dark"] [style*="color: #fff"] { color: var(--text) !important; }
html[data-theme="color"] .hb-track { background: rgba(120,150,255,0.16); }
html[data-theme="color"] .hb-fill.warn { background: var(--status-warn); }
html[data-theme="color"] .hb-fill.bad { background: var(--status-crit); }
html[data-theme="color"] .lm-kpi { border-color: rgba(140,160,255,0.18); }
.hash-val { color: var(--hash-color); }

/* Seletor de tema (bolinha) */
.theme-picker { position: relative; display: inline-flex; align-items: center; margin-left: 8px; }
.theme-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); padding: 0; cursor: pointer; flex: none; transition: transform .12s, border-color .12s; }
.theme-dot:hover { transform: scale(1.12); border-color: var(--border-hover); }
.theme-dot[data-t="default"] { background: linear-gradient(135deg, #ffffff 0 50%, #000000 50% 100%); }
.theme-dot[data-t="dark"] { background: radial-gradient(circle at 35% 35%, #3a3f46, #050607 70%); }
.theme-dot[data-t="color"] { background: conic-gradient(#14d9b0, #3aa0ff, #a66bff, #ff5c7a, #ffb53d, #14d9b0); }
.theme-menu { position: absolute; top: calc(100% + 8px); right: -6px; display: flex; gap: 8px; padding: 8px; background: var(--surface-elevated); border: 1px solid var(--border-strong); border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.45); z-index: 1000; }
.theme-menu[hidden] { display: none; }


/* Fazenda compartilhada por e-mail: restrições por nível de acesso */
body[data-farm-access="view"] #btn-open-add,
body[data-farm-access="view"] #btn-monitor-refresh,
body[data-farm-access="view"] #btn-monitor-refresh-mobile,
body[data-farm-access="view"] #btn-open-watchdog,
body[data-farm-access="view"] #btn-open-pool-multi,
body[data-farm-access="view"] #btn-open-fw-update,
body[data-farm-access="view"] #btn-open-share,
body[data-farm-access="view"] #btn-open-farm-hashid,
body[data-farm-access="view"] #badge-farm-hashid,
body[data-farm-access="view"] #lm-bulk-bar,
body[data-farm-access="view"] #wd-dashboard-panel,
body[data-farm-access="full"] #btn-open-share,
body[data-farm-access="full"] #btn-open-farm-hashid,
body[data-farm-access="full"] #badge-farm-hashid { display: none !important; }

/* Cards de download do Hub: os 4 lado a lado (2x2 em telas médias, 1 coluna no celular) */
.bento-grid.hub-cards-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.bento-grid.hub-cards-row > .bento-card { grid-column: auto !important; grid-row: auto !important; padding: 18px; min-width: 0; }
.bento-grid.hub-cards-row pre, .bento-grid.hub-cards-row code { white-space: pre-wrap; word-break: break-all; }
@media (max-width: 1200px) { .bento-grid.hub-cards-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .bento-grid.hub-cards-row { grid-template-columns: 1fr; } }

/* ===== Tutorial "Instale em seu celular" (aba Hub Local) ===== */
.hub-install-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hub-install-grid > .bento-card { grid-column: auto !important; grid-row: auto !important; }
.install-steps { margin: 0; padding-left: 20px; display: grid; gap: 9px; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }
.install-steps b { color: var(--text); }
.install-ico { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 13px; color: var(--text); vertical-align: middle; }
.install-tip { margin-top: 14px; padding: 9px 12px; border: 1px dashed var(--border-strong); border-radius: 8px; font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .hub-install-grid { grid-template-columns: 1fr; } }

/* ===== iPhone / celular: tela cheia (PWA), área segura, toque e tipografia ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior-y: none; }
body { -webkit-tap-highlight-color: transparent; }
@media (max-width: 820px) {
  :root { --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); }
  body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); padding-bottom: var(--safe-bottom); }
  .header { top: 0; padding: calc(var(--safe-top) + 8px) 14px 8px; gap: 8px; }
  .view-container { padding: 18px 14px calc(60px + var(--safe-bottom)); }
  /* campos com 16px evitam o zoom automático do iOS ao tocar */
  input, select, textarea, .form-input { font-size: 16px !important; }
  button, .btn, .pill-btn { min-height: 38px; }
  .modal-box { width: 100% !important; max-width: 100% !important; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-backdrop { align-items: flex-end !important; }
  h1 { font-size: 24px !important; }
  table { font-size: 12.5px; }
}

@media (max-width: 820px) {
  /* menu principal em uma linha só, deslizando para o lado */
  .main-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 2px; margin: 0 -14px; padding: 0 14px; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav button { flex: 0 0 auto; padding: 8px 13px; }
  .header-right { flex-wrap: wrap; gap: 8px; }
  /* cartões de indicadores: 2 por linha sem estourar a largura */
  .lm-kpis, .farms-global-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .lm-kpi { padding: 12px; min-width: 0; }
  .lm-kpi-label { display: flex; flex-wrap: wrap; gap: 4px 6px; justify-content: space-between; font-size: 10px; }
  .lm-kpi-label .status-badge { font-size: 9.5px; padding: 1px 6px; }
  .lm-kpi-val { font-size: 22px; }
  .lm-charts { grid-template-columns: minmax(0, 1fr); }
  .lm-chart-card { padding: 12px; }
  .lm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .lm-toolbar { flex-wrap: wrap; gap: 8px; }
  .lm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bento-grid.hub-cards-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  /* tabela de máquinas enxuta no celular: nome, hashrate, temperatura e ações */
  .lm-table .c-model, .lm-table .c-boards, .lm-table .c-fans, .lm-table .c-power, .lm-table .c-up { display: none; }
  .lm-chart-card { min-height: 0; }
  .lm-chart-card svg, .lm-chart-card canvas { max-height: 150px; }
}

@media (max-width: 820px) {
  .lm-table { min-width: 0; }
  .lm-table td, .lm-table th { padding-left: 8px; padding-right: 8px; }
  .lm-table td .mono { word-break: break-all; }
}
@media (max-width: 820px) { .lm-table td:last-child .btn { padding: 6px 10px; } }


/* ==========================================================================
   CELULAR (iPhone / Android, navegador ou app na tela inicial) — PATCH-007 item 78
   ========================================================================== */
/* toque: sem atraso de 300 ms / zoom de duplo toque em botões e links */
a, button, .btn, .pill-btn, select, label, input[type="checkbox"], [role="button"] { touch-action: manipulation; }
html.is-touch .drag-grip { display: none; }
html.is-touch [draggable="false"] { -webkit-user-drag: none; }

@media (max-width: 820px) {
  /* ---------- cabeçalho compacto (2 linhas): marca + conta | menu ---------- */
  .header {
    position: relative; top: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand right" "nav nav";
    row-gap: 6px; column-gap: 8px;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 6px;
  }
  .header .brand { grid-area: brand; min-width: 0; }
  .header .brand-logo { width: 26px; height: 26px; }
  .header .brand-text { font-size: 14px; }
  .header .main-nav { grid-area: nav; margin: 0 -12px; padding: 0 12px; }
  .header .main-nav button { padding: 7px 12px; font-size: 13px; min-height: 34px; }
  .header-right { grid-area: right; flex-wrap: nowrap !important; gap: 6px; min-width: 0; justify-content: flex-end; }
  .user-pill { padding: 3px 4px 3px 8px; gap: 6px; min-width: 0; max-width: 46vw; }
  .user-pill #header-user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 11px !important; }
  .user-pill #btn-logout { min-height: 26px; padding: 2px 8px !important; flex: 0 0 auto; }
  .lang-select { min-height: 32px; padding: 2px 22px 2px 8px; font-size: 12px !important; max-width: 74px; }
  .header-right select.lang-select { font-size: 16px !important; transform: scale(0.8); transform-origin: right center; margin-left: -12px; }
  .theme-picker { flex: 0 0 auto; }
  .theme-dot { min-height: 0 !important; width: 26px; height: 26px; }
  .theme-menu { right: 0; left: auto; }

  /* ---------- conteúdo: nada passa da largura da tela ---------- */
  .view-container { padding: 14px 12px calc(56px + env(safe-area-inset-bottom, 0px)); }
  .view-container * { min-width: 0; }
  .view-container img, .view-container svg, .view-container canvas, .view-container video { max-width: 100%; }
  .view-container pre, .view-container code { white-space: pre-wrap; word-break: break-all; }
  .view-container input:not([type="checkbox"]):not([type="radio"]), .view-container select, .view-container textarea { max-width: 100%; }
  /* grades e linhas montadas com estilo direto no HTML: viram uma coluna só */
  .view-container [style*="grid-template-columns"]:not(.keep-cols) { grid-template-columns: minmax(0, 1fr) !important; }
  .view-container [style*="display:flex"]:not(.keep-row), .view-container [style*="display: flex"]:not(.keep-row) { flex-wrap: wrap; }
  .view-container .card, .view-container [class*="-card"]:not(.farm-card-head):not(.lm-chart-card) { padding-left: 14px; padding-right: 14px; }

  /* ---------- Início: cabeçalhos das seções (sem arrastar/Subir/Descer no celular) ---------- */
  .section-drag-header { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .section-drag-title { flex-direction: column; align-items: flex-start; gap: 2px; }
  .section-drag-title .eyebrow { font-size: 10px; letter-spacing: 0.12em; }
  .section-drag-title .section-name { font-size: 14px; }
  .btn-sec-reorder, .drag-grip { display: none !important; }
  .section-drag-controls { width: 100%; justify-content: flex-start; }
  .section-drag-controls .lm-filter-pills { margin: 0 !important; flex-wrap: nowrap; }
  .section-drag-controls .pill-btn { min-height: 32px; padding: 4px 12px; white-space: nowrap; }
  .farms-toolbar { flex-direction: column; align-items: stretch; gap: 6px; }
  .farms-search-wrap { width: 100%; }
  .farms-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .rendimento-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .rend-stat-box { padding: 12px; }
  .inicio-draggable-section { padding: 12px; }
  .inicio-draggable-section > .section-drag-header { margin-bottom: 10px; }

  /* ---------- Monitor: barra de ações desliza para o lado, sem ocupar 4 linhas ---------- */
  .lm-header { gap: 10px; }
  .lm-actions {
    flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    justify-content: flex-start !important; margin: 0 -12px !important; padding: 2px 12px 4px; width: calc(100% + 24px);
  }
  .lm-actions::-webkit-scrollbar { display: none; }
  .lm-actions .btn { flex: 0 0 auto; }
  .lm-filter-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .lm-filter-pills::-webkit-scrollbar { display: none; }

  /* ---------- Monitor: cada máquina vira um cartão (2 linhas) ---------- */
  .lm-table-wrap { overflow-x: visible !important; }
  .lm-table, .lm-table tbody { display: block; width: 100%; min-width: 0 !important; }
  .lm-table thead { display: none; }
  .lm-table tbody tr {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    grid-template-areas: "chk name name act" "chk hash temp act";
    align-items: center; column-gap: 10px; row-gap: 4px;
    padding: 10px 10px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  }
  .lm-table tbody tr td { display: block; padding: 0 !important; border: 0 !important; background: transparent; }
  .lm-table td.c-chk { grid-area: chk; }
  .lm-table td.c-name { grid-area: name; overflow: hidden; }
  .lm-table td.c-hash { grid-area: hash; }
  .lm-table td.c-temp { grid-area: temp; text-align: right; }
  .lm-table td.c-act { grid-area: act; align-self: center; }
  .lm-table td.c-model, .lm-table td.c-boards, .lm-table td.c-fans, .lm-table td.c-power, .lm-table td.c-up { display: none !important; }
  .lm-table .c-name-row { flex-wrap: nowrap !important; gap: 6px !important; }
  .lm-table .c-name-row strong { font-size: 15px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 40vw; }
  .lm-table .c-name-row .star-btn { display: none; }
  .lm-table td.c-name .mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal !important; }
  .lm-table .c-mac { display: none; }
  .lm-table td.c-hash .hash-val { font-size: 14px !important; }
  .lm-table td.c-hash > div:last-child { font-size: 10.5px !important; }
  .lm-table td.c-act .btn { min-height: 34px; padding: 0 12px; }
  /* item 175: ações empilhadas no celular (Detalhes, Acesso Remoto, Reboot) */
  .lm-table td.c-act { display: flex !important; flex-direction: column; align-items: stretch; gap: 6px; text-align: center !important; }
  .lm-table td.c-act .btn { justify-content: center; white-space: nowrap; }
  .lm-table td.c-act .act-reboot-mobile { display: inline-flex !important; align-items: center; }
  .lm-table input[type="checkbox"] { width: 20px; height: 20px; }

  /* ---------- formulários e cartões gerais ---------- */
  .form-row, .form-grid, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr) !important; }
  .hub-install-grid, .bento-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .modal-box { padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px)) !important; overflow-x: hidden; }
  .modal-box [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .modal-box table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 380px) {
  .rendimento-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .lm-kpis, .farms-global-kpis { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 820px) {
  .header .brand-text { display: none; }
  .user-pill { max-width: 52vw; }
  .header-right select.lang-select { transform: none; margin-left: 0; font-size: 13px !important; max-width: 68px; min-height: 32px; padding: 2px 18px 2px 8px; }
  .lm-filter-pills .pill-btn, .lm-toolbar .pill-btn { white-space: nowrap; flex: 0 0 auto; }
  .lm-toolbar select, .lm-toolbar input[type="search"], .lm-toolbar input[type="text"] { width: 100%; flex: 1 1 100%; }
  .lm-toolbar > * { max-width: 100%; }
}
@media (max-width: 820px) {
  .header-right select.lang-select { max-width: 82px; padding-right: 22px; }
  .view-container select, .modal-box select { min-height: 44px; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
}
@media (max-width: 820px) {
  /* janelas (modais) como "folha" presa na base da tela, largura total */
  .modal-backdrop { padding: 0 !important; place-items: end stretch !important; align-items: end !important; }
  .modal-box { width: 100% !important; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px) !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .modal-box * { min-width: 0; }
  .modal-box [style*="display:flex"]:not(.keep-row):not(.modal-head):not(.modal-header),
  .modal-box [style*="display: flex"]:not(.keep-row):not(.modal-head):not(.modal-header) { flex-wrap: wrap; }
  .modal-box input:not([type="checkbox"]):not([type="radio"]), .modal-box select, .modal-box textarea { max-width: 100%; }
  .modal-box pre, .modal-box code { white-space: pre-wrap; word-break: break-all; }
  .modal-box .modal-head, .modal-box .modal-header { flex-wrap: nowrap !important; }
}
@media (max-width: 820px) {
  .header-right select.lang-select { max-width: none; width: auto; padding-right: 26px; }
  .lm-toolbar [class*="search"] { flex: 1 1 100%; width: 100%; }
}

/* ===== VNish com build não autorizada: telemetria ofuscada (PATCH-007 item 79) ===== */
.lm-table td.c-lock { padding: 6px 10px; }
.vnish-lock { position: relative; min-height: 46px; border-radius: 10px; overflow: hidden; }
.vnish-lock-blur { display: flex; gap: 28px; align-items: center; padding: 12px 14px; font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); filter: blur(5px); opacity: .55; user-select: none; pointer-events: none; white-space: nowrap; }
.vnish-lock-msg { position: absolute; inset: 0; display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: linear-gradient(90deg, rgba(10,10,10,.55), rgba(10,10,10,.85)); border: 1px dashed var(--border-strong); border-radius: 10px; font-size: 12.5px; color: var(--text-secondary); }
.vnish-lock-msg b { color: var(--text); }
.vnish-lock-msg > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.vnish-lock-msg .btn { flex: 0 0 auto; white-space: nowrap; }
.vnish-lock-icon { font-size: 15px; flex: 0 0 auto; }
.lm-table tr.row-locked td.c-name strong { color: var(--text-secondary); }
.miner-card-locked .vnish-lock { margin-top: 10px; }
@media (max-width: 820px) {
  .lm-table tbody tr.row-locked { grid-template-areas: "chk name name name" "chk lock lock lock"; }
  .lm-table td.c-lock { grid-area: lock; display: block !important; padding: 0 !important; }
  .vnish-lock { min-height: 0; }
  .vnish-lock-blur { display: none; }
  .vnish-lock-msg { position: static; flex-wrap: wrap; padding: 10px; }
  .vnish-lock-msg .btn { width: 100%; }
}
.vnish-lock-msg .mono { word-break: normal !important; white-space: nowrap; }
@media (max-width: 820px) { .vnish-lock-icon { display: none; } .vnish-lock-msg { font-size: 12.5px; } }

/* ===== Painel Admin no celular: cada conta vira um cartão sem sobreposição (PATCH-007 item 83) ===== */
@media (max-width: 820px) {
  .admin-users-table, .admin-users-table tbody { display: block; width: 100%; min-width: 0 !important; }
  .admin-users-table thead { display: none; }
  .admin-users-table tbody tr.au-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "user status" "email email" "role asics" "date date" "act act";
    align-items: center; column-gap: 10px; row-gap: 8px;
    padding: 12px; margin: 0 0 10px; border: 1px solid var(--border) !important; border-radius: 12px; background: var(--surface);
  }
  .admin-users-table tbody tr.au-row td { display: block; padding: 0 !important; border: 0 !important; background: transparent; text-align: left !important; min-width: 0; }
  .admin-users-table td.au-user { grid-area: user; }
  .admin-users-table td.au-user strong { overflow-wrap: anywhere; }
  .admin-users-table td.au-status { grid-area: status; text-align: right !important; }
  .admin-users-table td.au-email { grid-area: email; overflow-wrap: anywhere; word-break: break-all; }
  .admin-users-table td.au-role { grid-area: role; }
  .admin-users-table td.au-asics { grid-area: asics; text-align: right !important; }
  .admin-users-table td.au-date { grid-area: date; }
  .admin-users-table td.au-date::before { content: "Cadastro: "; }
  .admin-users-table td.au-actions { grid-area: act; padding-top: 8px !important; border-top: 1px solid var(--border) !important; }
  .admin-users-table .au-btns { display: flex !important; flex-wrap: wrap; gap: 6px; width: 100%; }
  .admin-users-table .au-btns .btn { flex: 1 1 calc(50% - 6px); min-height: 38px; white-space: nowrap; }
  .admin-users-table .table-responsive, .table-responsive:has(.admin-users-table) { overflow-x: visible !important; }
}

/* ===== Watchdog > Proteção Térmica: limite por modelo (PATCH-007 item 84) ===== */
.wd-thermal-section { margin: 14px 0 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #09090b; }
.wd-thermal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wd-thermal-sub { margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.4; }
#wd-thermal-body { margin-top: 12px; display: grid; gap: 8px; }
.wd-thermal-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 110px; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.wd-thermal-model { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wd-thermal-model strong { font-size: 13px; overflow-wrap: anywhere; }
.wd-thermal-model span { font-size: 11px; color: var(--muted); }
.wd-thermal-input { display: inline-flex; align-items: center; gap: 6px; }
.wd-thermal-input input { width: 84px; padding: 6px 8px; text-align: center; }
.wd-thermal-state { justify-self: end; white-space: nowrap; font-size: 11px; }
.wd-thermal-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.wd-thermal-feedback { font-size: 12px; font-family: var(--font-mono); }
.wd-thermal-empty { font-size: 12.5px; color: var(--muted); padding: 6px 2px; }
@media (max-width: 820px) {
  .wd-thermal-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "model input" "state state"; }
  .wd-thermal-row .wd-thermal-model { grid-area: model; }
  .wd-thermal-row .wd-thermal-input { grid-area: input; }
  .wd-thermal-row .wd-thermal-state { grid-area: state; justify-self: start; }
}

/* ===== Admin > Fazendas da conta no celular (PATCH-007 item 85) ===== */
@media (max-width: 820px) {
  .adm-farm-table { min-width: 560px; }
}


/* ===== Item 129: card de fazenda minimalista ===== */
.farm-card.fc2 { padding: 22px 22px 18px; gap: 18px; border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-elevated), var(--surface)); }
.farm-card.fc2:hover { transform: translateY(-2px); border-color: var(--border-hover); }
.fc2-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fc2-id { min-width: 0; }
.fc2-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc2-loc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.fc2-pill { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-secondary); }
.fc2-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.fc2-pill.fc2-ok { color: var(--status-ok); background: var(--status-ok-bg); border-color: transparent; }
.fc2-pill.fc2-ok i { background: var(--status-ok); box-shadow: 0 0 0 3px var(--status-ok-bg); }
.fc2-pill.fc2-warn { color: var(--status-warn); background: var(--status-warn-bg); border-color: transparent; }
.fc2-pill.fc2-warn i { background: var(--status-warn); }
.fc2-pill.fc2-off { color: var(--status-crit); background: var(--status-crit-bg); border-color: transparent; }
.fc2-pill.fc2-off i { background: var(--status-crit); }
.fc2-label { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }
.fc2-hero { display: flex; flex-direction: column; gap: 4px; }
.fc2-big { font-family: var(--font-mono); font-size: 34px; font-weight: 600; line-height: 1.05;
  letter-spacing: -0.03em; color: var(--text); }
.fc2-big span { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.fc2-boards { display: flex; flex-direction: column; gap: 7px; }
.fc2-row { display: flex; justify-content: space-between; align-items: baseline; }
.fc2-mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.fc2-bar { height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; }
.fc2-bar i { display: block; height: 100%; border-radius: inherit; background: var(--status-ok); transition: width .4s ease; }
.fc2-bar.fc2-warn i { background: var(--status-warn); }
.fc2-bar.fc2-off i { background: var(--status-crit); }
.fc2-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); padding-top: 16px; }
.fc2-stat { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; min-width: 0; }
.fc2-stat:first-child { padding-left: 0; }
.fc2-stat + .fc2-stat { border-left: 1px solid var(--border); }
.fc2-stat strong { font-family: var(--font-mono); font-size: 17px; font-weight: 600; color: var(--text); }
.fc2-stat strong em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.fc2-stat small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc2-stat small b { font-weight: 600; }
.fc2-t-ok { color: var(--status-ok); } .fc2-t-warn { color: var(--status-warn); } .fc2-t-off { color: var(--status-crit); }
.fc2-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 2px; }
.fc2-foot .btn-primary { flex: 1; justify-content: center; }
.fc2-v { font-family: var(--font-mono); font-size: 10px; color: var(--dim); margin-left: 4px; }
.fc2-title { color: var(--text); }
.fc2-foot .btn-primary { border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.fc2-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); border-radius: 10px;
  padding: 9px 12px; font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s; }
.fc2-ghost:hover { border-color: var(--border-hover); color: var(--text); }
.fc2-icon { width: 38px; padding: 9px 0; text-align: center; }
.fc2-shared { font-size: 11px; color: var(--muted); }
@media (max-width: 420px) { .fc2-big { font-size: 30px; } .fc2-stat { padding: 0 8px; } }


/* ===== Item 130: faixa de resumo do Início ===== */
.farms-global-kpis.fk2 { gap: 1px !important; background: var(--border); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; }
.fk2 > .lm-kpi { border: 0; border-radius: 0; padding: 20px 22px; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, var(--surface-elevated), var(--surface)); }
.fk2 > .lm-kpi:hover { background: var(--surface-elevated); }
.fk2 > .kpi-draggable.kpi-drag-over { transform: none; box-shadow: inset 0 0 0 1px var(--border-hover); }
.fk2-label { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }
.fk2-tag { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-secondary); }
.fk2-val { font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1;
  color: var(--text); white-space: nowrap; }
.fk2-val small { font-size: 12px !important; font-weight: 500; color: var(--muted) !important; letter-spacing: 0; margin-left: 4px; }
.fk2-green { color: var(--status-ok); }
.fk2-sub { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fk2-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--status-ok); flex-shrink: 0; }
.fk2-bar { height: 3px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 2px 0 1px; }
.fk2-bar i { display: block; height: 100%; width: 0; background: var(--status-ok); border-radius: inherit; transition: width .4s ease; }
@media (max-width: 1100px) { .fk2 > .lm-kpi:last-child { grid-column: 1 / -1; } }
@media (max-width: 420px) { .fk2-val { font-size: 22px; } .fk2 > .lm-kpi { padding: 16px; } }


/* ===== Item 130: aba Monitor ===== */
#view-monitor { --mon-card: linear-gradient(180deg, var(--surface-elevated), var(--surface)); }
#view-monitor .lm-header { border-bottom: 0; padding-bottom: 6px; margin-bottom: 18px; align-items: flex-end; }
#view-monitor .btn-farm-quick-switch { background: transparent; border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 10px 4px 9px; font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--muted); font-family: var(--font-sans); }
#view-monitor .btn-farm-quick-switch:hover { border-color: var(--border-hover); color: var(--text); }
#view-monitor .btn-farm-quick-switch .switch-badge { background: transparent; border: 0; color: var(--text-secondary); padding: 0; }
#view-monitor .interactive-farm-title { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; }
#view-monitor #badge-farm-hashid { background: var(--status-ok-bg) !important; border: 0 !important; color: var(--status-ok) !important;
  border-radius: 999px !important; padding: 4px 11px !important; font-size: 11px; }
#view-monitor .lm-actions { gap: 6px; }
#view-monitor .lm-actions .btn { background: transparent !important; border: 1px solid var(--border) !important; color: var(--text-secondary) !important;
  border-radius: 10px; height: 34px; padding: 0 12px; font-size: 12px; font-weight: 600 !important; }
#view-monitor .lm-actions .btn:hover { border-color: var(--border-hover) !important; color: var(--text) !important; }

.lm-kpis.fk2 { gap: 1px !important; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-bottom: 14px; }
.lm-kpis.fk2 .fk2-sub b { font-weight: 600; }
.lm-kpis.fk2 .fk2-sub { gap: 10px; }

#view-monitor .lm-charts { gap: 14px; margin-bottom: 14px; }
#view-monitor .lm-chart-card { background: var(--mon-card); border-radius: 16px; padding: 18px 20px 12px; }
#view-monitor .lm-chart-head h3 { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
#view-monitor .lm-chart-head strong { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }

#view-monitor .lm-toolbar { background: transparent; border: 0; padding: 4px 0; margin-bottom: 10px; }
#view-monitor .lm-filter-pills { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
#view-monitor .pill-btn { border: 0; background: transparent; border-radius: 9px; padding: 6px 12px; color: var(--muted); }
#view-monitor .pill-btn.active { background: var(--surface-hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
#view-monitor .lm-search, #view-monitor .lm-select { border-radius: 12px !important; background: var(--surface) !important; border-color: var(--border) !important; }

@media (min-width: 821px) {
  #view-monitor .lm-table-wrap { background: var(--mon-card); border: 1px solid var(--border); border-radius: 16px; }
  #view-monitor .lm-table { border-spacing: 0; }
  #view-monitor .lm-table thead th { padding: 14px 12px 12px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); }
  #view-monitor .lm-table tbody tr { background: transparent; }
  #view-monitor .lm-table tbody tr:hover { background: rgba(255,255,255,0.025); }
  #view-monitor .lm-table td { border-top: 0; border-bottom: 1px solid var(--border); padding: 13px 12px; }
  #view-monitor .lm-table tbody tr:last-child td { border-bottom: 0; }
  #view-monitor .lm-table td:first-child, #view-monitor .lm-table td:last-child { border-left: 0; border-right: 0; border-radius: 0; }
}
#view-monitor .lm-table .status-badge-sm { background: transparent; border: 0; padding: 0; font-size: 10px; letter-spacing: 0.04em; }
#view-monitor .lm-table .status-badge-sm::before { content: "●"; margin-right: 4px; }
#view-monitor .hb-track { height: 4px; background: var(--border); }
#view-monitor .hb-fill { background: var(--status-ok); }
#view-monitor .hb-fill.warn { background: var(--status-warn); }
#view-monitor .hb-fill.bad { background: var(--status-crit); }
#view-monitor .lm-table td:last-child .btn, #view-monitor .miner-card .btn { border-radius: 10px; }

#view-monitor .miner-card { background: var(--mon-card); border-radius: 16px; }
#view-monitor .miner-card:hover { border-color: var(--border-hover); }

#view-monitor .events-console { background: var(--mon-card); border-radius: 16px; }
#view-monitor .events-head { background: transparent; padding: 14px 18px; font-weight: 600; }
#view-monitor .events-list { padding: 12px 18px 16px; gap: 7px; }

#view-monitor .fans-rpm-stack { display: flex; flex-direction: column; gap: 1px; }
#view-monitor .miner-card strong, #view-monitor .miner-card .mono, #view-monitor .miner-card .status-badge { white-space: nowrap; }
.fk2-tag.fc2-t-ok { color: var(--status-ok); } .fk2-tag.fc2-t-warn { color: var(--status-warn); }
#view-monitor .events-head > div > span:first-child { text-transform: none; letter-spacing: 0; font-size: 13px; }
@media (max-width: 820px) {
  #view-monitor .lm-table tbody tr { background: var(--mon-card); border-radius: 14px; }
  #view-monitor .interactive-farm-title { font-size: 24px; }
  #view-monitor .lm-filter-pills { overflow-x: auto; }
}

/* Item 130: imersão e arraste das fazendas */
#view-monitor .immersion-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: rgba(56, 189, 248, 0.10); color: #38bdf8; border: 0; font-size: 11px; font-weight: 600; }
#view-monitor .immersion-pill::before { content: "≋"; font-size: 13px; line-height: 1; }
.farm-card.fc2[draggable="true"] { cursor: grab; }
.farm-card.fc2.fc2-dragging { opacity: .45; }
.farm-card.fc2.fc2-drop { border-color: var(--text-secondary); box-shadow: 0 0 0 1px var(--text-secondary); }


/* ===== Item 132: páginas Hub Local, Conta e Suporte ===== */
.pg-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.pg-wrap.pg-wide { max-width: 1400px; }
.pg-head { margin-bottom: 6px; }
.pg-head h1 { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; margin: 4px 0 6px; }
.pg-head h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; margin: 4px 0 6px; }
.pg-head p { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 0; max-width: 820px; }
.pg-head-sm { margin: 18px 0 4px; }
.pg-eyebrow { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
.pg-card { background: linear-gradient(180deg, var(--surface-elevated), var(--surface)); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px; }
.pg-card h3 { font-size: 16px; font-weight: 650; margin: 2px 0 6px; }
.pg-card h4 { font-size: 16px; font-weight: 650; margin: 10px 0 6px; }
.pg-card p { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin: 0 0 12px; }
.pg-small { color: var(--muted) !important; font-size: 11.5px !important; line-height: 1.5; margin: 0 !important; }
.pg-label, .pg-field label { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em;
  text-transform: none; margin: 0 0 6px; }
.pg-field { margin: 0 !important; }
.pg-input { border-radius: 10px !important; background: var(--field) !important; border: 1px solid var(--border) !important;
  font-size: 13.5px; padding: 10px 12px; width: 100%; color: var(--text); }
.pg-input:focus { border-color: var(--border-hover) !important; outline: none; }
textarea.pg-input { resize: vertical; min-height: 120px; }
.pg-btn { border-radius: 10px !important; font-weight: 600 !important; padding: 10px 16px; white-space: nowrap; }
.pg-ghost { background: transparent !important; border: 1px solid var(--border) !important; color: var(--text-secondary) !important; }
.pg-ghost:hover { border-color: var(--border-hover) !important; color: var(--text) !important; }
.pg-btn-danger { background: var(--status-crit-bg) !important; border: 1px solid transparent !important; color: var(--status-crit) !important; }
.pg-btn-danger:hover { border-color: var(--status-crit) !important; }
.pg-full { width: 100%; display: flex; justify-content: center; text-decoration: none; }
.pg-inline { display: flex; gap: 8px; }
.pg-inline .pg-input { flex: 1; font-weight: 600; }
.pg-actions { display: flex; justify-content: flex-end; }
.pg-form { display: grid; gap: 14px; }
.pg-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pg-row-cat { grid-template-columns: 1.4fr 1fr; }
.pg-feedback { padding: 10px 14px; border-radius: 10px; font-size: 12.5px; margin-bottom: 12px; }
.pg-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-hover); border: 1px solid var(--border-strong); font-size: 12px; font-weight: 600; color: var(--text); flex-shrink: 0; }

/* Hub Local */
.pg-step { display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; align-items: start; }
.pg-step-text { display: flex; gap: 14px; }
.pg-step-form { display: grid; gap: 6px; }
.pg-step-form .pg-label + * { margin-bottom: 8px; }
.pg-section-title { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.pg-section-title h3 { font-size: 16px; font-weight: 650; margin: 0; }
.pg-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pg-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pg-plat { display: flex; flex-direction: column; }
.pg-plat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pg-chip { font-size: 10.5px; font-weight: 600; color: var(--status-ok); background: var(--status-ok-bg); border-radius: 999px; padding: 3px 9px; }
.pg-ver { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.pg-steps { margin: 0 0 14px; padding-left: 18px; font-size: 12px; line-height: 1.65; color: var(--text-secondary); }
.pg-steps li { padding-left: 2px; }
.pg-steps code, .pg-card p code { font-size: 11px; }
.pg-code { font-family: var(--font-mono); font-size: 11px; color: var(--status-ok); background: var(--field); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; word-break: break-all; user-select: all; margin-bottom: 10px; }
.pg-plat-foot { margin-top: auto; padding-top: 14px; display: grid; gap: 8px; text-align: center; }
.pg-plat-foot small { color: var(--muted); font-size: 11px; }
.pg-tip { margin-top: 4px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }
.pg-mobile { display: flex; flex-direction: column; gap: 12px; }

/* Conta */
.pg-profile { display: grid; grid-template-columns: auto 1fr auto; gap: 14px 16px; align-items: center; }
.pg-avatar { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface-hover); border: 1px solid var(--border-strong); color: var(--text-secondary); }
.pg-profile-id strong { font-size: 16px; font-weight: 650; }
.pg-profile-id div { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pg-profile-stat { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 16px; display: grid; gap: 4px; }
.pg-stat-val { font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.pg-split { display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
.pg-split-text h3 { margin-top: 4px; }
.pg-data-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pg-data-row:first-of-type { padding-top: 0; }
.pg-data-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pg-data-row strong { font-size: 13.5px; font-weight: 600; }
.pg-danger strong { color: var(--status-crit); }

/* Suporte */
.pg-list-head { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.pg-list-head h3 { font-size: 16px; font-weight: 650; margin: 0; }
.pg-tickets { display: grid; gap: 10px; }
.pg-tickets > div { border-radius: 16px !important; text-align: center; padding: 26px !important; }
.pg-tickets .tk-card { background: linear-gradient(180deg, var(--surface-elevated), var(--surface)) !important; border-radius: 14px !important; padding: 14px 16px !important; }

@media (max-width: 1200px) { .pg-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .pg-step, .pg-split, .pg-grid2 { grid-template-columns: 1fr; gap: 16px; }
  .pg-row2, .pg-row-cat { grid-template-columns: 1fr; }
  .pg-head h1 { font-size: 26px; }
}
@media (max-width: 640px) {
  .pg-grid4 { grid-template-columns: 1fr; }
  .pg-inline { flex-direction: column; }
  .pg-profile { grid-template-columns: auto 1fr; }
  .pg-profile #acc-user-badge { grid-column: 1 / -1; justify-self: start; }
  .pg-data-row { flex-direction: column; align-items: flex-start; }
}


/* ===== Item 132: janelas (scan, pool, firmware, receita, compartilhar, detalhes) ===== */
#modal-root .modal-backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(14px); }
#modal-root .modal-box { background: linear-gradient(180deg, var(--surface-elevated), var(--surface)) !important;
  border: 1px solid var(--border-strong) !important; border-radius: 20px !important; padding: 26px 28px !important;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); }
#modal-root .modal-head { border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 18px !important; }
#modal-root .modal-head h3 { font-size: 19px !important; font-weight: 650; letter-spacing: -0.01em; margin-top: 2px !important; }
#modal-root .eyebrow { text-transform: none !important; letter-spacing: 0.02em !important; font-size: 11px !important;
  font-weight: 500 !important; color: var(--muted) !important; }
#modal-root .modal-close { border-radius: 10px; width: 34px; height: 34px; font-size: 16px; }
#modal-root .form-input, #modal-root .lm-select, #modal-root input[type="text"], #modal-root input[type="number"],
#modal-root input[type="email"], #modal-root select, #modal-root textarea {
  border-radius: 10px !important; background: var(--field) !important; border: 1px solid var(--border) !important; color: var(--text); }
#modal-root .form-input:focus, #modal-root input:focus, #modal-root select:focus { border-color: var(--border-hover) !important; outline: none; }
#modal-root input[type="checkbox"], #modal-root input[type="radio"], #wd-dashboard-panel input[type="checkbox"] { accent-color: var(--status-ok); }
#modal-root .btn { border-radius: 10px !important; font-weight: 600 !important; }
#modal-root .btn:not(.btn-primary):not([style*="color:#"]):not([style*="color: #"]) { background: transparent; border-color: var(--border); }
#modal-root label { text-transform: none; letter-spacing: 0.01em; }
#modal-root .form-field label { font-size: 11.5px !important; font-weight: 500 !important; color: var(--muted) !important; }
/* caixas internas com estilo próprio: mesmo raio e superfície */
#modal-root .modal-box div[style*="border:1px solid"], #modal-root .modal-box div[style*="border: 1px solid"] {
  border-radius: 14px !important; border-color: var(--border) !important; }
#modal-root .modal-box div[style*="background:#0"], #modal-root .modal-box div[style*="background: #0"],
#modal-root .modal-box div[style*="background:var(--bg-0"], #modal-root .modal-box div[style*="background: var(--bg-0"],
#modal-root .modal-box div[style*="background:rgba(255,255,255,0.0"], #modal-root .modal-box div[style*="background: rgba(255,255,255,0.0"] {
  background: var(--field) !important; }
#modal-root .lm-kpi { background: var(--field) !important; border: 1px solid var(--border) !important; border-radius: 14px !important; }
#modal-root .lm-kpi-label { text-transform: none; letter-spacing: 0.02em; font-weight: 500; font-size: 11px; }
#modal-root .sc-table th, #modal-root .fw-table th { text-transform: none !important; letter-spacing: 0.02em !important;
  font-weight: 500 !important; font-size: 11px !important; background: transparent !important; }
#modal-root .sc-table td, #modal-root .fw-table td { border-bottom-color: var(--border) !important; }
#modal-root .status-badge { border-radius: 999px; }
#modal-root details > summary { cursor: pointer; }

/* Detalhes da máquina */
#modal-root .det-rename-box { background: var(--field) !important; border: 1px solid var(--border) !important; border-radius: 14px !important; }
#modal-root .modal-box [style*="text-transform:uppercase"], #modal-root .modal-box [style*="text-transform: uppercase"] {
  text-transform: none !important; letter-spacing: 0.02em !important; }
#modal-root .pill-btn, #modal-root .det-tab-btn { border-radius: 10px !important; }

/* Painel do Watchdog (abre dentro do Monitor) */
#wd-dashboard-panel { background: linear-gradient(180deg, var(--surface-elevated), var(--surface)) !important;
  border: 1px solid var(--border) !important; border-radius: 16px !important; padding: 20px 22px !important; }
#wd-dashboard-panel .wd-simple-head { border-bottom-color: var(--border); padding-bottom: 14px; }
#wd-dashboard-panel .wd-simple-title { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 650; }
#wd-dashboard-panel .wd-simple-icon { border-radius: 10px; width: 34px; height: 34px; background: var(--status-ok-bg); border: 0; color: var(--status-ok); }
#wd-dashboard-panel .status-badge { border-radius: 999px; }
#wd-dashboard-panel .wd-simple-field label { text-transform: none; letter-spacing: 0.02em; font-family: var(--font-sans); font-size: 11.5px; font-weight: 500; color: var(--muted); }
#wd-dashboard-panel .wd-simple-input-wrap { border-radius: 10px; background: var(--field); border-color: var(--border); }
#wd-dashboard-panel .wd-scope-control-bar { background: var(--field) !important; border: 1px solid var(--border) !important; border-radius: 12px !important; padding: 10px 14px !important; }
#wd-dashboard-panel .wd-scope-control-bar > div > div > span:first-child { text-transform: none !important; font-family: var(--font-sans) !important; letter-spacing: 0.02em !important; font-weight: 500 !important; }
#wd-dashboard-panel .wd-scope-control-bar div[style*="inline-flex"] { background: var(--surface) !important; border-color: var(--border) !important; border-radius: 10px !important; padding: 3px !important; }
#wd-dashboard-panel .wd-scope-control-bar button { border-radius: 8px !important; }
#wd-dashboard-panel #btn-wd-apply-all[style*="background:var(--accent"], #wd-dashboard-panel #btn-wd-apply-exceptions[style*="background:var(--accent"] {
  background: var(--surface-hover) !important; color: var(--text) !important; box-shadow: inset 0 0 0 1px var(--border-strong); }
#wd-dashboard-panel .wd-simple-explanation { font-family: var(--font-sans); background: var(--status-ok-bg); border: 0; border-radius: 12px; color: var(--text-secondary); padding: 12px 14px; }
#wd-dashboard-panel .btn { border-radius: 10px !important; }
#wd-dashboard-panel #btn-wd-open-advanced { background: transparent !important; border: 1px solid var(--border) !important; color: var(--text-secondary) !important; border-radius: 10px !important; }
#wd-dashboard-panel div[style*="border:1px solid"], #wd-dashboard-panel div[style*="border: 1px solid"] { border-radius: 14px !important; border-color: var(--border) !important; }


/* ===== Item 132: seções do Início ===== */
.inicio-sections-container { gap: 18px; }
.inicio-draggable-section.farms-rendimento-card, .inicio-draggable-section.farms-chart-card, .inicio-draggable-section.farms-status-breakdown-card {
  background: linear-gradient(180deg, var(--surface-elevated), var(--surface)) !important; border: 1px solid var(--border) !important;
  border-radius: 16px !important; padding: 20px 22px !important; box-shadow: none !important; }
.section-drag-header { background: transparent; border: 0; padding: 0; margin-bottom: 16px; }
.section-drag-title { gap: 10px; align-items: baseline; }
.section-drag-title .eyebrow { text-transform: none; letter-spacing: 0.02em; font-size: 11px; font-weight: 500; color: var(--muted); }
.section-name { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.drag-grip { color: var(--dim); font-size: 13px; }
.btn-sec-reorder { background: transparent; border: 1px solid var(--border); border-radius: 8px; font-family: var(--font-sans); font-size: 11px; padding: 4px 9px; color: var(--muted); }
.btn-sec-reorder:hover { color: var(--text); border-color: var(--border-hover); }
#rendimento-currency-pills { background: var(--field); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
#rendimento-currency-pills .pill-btn { border: 0; background: transparent; border-radius: 8px; padding: 5px 11px; color: var(--muted); }
#rendimento-currency-pills .pill-btn.active { background: var(--surface-hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* Rendimento: painel único com divisórias finas */
.rendimento-grid { gap: 1px !important; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.rend-stat-box { background: var(--surface) !important; border: 0 !important; border-radius: 0 !important; padding: 18px 20px !important; display: flex; flex-direction: column; gap: 6px; }
.rend-stat-lbl { text-transform: none !important; letter-spacing: 0.02em !important; font-size: 11px !important; font-weight: 500 !important; color: var(--muted) !important; }
.rend-stat-val { font-size: 22px !important; font-weight: 600 !important; letter-spacing: -0.02em; }
.rend-stat-sub { font-size: 11.5px !important; color: var(--muted) !important; }

/* Gráfico global */
.farms-chart-card .lm-chart-head { align-items: flex-end; margin-top: 0 !important; }
.hs-live { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--status-ok);
  background: var(--status-ok-bg); border-radius: 999px; padding: 4px 11px; }
.hs-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--status-ok); animation: hsPulse 1.8s ease-in-out infinite; }
@keyframes hsPulse { 50% { opacity: .35; } }
#farms-hr-current { font-size: 24px !important; font-weight: 600; letter-spacing: -0.02em; }

/* Status das máquinas */
.status-breakdown-grid { gap: 1px !important; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-top: 0 !important; }
.status-summary-box { background: var(--surface) !important; border: 0 !important; border-radius: 0 !important; padding: 18px 20px !important; box-shadow: none !important; transform: none !important; }
.status-summary-box:hover { background: var(--surface-elevated) !important; }
.status-box-header { gap: 8px; }
.status-box-title { text-transform: none !important; letter-spacing: 0 !important; font-size: 13.5px !important; font-weight: 600 !important; text-align: left !important; flex: 1; }
.status-box-header .status-badge { border-radius: 999px; font-size: 10.5px; }
.status-indicator-dot { width: 8px !important; height: 8px !important; box-shadow: none !important; }
.status-box-val { font-size: 30px !important; font-weight: 600 !important; letter-spacing: -0.03em; margin: 10px 0 4px !important; }
.status-box-val small { font-size: 12px !important; color: var(--muted) !important; font-weight: 500; }
.status-box-desc { font-size: 12px !important; color: var(--muted) !important; line-height: 1.5; }
.status-machines-list { display: grid; gap: 6px; }
.status-machine-item { background: var(--field) !important; border: 1px solid var(--border) !important; border-radius: 10px !important; padding: 9px 12px !important; }
.status-machine-item:hover { border-color: var(--border-hover) !important; }
.status-machine-item .m-farm { border-radius: 999px !important; }
.status-machine-item .m-reason { font-family: var(--font-sans) !important; font-size: 11.5px !important; }

/* ===== Item 132: console de telemetria ===== */
#telemetry-console { background: linear-gradient(180deg, var(--surface-elevated), var(--surface)) !important; border: 1px solid var(--border) !important; border-radius: 16px !important; }
#telemetry-console .events-head { background: transparent !important; padding: 16px 20px !important; border-bottom: 1px solid var(--border); }
#telemetry-console .events-head > div { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#telemetry-console .events-head > div > span:first-child { font-size: 15px !important; font-weight: 650 !important; text-transform: none !important; letter-spacing: -0.01em !important; }
#telemetry-console .console-tabs { background: var(--field) !important; border: 1px solid var(--border) !important; border-radius: 10px !important; padding: 3px !important; gap: 2px !important; }
#telemetry-console .console-tab-btn { border: 0 !important; border-radius: 8px !important; padding: 5px 11px !important; font-size: 11.5px !important; color: var(--muted) !important; background: transparent !important; }
#telemetry-console .console-tab-btn.active { background: var(--surface-hover) !important; color: var(--text) !important; box-shadow: inset 0 0 0 1px var(--border-strong); }
#telemetry-console #events-heartbeat-label { font-family: var(--font-sans) !important; font-size: 11.5px !important; color: var(--muted) !important; }
#telemetry-console .events-list { padding: 8px 10px 12px !important; gap: 0 !important; max-height: 260px; font-size: 12px !important; }
#telemetry-console .event-line { display: flex; align-items: baseline; gap: 12px; padding: 7px 10px; border-radius: 8px; }
#telemetry-console .event-line:hover { background: rgba(255,255,255,0.03); }
#telemetry-console .event-line .ts { color: var(--dim) !important; font-size: 11px; flex-shrink: 0; }

.status-machine-item .m-name { white-space: nowrap; font-family: var(--font-sans) !important; font-weight: 600; }
.status-machine-item .m-farm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; padding: 2px 8px !important; }
.status-machine-item .m-reason { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.status-machine-item > div:first-child { min-width: 0; }


/* ===== Item 132: cabeçalho ===== */
#app-header.header { position: sticky; top: 0; z-index: 60; gap: 24px; padding: 12px max(3vw, 20px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px); border-bottom: 1px solid var(--border); }
#app-header .brand-logo { color: var(--text); }
#app-header .main-nav { justify-self: start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: nowrap; }
#app-header .main-nav button { border: 0; border-radius: 9px; padding: 7px 14px; font-size: 12.5px; color: var(--muted); }
#app-header .main-nav button:hover { color: var(--text); background: rgba(255,255,255,0.04); border-color: transparent; }
#app-header .main-nav button.active { background: var(--surface-hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); font-weight: 600; }
#app-header .header-right { gap: 8px; }
#app-header .user-pill { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 12px !important; padding: 4px 4px 4px 12px !important; gap: 10px !important; max-width: 340px; }
#app-header #header-user-email { font-family: var(--font-sans) !important; font-size: 12px !important; color: var(--text-secondary) !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
#app-header #btn-logout { background: transparent !important; border: 1px solid var(--border) !important; border-radius: 8px !important; padding: 4px 10px !important; color: var(--muted) !important; }
#app-header #btn-logout:hover { color: var(--status-crit) !important; border-color: var(--status-crit) !important; }
#app-header .lang-select { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; height: 34px; padding: 0 28px 0 12px; font-size: 12px; color: var(--text-secondary); }
#app-header .theme-dot#theme-current { width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--border-strong); }
#app-header .theme-menu { border-radius: 14px; }

/* Título do Início */
.farms-header-bar { align-items: flex-end; margin-bottom: 22px; }
.farms-header-bar .eyebrow { text-transform: none; letter-spacing: 0.02em; font-size: 11px; font-weight: 500; color: var(--muted); }
.farms-main-title { font-size: 30px !important; font-weight: 650 !important; letter-spacing: -0.02em; }
.farms-main-sub { font-size: 13.5px !important; color: var(--muted) !important; }
#btn-reorder-reset { background: transparent !important; border: 1px solid var(--border) !important; border-radius: 10px !important; color: var(--muted) !important; height: 36px; }
#btn-reorder-reset:hover { color: var(--text) !important; border-color: var(--border-hover) !important; }
#btn-open-new-farm { border-radius: 10px !important; height: 36px; font-weight: 600 !important; }
@media (max-width: 1100px) { #app-header .main-nav { justify-self: stretch; overflow-x: auto; } }
/* item 176: no celular o #app-header.header (item 132) vencia o cabeçalho compacto e tirava a margem da barra de status do iOS */
@media (max-width: 820px) {
  #app-header.header { padding: calc(max(env(safe-area-inset-top, 0px), 0px) + 8px) 12px 6px; row-gap: 6px; column-gap: 8px; }
  html.is-standalone #app-header.header { padding-top: calc(max(env(safe-area-inset-top, 0px), 44px) + 8px); }
}

/* ===== Item 132: temas novos ===== */
html[data-theme="forest"] {
  --bg-020202: #06100c; --bg-030303: #06100c; --bg-040404: #06100c; --bg-050505: #06100c; --bg-060606: #06100c; --bg-070709: #06100c;
  --bg-080808: #0b1913; --bg-09090b: #0b1913; --bg-0c0c0c: #0b1913; --bg-0d0d0d: #0b1913; --bg-0e0e0e: #0b1913; --bg-0f0f0f: #10231b;
  --bg: #050d0a; --surface: #0b1913; --surface-elevated: #10231b; --surface-hover: #163026; --field: #07120e;
  --border: rgba(110, 231, 183, 0.12); --border-strong: rgba(110, 231, 183, 0.22); --border-hover: rgba(110, 231, 183, 0.38);
  --text: #e8f5ee; --text-secondary: #a9c8b8; --muted: #6f9483; --dim: #3e5c4f;
  --white: #e8f5ee; --accent: #34d399; --accent-dark: #050d0a;
  --hb-fill: #34d399; --hash-color: #6ee7b7;
  --status-ok: #34d399; --status-ok-bg: rgba(52,211,153,0.14);
  --status-warn: #fbbf24; --status-warn-bg: rgba(251,191,36,0.14);
  --status-crit: #f87171; --status-crit-bg: rgba(248,113,113,0.14); --btc-gold: #fbbf24;
}
html[data-theme="sunset"] {
  --bg-020202: #120a06; --bg-030303: #120a06; --bg-040404: #120a06; --bg-050505: #120a06; --bg-060606: #120a06; --bg-070709: #120a06;
  --bg-080808: #1c120c; --bg-09090b: #1c120c; --bg-0c0c0c: #1c120c; --bg-0d0d0d: #1c120c; --bg-0e0e0e: #1c120c; --bg-0f0f0f: #261810;
  --bg: #0f0805; --surface: #1c120c; --surface-elevated: #261810; --surface-hover: #331f14; --field: #140c08;
  --border: rgba(251, 146, 60, 0.13); --border-strong: rgba(251, 146, 60, 0.24); --border-hover: rgba(251, 146, 60, 0.42);
  --text: #fbefe6; --text-secondary: #d9bba6; --muted: #a07f69; --dim: #6a4f3f;
  --white: #fbefe6; --accent: #fb923c; --accent-dark: #0f0805;
  --hb-fill: linear-gradient(90deg, #f59e0b 0%, #fb923c 60%, #f43f5e 100%); --hash-color: #fdba74;
  --status-ok: #4ade80; --status-ok-bg: rgba(74,222,128,0.14);
  --status-warn: #fbbf24; --status-warn-bg: rgba(251,191,36,0.15);
  --status-crit: #fb7185; --status-crit-bg: rgba(251,113,133,0.15); --btc-gold: #f7931a;
}
html[data-theme="forest"] .main-nav button.active, html[data-theme="sunset"] .main-nav button.active { color: var(--text); }
.theme-dot[data-t="forest"] { background: linear-gradient(135deg, #34d399 0 50%, #0b1913 50% 100%); }
.theme-dot[data-t="sunset"] { background: linear-gradient(135deg, #fb923c 0%, #f43f5e 50%, #1c120c 50% 100%); }


/* ===== Item 132: janelas reformuladas (mx-*) ===== */
.mx-box { padding: 24px 26px !important; }
.mx-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.mx-head-id h3 { font-size: 22px !important; font-weight: 650; letter-spacing: -0.02em; margin: 6px 0 4px !important; }
.mx-head-sub { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.mx-head-sub a { color: var(--text-secondary); text-decoration: none; }
.mx-head-sub a:hover { color: var(--text); text-decoration: underline; }
.mx-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.mx-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mx-pill.mx-ok { color: var(--status-ok); background: var(--status-ok-bg); }
.mx-pill.mx-warn { color: var(--status-warn); background: var(--status-warn-bg); }
.mx-pill.mx-off { color: var(--status-crit); background: var(--status-crit-bg); }
.mx-bar { display: flex !important; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px !important; margin-bottom: 14px; }
.mx-title-row { display: flex; align-items: center; gap: 8px; }
.mx-title-row h3 { margin: 6px 0 4px !important; }
.mx-pencil { width: 30px; height: 30px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin-top: 2px; }
.mx-pencil:hover { color: var(--text); border-color: var(--border); background: var(--surface-hover); }
.mx-rename-inline { display: flex; align-items: center; gap: 8px; margin: 6px 0 6px; }
.mx-rename-inline[hidden] { display: none; }
.mx-rename-inline input { width: 260px; font-size: 18px !important; font-weight: 600; padding: 6px 10px; }
.mx-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mx-rename, .mx-cool { display: flex; align-items: center; gap: 8px; }
.mx-rename label { font-size: 11.5px; color: var(--muted); }
.mx-rename input { width: 180px; padding: 7px 10px; font-size: 13px; font-weight: 600; }
.mx-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-hover); color: var(--text-secondary); white-space: nowrap; }
.mx-chip-ok { background: var(--status-ok-bg); color: var(--status-ok); }
.mx-chip-blue { background: rgba(56,189,248,0.12); color: #38bdf8; }
.mx-ghost { background: transparent !important; border: 1px solid var(--border) !important; color: var(--text-secondary) !important; text-decoration: none; }
.mx-ghost:hover { border-color: var(--border-hover) !important; color: var(--text) !important; }
.mx-ghost.mx-warn { color: var(--status-warn) !important; }
.mx-ghost.mx-danger { color: var(--status-crit) !important; }
.mx-seg { display: inline-flex !important; gap: 2px !important; background: var(--field); border: 1px solid var(--border); border-radius: 12px; padding: 3px; margin-bottom: 16px; flex-wrap: wrap; }
.mx-seg .pill-btn { border: 0 !important; background: transparent !important; border-radius: 9px !important; padding: 6px 14px !important; color: var(--muted) !important; font-size: 12.5px !important; font-weight: 600 !important; }
.mx-seg .pill-btn.active { background: var(--surface-hover) !important; color: var(--text) !important; box-shadow: inset 0 0 0 1px var(--border-strong); }
.mx-count { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.mx-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.mx-kpis > div { background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.mx-kpis span { font-size: 11px; color: var(--muted); }
.mx-kpis b { font-family: var(--font-mono); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.mx-kpis b small { font-size: 11px; color: var(--muted); margin-left: 4px; font-weight: 500; }
.mx-kpis em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.mx-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 10px; flex-wrap: wrap; }
.mx-sec-head h4 { margin: 0; font-size: 14px; font-weight: 650; }
.mx-list { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.mx-row { display: grid; grid-template-columns: 1.3fr 1.2fr auto 1fr; align-items: center; gap: 16px; background: var(--surface); padding: 12px 16px; }
.mx-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mx-row-main strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-row-main small { font-size: 11px; color: var(--muted); }
.mx-row-val { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.mx-row-val b { font-size: 15px; color: var(--text); font-weight: 600; }
.mx-row-meta { font-size: 11.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.mx-pool { grid-template-columns: auto 1fr auto; }
.mx-pool .mx-row-main strong { font-size: 12.5px; font-weight: 500; }
.mx-prio { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-hover); border: 1px solid var(--border-strong); font-size: 11.5px; font-weight: 600; flex-shrink: 0; }
.mx-empty { background: var(--surface); padding: 14px 16px; color: var(--muted); font-size: 12.5px; }
.mx-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border-top: 1px solid var(--border); padding-top: 16px; }
.mx-act-group { display: flex; flex-direction: column; gap: 8px; }
.mx-act-group > span { font-size: 11px; color: var(--muted); }
.mx-act-group > div { display: flex; flex-wrap: wrap; gap: 8px; }
.mx-act-group .btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 12.5px; }
#det-op-feedback { grid-column: 1 / -1; }
.mx-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.mx-foot-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.mx-muted, .mx-ro { font-size: 12px; color: var(--muted); }
.mx-label { font-size: 11px; color: var(--muted); }
.mx-hint { font-size: 12px; color: var(--muted); background: var(--field); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.mx-chip-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mx-chip-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.mx-chip-stats .status-badge { border-radius: 999px; }
.mx-panel { background: var(--field); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; }
.mx-panel-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mx-panel-bar .form-input { margin-left: auto; max-width: 260px; height: 34px; }
.mx-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; }
.mx-check .lm-select { margin-left: 4px; }
.mx-preset { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mx-preset .form-input { height: 34px; max-width: 200px; }
.mx-poolstack { display: grid; gap: 10px; margin-bottom: 16px; }
.mx-poolcard { background: var(--field); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.mx-poolcard:first-child { border-color: var(--border-strong); }
.mx-poolcard-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.mx-poolcard-head strong { font-size: 13.5px; }
.mx-poolcard-head small { font-size: 11.5px; color: var(--muted); }
.mx-poolgrid { display: grid; grid-template-columns: 1.6fr 1fr 0.6fr; gap: 10px; }
.mx-poolgrid .form-field { margin: 0; }
.mx-options { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mx-preview { padding: 12px 14px; display: grid; gap: 8px; }
.mx-preview #pool-worker-preview { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.mx-fw-empty { border: 1px dashed var(--border-strong); border-radius: 12px; margin-bottom: 16px; font-size: 12px; }
.mx-callout { font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); background: var(--status-warn-bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.mx-callout b { color: var(--status-warn); }
.mx-fw-bar { border: 1px solid var(--border); border-bottom: 0; border-radius: 14px 14px 0 0; background: var(--field); }
.mx-fw-table { border-radius: 0 0 14px 14px !important; margin-bottom: 0; }
#modal-root .fw-pack { border-radius: 10px !important; background: var(--field) !important; }
#modal-root .fw-danger { border-radius: 10px !important; }
#modal-root .fw-sel { border-radius: 10px !important; background: var(--field) !important; }
@media (max-width: 760px) {
  .mx-kpis { grid-template-columns: 1fr 1fr; }
  .mx-kpis .mx-kpi-up { grid-column: 1 / -1; }  /* item 228: uptime ocupa a linha inteira no celular */
  .mx-row { grid-template-columns: 1fr auto; }
  .mx-row-bar, .mx-row-meta { grid-column: 1 / -1; text-align: left; }
  .mx-pool { grid-template-columns: auto 1fr; }
  .mx-pool .mx-chip { grid-column: 2; justify-self: start; }
  .mx-actions { grid-template-columns: 1fr; }
  .mx-poolgrid { grid-template-columns: 1fr; }
}

/* Watchdog reformulado */
.wdx .wd-simple-card { gap: 16px; }
.wdx-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.wdx-title { display: flex; align-items: center; gap: 12px; }
.wdx-title .wd-simple-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.wdx-head-actions { display: flex; align-items: center; gap: 10px; }
.wdx-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.wdx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.wdx-field { background: var(--field); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.wdx-field label { font-size: 12px; font-weight: 600; color: var(--text); }
.wdx-field small { font-size: 11px; color: var(--muted); }
.wdx-field .wd-simple-input-wrap { background: var(--surface) !important; }
.wdx-scope { display: grid !important; gap: 10px !important; }
.wdx-scope-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wdx-label { font-size: 12px; font-weight: 600; }
.wdx-muted { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.wdx-seg { display: inline-flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.wdx-seg button { background: transparent !important; color: var(--muted) !important; border: 0 !important; border-radius: 8px !important; padding: 5px 12px !important; font-size: 12px !important; font-weight: 600 !important; }
.wdx-seg button[style*="#000000"], .wdx-seg button[style*="rgb(0, 0, 0)"] { background: var(--surface-hover) !important; color: var(--text) !important; box-shadow: inset 0 0 0 1px var(--border-strong); }
.wdx .wd-simple-explanation strong { color: var(--text); }
.wdx-thermal { border-radius: 14px !important; }
.wdx-foot { display: flex !important; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
@media (max-width: 760px) { .wdx-grid { grid-template-columns: 1fr; } .wdx-muted { margin-left: 0; } }


/* ===== Item 132: revisão geral ===== */
/* Login */
#view-login .login-intro-title { font-size: 38px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
#view-login .login-intro-desc { font-size: 15px; color: var(--muted); line-height: 1.6; }
#view-login .login-feat-item { background: transparent; border: 0; border-left: 2px solid var(--border-strong); border-radius: 0; padding: 4px 0 4px 16px; }
#view-login .login-feat-icon { display: none; }
#view-login .login-feat-item strong { font-size: 14px; font-weight: 600; }
#view-login .login-feat-item p { color: var(--muted); font-size: 12.5px; }
#view-login .login-card { background: linear-gradient(180deg, var(--surface-elevated), var(--surface)) !important; border: 1px solid var(--border) !important; border-radius: 20px !important; padding: 30px !important; }
#view-login .auth-tabs { background: var(--field) !important; border-radius: 12px !important; padding: 3px !important; gap: 2px !important; }
#view-login .auth-tab-btn { border-radius: 9px !important; font-weight: 600 !important; }
#view-login .auth-tab-btn[style*="#ffffff"], #view-login .auth-tab-btn[style*="rgb(255, 255, 255)"] { background: var(--surface-hover) !important; color: var(--text) !important; box-shadow: inset 0 0 0 1px var(--border-strong); }
#view-login .eyebrow { text-transform: none; letter-spacing: 0.02em; font-size: 11px; font-weight: 500; color: var(--muted); }
#view-login .login-head h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
#view-login label { text-transform: none !important; letter-spacing: 0.01em !important; font-size: 12px !important; font-weight: 500 !important; color: var(--muted) !important; }
#view-login .form-input { border-radius: 10px !important; background: var(--field) !important; }
#view-login .btn-primary { border-radius: 10px !important; }

/* Admin */
#view-admin .eyebrow { text-transform: none; letter-spacing: 0.02em; font-size: 11px; font-weight: 500; color: var(--muted) !important; }
#view-admin .farms-global-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; gap: 1px !important; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
#view-admin .farms-global-kpis .lm-kpi { border: 0; border-radius: 0; background: linear-gradient(180deg, var(--surface-elevated), var(--surface)); padding: 18px 20px; }
#view-admin .lm-kpi-label { text-transform: none; letter-spacing: 0.02em; font-weight: 500; }
#view-admin .lm-kpi-label .status-badge { border-radius: 999px; }
#view-admin > div > div[style*="border"], #view-admin .admin-card, #view-admin section > div > div[style*="background"] { border-radius: 16px !important; }
#view-admin div[style*="border:1px solid"], #view-admin div[style*="border: 1px solid"] { border-color: var(--border) !important; border-radius: 16px !important; }
#view-admin table th { text-transform: none !important; letter-spacing: 0.02em !important; font-size: 11px !important; font-weight: 500 !important; color: var(--muted) !important; }
#view-admin h2, #view-admin h3 { text-transform: none !important; letter-spacing: -0.01em !important; }
#view-admin label { text-transform: none !important; letter-spacing: 0.01em !important; font-size: 11.5px !important; font-weight: 500 !important; color: var(--muted) !important; }
#view-admin .form-input, #view-admin select, #view-admin input { border-radius: 10px !important; }
#view-admin .btn { border-radius: 10px !important; }

/* Barra de ações em lote: flutuante embaixo */
#lm-bulk-bar:not([hidden]) { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; width: min(1100px, calc(100vw - 32px));
  background: color-mix(in srgb, var(--surface-elevated) 92%, transparent) !important; backdrop-filter: blur(16px); border: 1px solid var(--border-strong) !important;
  border-radius: 16px !important; padding: 10px 14px !important; box-shadow: 0 18px 50px rgba(0,0,0,0.6); margin: 0 !important; }
#lm-bulk-bar .btn { border-radius: 10px !important; background: transparent; border-color: var(--border); }
#lm-bulk-bar .btn-primary { background: var(--white); }

/* Troca rápida de fazenda */
.farm-quick-dropdown { background: var(--surface-elevated) !important; border-radius: 16px !important; box-shadow: 0 24px 60px rgba(0,0,0,0.6) !important; }
.dropdown-header { background: transparent !important; text-transform: none; letter-spacing: 0.02em !important; font-weight: 500 !important; font-size: 11px !important; }
.dropdown-farm-item { border-radius: 10px; margin: 2px 6px; }
.dropdown-footer { background: transparent !important; }
.dropdown-footer .btn { border-radius: 10px !important; }

/* Botões de ação do Monitor (sem emojis) */
#view-monitor #btn-open-watchdog .live-dot { margin-right: 6px !important; }

/* Conta · Preferências */
.pg-prefs { display: grid; }
.pg-pref { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pg-pref:first-child { padding-top: 0; }
.pg-pref:last-child { border-bottom: 0; padding-bottom: 0; }
.pg-pref strong { font-size: 13.5px; font-weight: 600; }
.pg-pref-col { flex-wrap: wrap; }
.pg-unit { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pg-unit input { width: 110px; }
.pg-unit span { font-size: 12px; color: var(--muted); }
.pg-select { width: 170px !important; flex-shrink: 0; }
.pg-seg { display: inline-flex; gap: 2px; background: var(--field); border: 1px solid var(--border); border-radius: 10px; padding: 3px; flex-shrink: 0; }
.pg-seg button { border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pg-seg button.active { background: var(--surface-hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.pg-themes { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-themes button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--field); color: var(--text-secondary); border-radius: 10px; padding: 6px 12px 6px 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pg-themes button:hover { border-color: var(--border-hover); }
.pg-themes button.active { border-color: var(--text-secondary); color: var(--text); }
.pg-themes .theme-dot { width: 18px; height: 18px; pointer-events: none; }
.pg-saved { color: var(--status-ok); font-weight: 600; margin-left: 6px; }
@media (max-width: 640px) { .pg-pref { flex-direction: column; align-items: flex-start; } }

/* item 175: Reboot na lista só aparece no celular */
.lm-table .act-reboot-mobile { display: none; }

/* item 177: situação real do Watchdog (vem do servidor) */
.wd-live-status { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.5;
  background: rgba(34, 197, 94, 0.08); color: var(--status-ok); border: 1px solid rgba(34, 197, 94, 0.25); }
.wd-live-status.warn { background: rgba(245, 158, 11, 0.09); color: var(--status-warn); border-color: rgba(245, 158, 11, 0.3); }
.wd-live-status.crit { background: rgba(239, 68, 68, 0.09); color: var(--status-crit); border-color: rgba(239, 68, 68, 0.3); }

/* item 181: botão de piscar LED nos detalhes */
.mx-led { display: inline-flex; align-items: center; gap: 6px; }
.mx-led.on { color: #facc15; border-color: rgba(250, 204, 21, 0.5); box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.25), 0 0 14px rgba(250, 204, 21, 0.35); }
.mx-led.on svg { animation: mxLedBlink 0.8s steps(2, start) infinite; }
@keyframes mxLedBlink { to { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .mx-led.on svg { animation: none; } }

/* ===== Item 198: Monitor compacto no celular (filtros e gráficos recolhidos, quadradinhos das placas) ===== */
.lm-mob-only { display: none; }
@media (max-width: 820px) {
  .lm-mob-only { display: flex; }
  #view-monitor #btn-toggle-charts { display: none; }
  #view-monitor #btn-monitor-refresh { display: none; }   /* item 252: no celular vale o botão fora dos filtros */

  /* barra "Gráficos 24h · Mostrar" e botão "Filtros ▾" */
  .lm-mob-bar { width: 100%; align-items: center; justify-content: space-between; margin: 0 0 8px; padding: 7px 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text-secondary);
    font-family: inherit; font-weight: 600; font-size: 11px; line-height: 1; cursor: pointer; }
  .lm-mob-bar b { font-weight: 600; font-size: 10.5px; color: var(--text); }
  .lm-mob-filter-btn { align-items: center; gap: 6px; align-self: flex-start; padding: 6px 12px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); font-family: inherit; font-weight: 600; font-size: 11px; line-height: 1; cursor: pointer; }
  .lm-mob-filter-btn i { font-style: normal; font-size: 10px; transition: transform .15s; }
  .lm-toolbar.filters-open .lm-mob-filter-btn i { transform: rotate(180deg); }
  .lm-toolbar:not(.filters-open) .lm-controls { display: none !important; }
  .lm-toolbar .lm-controls { flex: 1 1 100%; }

  /* gráficos: lado a lado e menores quando abertos */
  #view-monitor .lm-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #view-monitor .lm-chart-card { padding: 8px; }
  #view-monitor .lm-chart-head h3 { font-size: 9.5px; }
  #view-monitor .lm-chart-head strong { font-size: 11px; }
  #view-monitor .lm-chart-card svg, #view-monitor .lm-chart-card canvas { max-height: 90px; }

  /* indicadores do topo: 4 numa linha só */
  #view-monitor .lm-kpis.fk2 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px; }
  #view-monitor .fk2 > .lm-kpi { padding: 8px 6px; }
  #view-monitor .fk2 > .lm-kpi:last-child { grid-column: 1 / -1; }
  #view-monitor .fk2-label { font-size: 8.5px; letter-spacing: 0; }
  #view-monitor .fk2-val { font-size: 15px; }
  #view-monitor .fk2-val small { font-size: 9px; }
  #view-monitor .fk2-bar, #view-monitor .fk2-sub, #view-monitor .fk2-tag { display: none; }

}


/* ===== Item 205: visualização "Mínima" (lista compacta, uma máquina por linha) ===== */
.sqs { display: inline-flex; gap: 4px; }
.sqs .sq { display: block; width: 9px; height: 9px; border-radius: 2px; background: #10b981; }
.sqs .sq.bad { background: #ef4444; }
.mn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 6px; }
.mn-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--mon-card, var(--surface)); }
.mn-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mn-l1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mn-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; flex: 0 0 auto; }
.mn-st { font-size: 9px; font-weight: 700; letter-spacing: .06em; color: #10b981; }
.mn-warn .mn-dot { background: #f59e0b; } .mn-warn .mn-st { color: #f59e0b; }
.mn-off .mn-dot { background: #ef4444; } .mn-off .mn-st { color: #ef4444; }
.mn-name { color: var(--text); text-decoration: none; font-family: var(--font-mono, monospace); font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mn-name i { font-style: normal; font-size: 10px; color: var(--muted); }
.mn-ip { font-family: var(--font-mono, monospace); font-size: 10px; color: var(--muted); }
.mn-l3 { display: flex; align-items: baseline; gap: 10px; }
.mn-hr { font-family: var(--font-mono, monospace); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.mn-hr small { font-size: 9px; color: var(--muted); font-weight: 400; }
.mn-tp { font-family: var(--font-mono, monospace); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.mn-pw { font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.mn-tp.warn { color: #f59e0b; } .mn-tp.off { color: #ef4444; }
.mn-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mn-b { height: 14px; min-width: 0; padding: 0 6px; border-radius: 4px; border: 1px solid #fff; background: #fff; color: #000;
  font-family: inherit; font-weight: 600; font-size: 8px; line-height: 1; letter-spacing: .02em; cursor: pointer; }
@media (max-width: 820px) {
  .mn-list { grid-template-columns: minmax(0, 1fr); }
  #view-monitor .mn-b { height: 14px !important; min-height: 14px !important; min-width: 0 !important; padding: 0 6px !important; font-size: 8px !important; }
}

/* ===== Item 204: idiomas no canto da tela inicial ===== */
#view-login { position: relative; }
.login-lang { position: absolute; top: 16px; right: max(3vw, 16px); z-index: 5; display: flex; gap: 2px; padding: 3px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.login-lang button { min-width: 36px; height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent;
  color: var(--text-secondary); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.login-lang button:hover { color: var(--text); }
.login-lang button.on { background: var(--text); color: var(--bg, #000); }
@media (max-width: 820px) { .login-lang { top: 10px; right: 10px; } .login-lang button { min-width: 34px; height: 30px; } }

/* ===== Item 206: janela de notificações push ===== */
.push-body { display: flex; flex-direction: column; gap: 12px; }
.push-state { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.push-state b { display: block; font-size: 13.5px; }
.push-state small { color: var(--muted); font-size: 11.5px; }
.push-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.push-state.on { border-color: rgba(16, 185, 129, .45); }
.push-state.on .push-dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.push-evs { display: flex; flex-direction: column; gap: 6px; }
.push-ev { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.push-ev.off { opacity: .5; cursor: default; }
.push-ev input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; }
.push-ev b { display: block; font-size: 13px; }
.push-ev small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.push-foot { display: flex; align-items: center; gap: 12px; }
.push-foot small { color: var(--muted); font-size: 11px; line-height: 1.4; flex: 1; }
.push-foot .btn { flex: 0 0 auto; }
.push-note { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }
.push-note ol { margin: 8px 0; padding-left: 20px; }
.push-note.warn { border-color: rgba(245, 158, 11, .45); color: #f59e0b; }
.push-msg { font-size: 12px; color: var(--text-secondary); padding: 8px 12px; border-radius: 8px; background: var(--surface); }
@media (max-width: 820px) { .push-foot { flex-direction: column; align-items: stretch; } .push-state .btn, .push-foot .btn { min-height: 36px; } }

/* ===== Item 213: verificação em duas etapas (Conta) ===== */
.tfa-state { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; }
.tfa-state > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tfa-state small { color: var(--muted); font-size: 12px; }
.tfa-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.tfa-state.on { border-color: rgba(16,185,129,.45); }
.tfa-state.on .tfa-dot { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.18); }
.tfa-steps { margin: 0 0 12px; padding-left: 18px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
.tfa-steps a { color: var(--text); }
.tfa-qr { width: 180px; max-width: 70vw; padding: 6px; background: #fff; border-radius: 10px; margin: 0 0 10px; }
.tfa-qr svg { display: block; width: 100%; height: auto; }
.tfa-key { margin-bottom: 12px; font-size: 12px; word-break: break-all; }
.tfa-key code { font-size: 12.5px; letter-spacing: .04em; }
.tfa-codes { display: grid; gap: 8px; }
.tfa-codes p { margin: 0; }
.tfa-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tfa-grid code { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; text-align: center; font-size: 13px; letter-spacing: .06em; }
.btn.tfa-off { border-color: #7f1d1d !important; color: #fca5a5 !important; }
#acc-2fa-body .pg-actions { gap: 8px; flex-wrap: wrap; }

/* ===== Item 214: app mais compacto no celular (principalmente o Início) ===== */
@media (max-width: 820px) {
  /* geral */
  .view-container { padding-top: 10px !important; }
  .pg-head h1 { font-size: 22px !important; }
  .pg-card { padding: 14px !important; border-radius: 14px !important; }
  .pg-card h3 { font-size: 14.5px !important; }
  .pg-card p { font-size: 12px !important; margin-bottom: 8px !important; }
  .pg-split { gap: 12px !important; }
  #app-header .main-nav button, .header .main-nav button { padding: 6px 10px !important; font-size: 12.5px !important; min-height: 30px !important; }

  /* Início: cabeçalho */
  #view-inicio .farms-header-bar { gap: 8px !important; margin-bottom: 10px !important; padding: 0 !important; }
  #view-inicio .farms-header-bar .eyebrow { font-size: 10px !important; margin-bottom: 2px !important; }
  #view-inicio .farms-main-title { font-size: 21px !important; line-height: 1.15 !important; margin: 0 !important; }
  #view-inicio .farms-main-sub { display: none !important; }
  #view-inicio .farms-header-bar .btn { padding: 6px 10px !important; font-size: 12px !important; min-height: 30px !important; }

  /* Início: KPIs */
  #view-inicio .farms-global-kpis { margin-bottom: 12px !important; border-radius: 12px !important; }
  #view-inicio .farms-global-kpis .lm-kpi { padding: 9px 12px !important; min-height: 0 !important; }
  #view-inicio .fk2-label { font-size: 10.5px !important; margin-bottom: 2px !important; }
  #view-inicio .fk2-val { font-size: 19px !important; line-height: 1.15 !important; }
  #view-inicio .fk2-val small, #view-inicio .fk2-val span { font-size: 10.5px !important; }
  #view-inicio .fk2-sub { font-size: 10.5px !important; margin-top: 2px !important; }
  #view-inicio .fk2-bar { margin: 4px 0 !important; }

  /* Início: seções */
  #view-inicio .inicio-sections-container { gap: 12px !important; }
  #view-inicio .inicio-draggable-section { padding: 12px !important; border-radius: 14px !important; margin-bottom: 0 !important; }
  #view-inicio .section-drag-header { margin-bottom: 8px !important; }
  #view-inicio .section-drag-header .eyebrow { font-size: 10px !important; }
  #view-inicio .section-name { font-size: 14px !important; }
  #view-inicio .farms-toolbar { margin-bottom: 8px !important; gap: 6px !important; }
  #view-inicio .farms-search-wrap input { height: 34px !important; font-size: 13px !important; }

  /* Início: cards das fazendas */
  #view-inicio .farms-grid { gap: 10px !important; }
  #view-inicio .farm-card.fc2 { padding: 12px 14px 12px !important; gap: 10px !important; border-radius: 13px !important; }
  #view-inicio .fc2-title { font-size: 15px !important; }
  #view-inicio .fc2-loc { font-size: 11px !important; margin-top: 1px !important; }
  #view-inicio .fc2-pill { font-size: 10px !important; padding: 3px 8px !important; }
  #view-inicio .fc2-big { font-size: 24px !important; }
  #view-inicio .fc2-label, #view-inicio .fc2-mono { font-size: 10.5px !important; }
  #view-inicio .fc2-boards { gap: 4px !important; }
  #view-inicio .fc2-stats { padding-top: 9px !important; }
  #view-inicio .fc2-stat { gap: 2px !important; padding: 0 8px !important; }
  #view-inicio .fc2-foot .btn, #view-inicio .fc2-ghost { padding: 6px 10px !important; font-size: 12px !important; min-height: 30px !important; }
  #view-inicio .fc2-icon { width: 32px !important; padding: 6px 0 !important; }

  /* Início: rendimento */
  #view-inicio .lm-filter-pills button { padding: 4px 10px !important; font-size: 11.5px !important; min-height: 26px !important; }
  #view-inicio .rendimento-grid { border-radius: 10px !important; }
  #view-inicio .rend-stat-box { padding: 9px 10px !important; }
  #view-inicio .rend-stat-lbl { font-size: 10.5px !important; }
  #view-inicio .rend-stat-box > div, #view-inicio .rend-stat-box strong { font-size: 15px !important; line-height: 1.2 !important; }
  #view-inicio .rend-stat-box small, #view-inicio .rend-stat-box .rend-stat-sub { font-size: 10px !important; }

  /* Início: gráfico */
  #view-inicio .lm-chart-head { margin-bottom: 6px !important; }
  #view-inicio .svg-chart-wrap { max-height: 170px !important; }

  /* Início: status das máquinas */
  #view-inicio .status-summary-box { padding: 10px 12px !important; }
  #view-inicio .status-box-header { margin-bottom: 2px !important; }
  #view-inicio .status-box-title { font-size: 13px !important; }
  #view-inicio .status-box-val { font-size: 20px !important; margin: 2px 0 !important; }
  #view-inicio .status-box-desc { display: none !important; }
  #view-inicio .status-machines-list { font-size: 11.5px !important; margin-top: 4px !important; }
}

/* ===== Item 215: cabeçalho simples. Topo (marca + sair/idioma/cor) rola junto; só a barra Início/Monitor… fica fixa ===== */
.header-top { display: contents; }
#app-header .brand { order: 1; }
#app-header .main-nav { order: 2; }
#app-header .header-right { order: 3; }
@media (max-width: 820px) {
  #app-header.header { display: contents !important; }
  .header-top {
    display: flex !important; align-items: center; justify-content: space-between; gap: 8px;
    padding: calc(max(env(safe-area-inset-top, 0px), 0px) + 8px) 14px 6px; background: var(--bg, #000);
  }
  html.is-standalone .header-top { padding-top: calc(max(env(safe-area-inset-top, 0px), 44px) + 8px); }
  #app-header .brand { display: inline-flex !important; align-items: center; gap: 8px; min-width: 0; padding: 0; }
  #app-header .brand .brand-logo { width: 22px; height: 22px; }
  #app-header .brand .brand-text, .header .brand-text { display: inline !important; font-size: 13px !important; letter-spacing: .08em; }
  #app-header .header-right { display: flex !important; align-items: center; gap: 6px; flex: 0 0 auto; min-width: 0; margin: 0; }
  #app-header .user-pill { background: transparent !important; border: 0 !important; padding: 0 !important; gap: 0 !important; max-width: none !important; }
  #app-header .user-pill .live-dot, #app-header #header-user-email { display: none !important; }
  #app-header #btn-logout { min-height: 24px !important; height: 24px !important; padding: 0 9px !important; font-size: 11px !important; border-radius: 7px !important; }
  #app-header .lang-select, #app-header .header-right select.lang-select {
    transform: none !important; margin: 0 !important; height: 24px !important; min-height: 24px !important; max-width: 56px !important;
    padding: 0 14px 0 7px !important; font-size: 11px !important; border-radius: 7px !important; background-size: 8px !important; }
  #app-header .theme-picker { flex: 0 0 auto; }
  #app-header .theme-dot, #app-header .theme-dot#theme-current { width: 22px !important; height: 22px !important; min-height: 0 !important; border-radius: 7px !important; }
  #app-header .main-nav {
    position: sticky !important; top: env(safe-area-inset-top, 0px); z-index: 60; margin: 0 !important; border-radius: 0 !important;
    padding: 5px 12px !important; border: 0 !important; border-bottom: 1px solid var(--border) !important;
    background: var(--bg, #000) !important; overflow-x: auto; justify-self: stretch;
  }
  html.is-standalone body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px);
    background: var(--bg, #000); z-index: 70; pointer-events: none; }
}

.mn-row[data-mid] { cursor: pointer; -webkit-tap-highlight-color: rgba(255,255,255,.06); }
.mn-row[data-mid]:active { border-color: var(--border-strong); }

/* ===== Item 245: "Está tudo bem" no topo dos Detalhes ===== */
.mx-ack { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; margin: -4px 0 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--status-warn) 40%, transparent); background: var(--status-warn-bg); }
.mx-ack-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mx-ack-txt b { font-size: 13.5px; font-weight: 650; color: var(--status-warn); }
.mx-ack-txt span { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.mx-ack .btn { flex: 0 0 auto; white-space: nowrap; }
.mx-ack.mx-ack-done { border-color: color-mix(in srgb, var(--status-ok) 35%, transparent); background: var(--status-ok-bg); }
.mx-ack.mx-ack-done b { color: var(--status-ok); }
@media (max-width: 640px) {
  .mx-ack { flex-direction: column; align-items: stretch; }
  .mx-ack .btn { width: 100%; justify-content: center; }
}
.mx-ack-btns { display: flex; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .mx-ack-btns { flex-direction: column; } .mx-ack-btns .btn { width: 100%; justify-content: center; } }
