/* ===========================================================
   Lokk G1 Dashboard — design system
   Clean SaaS control-room UI, dark/light mode.
   Fonte única: Montserrat (todos os pesos / textos / números)
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root,
html[data-theme="dark"] {
  /* Tesla-style HUD: true-black canvas, flat graphite cards, electric-blue primary */
  --bg-void: #000000;
  --bg-sidebar: #000000;
  --bg-panel: #17181b;
  --bg-panel-glass: #1c1e22;
  --bg-input: rgba(255, 255, 255, 0.05);
  --bg-hover: rgba(255, 255, 255, 0.06);
  --border-hair: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.18);
  /* Tesla blue — primary selection / active state */
  --accent: #005AFF;
  --accent-strong: #3D7AFF;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(0, 90, 255, 0.18);
  --border-accent: rgba(0, 90, 255, 0.5);
  /* primary CTA now the same Tesla blue used for the "Park in Spot A" button */
  --cta: #005AFF;
  --cta-strong: #3D7AFF;
  --cta-contrast: #ffffff;
  --cta-soft: rgba(0, 90, 255, 0.18);
  /* secondary highlight */
  --info: #4c8dff;
  --info-soft: rgba(76, 141, 255, 0.12);
  --warn: #f5a623;
  --warn-soft: rgba(245, 166, 35, 0.14);
  --danger: #f0475f;
  --danger-soft: rgba(240, 71, 95, 0.14);
  --text-primary: #f2f3f5;
  --text-muted: #8b8f97;
  --text-faint: #55585f;
  --panel-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 16px 40px rgba(0, 0, 0, 0.55);
  --sidebar-shadow: none;

  /* Fonte única — Montserrat */
  --font-body: 'Montserrat', sans-serif;
  --font-bold: 'Montserrat', sans-serif;
  --font-mono: 'Montserrat', sans-serif;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --radius-pill: 999px;
  --sidebar-w: 80px;
  --sidebar-w-open: 236px;
  --nav-hit: 48px;            /* hit target dos ícones (Tesla-style 48×48) */
  --nav-active-bg: rgba(255, 255, 255, 0.09);

  color-scheme: dark;
}


html[data-theme="light"] {
  --bg-void: #eef0f4;
  --bg-sidebar: #ffffff;
  --bg-panel: #ffffff;
  --bg-panel-glass: #ffffff;
  --bg-input: rgba(15, 23, 35, 0.035);
  --bg-hover: rgba(15, 23, 35, 0.04);
  --border-hair: rgba(20, 30, 45, 0.09);
  --border-strong: rgba(20, 30, 45, 0.16);
  --accent: #005AFF;
  --accent-strong: #3D7AFF;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(0, 90, 255, 0.10);
  --border-accent: rgba(0, 90, 255, 0.35);
  --cta: #005AFF;
  --cta-strong: #3D7AFF;
  --cta-contrast: #ffffff;
  --cta-soft: rgba(0, 90, 255, 0.12);
  --info: #2f6fed;
  --info-soft: rgba(47, 111, 237, 0.10);
  --warn: #b3720a;
  --warn-soft: rgba(179, 114, 10, 0.12);
  --danger: #d63852;
  --danger-soft: rgba(214, 56, 82, 0.10);
  --text-primary: #171e29;
  --text-muted: #5c6673;
  --text-faint: #98a1ac;
  --panel-shadow: 0 1px 2px rgba(20, 35, 45, 0.05), 0 12px 30px rgba(20, 35, 45, 0.07);
  --sidebar-shadow: 1px 0 0 rgba(20, 35, 45, 0.06);
  --nav-active-bg: rgba(15, 23, 35, 0.06);

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }
html { background: var(--bg-void); }

body {
  background:
    radial-gradient(1100px 600px at 78% -10%, rgba(0, 90, 255, 0.08), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(76, 141, 255, 0.04), transparent 55%),
    var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 500; /* Montserrat Medium em todo o lado */
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
html[data-theme="light"] body { background: var(--bg-void); }

a { color: inherit; }
button { font-family: inherit; }

/* Bold / semibold — mesma família Montserrat */
b, strong,
.panel__title,
.sidebar__brand,
.nav-item.active,
.btn-cta,
.btn-enter-teleop,
.btn-stop-all,
.mode-btn,
.action-btn,
.ov-topbar__title,
.ov-topbar__battery,
.status-ring__pct,
.status-ring__label,
.status-meta__val,
.status-meta__plain b,
.spark-card__val,
.qc-slider-row__label b,
.joint-slider-row .val,
.joint-cell b,
.readout__value,
.odo-readout__value,
.odo-readout__value b,
.ov-joint-row__val,
.log-row__tag,
.login-card button,
.config-tab.active,
.segmented__item.active,
.user-chip__name,
.dest-row__title,
.engage-toggle button,
.service-card__top {
  font-family: var(--font-bold);
}

/* ---------- painel ---------- */
.panel {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--panel-shadow);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.panel__title {
  font-family: var(--font-bold);
  font-weight: 700; /* Medium family + bold weight */
  font-size: 14px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* sem pontinho antes do título */

/* ---------- shell / layout geral ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  gap: 0;
  position: relative;
  transition: grid-template-columns 0.22s ease;
}

/* ========== SIDEBAR ==========
   Default = colapsada (só ícones 48×48)
   Hover / focus-within = expande temporariamente
   data-sidebar="pinned" = fica aberta
   ========================================= */
.sidebar {
  width: 80px;
  margin: 14px 0 14px 8px;
  height: calc(100vh - 28px);
  position: sticky;
  top: 14px;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2000;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  box-shadow: none;
  overflow: visible;
  transition: width 0.2s ease, background 0.2s ease, padding 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* aberta (hover se collapsed, ou pinned) */
html[data-sidebar="collapsed"] .sidebar:hover,
html[data-sidebar="pinned"] .sidebar {
  width: 236px;
  padding: 18px 14px;
  align-items: stretch;
  background: linear-gradient(180deg, var(--bg-panel-glass) 0%, var(--bg-sidebar) 100%);
  border-color: var(--border-hair);
  box-shadow: var(--panel-shadow);
  z-index: 50;
}

/* grid column: só alarga quando pinned */
html[data-sidebar="collapsed"] {
  --sidebar-w: 80px;
}
html[data-sidebar="pinned"] {
  --sidebar-w: 236px;
}

/* seta — escondida por omissão; no hover (collapsed) ou sempre se pinned */
.sidebar-edge-toggle {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 61;
  width: 16px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-hair);
  border-left: none;
  border-radius: 0 7px 7px 0;
  background: var(--bg-panel);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, color 0.15s, background 0.15s;
}
html[data-sidebar="collapsed"] .sidebar:hover .sidebar-edge-toggle,
html[data-sidebar="pinned"] .sidebar-edge-toggle {
  opacity: 1;
  pointer-events: auto;
}
.sidebar-edge-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-panel-glass);
}
.sidebar-edge-toggle svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}
html[data-sidebar="collapsed"] .sidebar-edge-toggle svg { transform: rotate(180deg); }
html[data-sidebar="pinned"] .sidebar-edge-toggle svg { transform: rotate(0deg); }
html[data-sidebar="pinned"] .sidebar-edge-toggle {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--border-accent);
}

/* brand / logo — só quando aberta */
.sidebar__brand {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 8px;
  width: 100%;
}
html[data-sidebar="collapsed"] .sidebar:hover .sidebar__brand,
html[data-sidebar="pinned"] .sidebar__brand {
  display: flex;
}
.sidebar__logo {
  height: 22px;
  width: auto;
  display: block;
  margin: 0 auto;
}
html[data-theme="light"] .sidebar__logo {
  filter: invert(1) brightness(0.15);
}
.sidebar__sub { display: none; }

.nav-divider {
  height: 1px;
  width: 32px;
  background: var(--border-hair);
  margin: 6px 0;
  opacity: 0;
  flex-shrink: 0;
}
html[data-sidebar="collapsed"] .sidebar:hover .nav-divider,
html[data-sidebar="pinned"] .nav-divider {
  opacity: 1;
  width: 100%;
}

/* ---- nav items: colapsado = quadrado 48×48 centrado ---- */
.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  margin: 0;
  gap: 0;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, width 0.2s, padding 0.2s;
}
.nav-item span { display: none; }
.nav-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-item.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--border-accent);
  font-weight: 600;
}
.nav-item.active .nav-icon { color: var(--accent-strong); }

/* aberta: full width + label */
html[data-sidebar="collapsed"] .sidebar:hover .nav-item,
html[data-sidebar="pinned"] .nav-item {
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 10px 12px;
  justify-content: flex-start;
  gap: 11px;
  border-radius: var(--radius-sm);
  background: transparent;
  border-color: transparent;
}
html[data-sidebar="collapsed"] .sidebar:hover .nav-item span,
html[data-sidebar="pinned"] .nav-item span {
  display: inline;
}
html[data-sidebar="collapsed"] .sidebar:hover .nav-item.active,
html[data-sidebar="pinned"] .nav-item.active {
  background: var(--nav-active-bg);
  color: var(--text-primary);
  border-color: transparent;
}
html[data-sidebar="collapsed"] .sidebar:hover .nav-item.active .nav-icon,
html[data-sidebar="pinned"] .nav-item.active .nav-icon {
  color: var(--text-primary);
}
html[data-sidebar="collapsed"] .sidebar:hover .nav-item:hover,
html[data-sidebar="pinned"] .nav-item:hover {
  background: var(--bg-hover);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
  color: currentColor;
}
.nav-icon * {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar__spacer { margin-top: auto; width: 100%; flex-shrink: 0; }

.sidebar__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid transparent;
}
html[data-sidebar="collapsed"] .sidebar:hover .sidebar__footer,
html[data-sidebar="pinned"] .sidebar__footer {
  align-items: stretch;
  border-top-color: var(--border-hair);
}
.sidebar__footer form {
  display: flex;
  justify-content: center;
  width: 100%;
}
html[data-sidebar="collapsed"] .sidebar:hover .sidebar__footer form,
html[data-sidebar="pinned"] .sidebar__footer form {
  display: block;
}

.theme-toggle,
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  margin: 0;
  gap: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  box-sizing: border-box;
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, width 0.2s, padding 0.2s;
}
.theme-toggle .theme-toggle__label,
.logout-btn span { display: none; }
.theme-toggle:hover { color: var(--text-primary); background: var(--bg-hover); }
.logout-btn { color: var(--text-faint); }
.logout-btn:hover { color: var(--danger); background: var(--danger-soft); }
.theme-toggle .nav-icon--sun { display: none; }
.theme-toggle .nav-icon--moon { display: block; }
html[data-theme="light"] .theme-toggle .nav-icon--sun { display: block; }
html[data-theme="light"] .theme-toggle .nav-icon--moon { display: none; }
.theme-toggle .theme-toggle__label::after { content: "Tema escuro"; }
html[data-theme="light"] .theme-toggle .theme-toggle__label::after { content: "Tema claro"; }

html[data-sidebar="collapsed"] .sidebar:hover .theme-toggle,
html[data-sidebar="collapsed"] .sidebar:hover .logout-btn,
html[data-sidebar="pinned"] .theme-toggle,
html[data-sidebar="pinned"] .logout-btn {
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 9px 12px;
  justify-content: flex-start;
  gap: 11px;
  background: transparent;
  border-radius: var(--radius-sm);
}
html[data-sidebar="collapsed"] .sidebar:hover .theme-toggle .theme-toggle__label,
html[data-sidebar="collapsed"] .sidebar:hover .logout-btn span,
html[data-sidebar="pinned"] .theme-toggle .theme-toggle__label,
html[data-sidebar="pinned"] .logout-btn span {
  display: inline;
}

.main {
  padding: 14px 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__title {
  font-family: var(--font-bold);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.topbar__eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.topbar__status {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.status-pill.online .dot { background: var(--accent); }
.status-pill.offline .dot { background: var(--danger); }

/* ---------- breadcrumb (estilo Haulix) ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.breadcrumb a { color: var(--text-faint); text-decoration: none; transition: color 0.15s; }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb .sep { color: var(--text-faint); opacity: 0.5; }
.breadcrumb .current { color: var(--text-primary); font-weight: 600; }

/* ---------- barra de pills de estatística no topo ---------- */
.stat-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.stat-chip b {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-chip .stat-chip__icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--text-faint);
}
.stat-chip .stat-chip__icon * {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- CTA primário (botão "Activate Route" estilo lima) ---------- */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--cta);
  background: var(--cta);
  color: var(--cta-contrast);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-cta:hover { background: var(--cta-strong); border-color: var(--cta-strong); }
.btn-cta:active { transform: scale(0.98); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-ghost:hover { border-color: var(--border-strong); background: var(--bg-hover); }

/* ---------- tabs sublinhadas (estilo Haulix: Overview / Cargo / Trips…) ---------- */
.tabs {
  display: flex;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--border-hair);
  margin-bottom: 4px;
}
.tab-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 2px 12px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text-faint);
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: transparent;
}
.tab-item .count {
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--text-faint);
  background: var(--bg-input);
  border-radius: var(--radius-pill);
  padding: 1px 6px;
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--text-primary); }
.tab-item.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--cta);
  border-radius: 2px;
}

/* ---------- pills de filtro segmentadas (All / Active / Idle…) ---------- */
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.filter-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12.5px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-pill .n {
  font-family: var(--font-body);
  font-size: 10.5px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-pill);
  padding: 1px 6px;
  color: var(--text-faint);
}
.filter-pill.active { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-hover); }
.filter-pill.active .n { background: var(--accent-soft); color: var(--accent); }

.toggle-row { display: flex; align-items: center; gap: 18px; }
.toggle-inline {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.toggle-switch {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border-hair);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.18s ease, background 0.18s ease;
}
.toggle-switch.on { background: var(--accent); border-color: var(--accent); }
.toggle-switch.on::after { transform: translateX(15px); background: var(--accent-contrast); }

/* ---------- gauge semicircular (estilo "Speed") ---------- */
.gauge-semi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.gauge-semi__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.gauge-semi__tag {
  font-family: var(--font-body);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--danger-soft);
  color: var(--danger);
}
.gauge-semi svg { display: block; }
.gauge-semi__needle { transition: transform 0.4s cubic-bezier(.4,1.6,.4,1); transform-origin: 68px 62px; }
.gauge-semi__value {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 19px;
  color: var(--text-primary);
  margin-top: -6px;
}
.gauge-semi__value .unit { font-family: var(--font-body); font-weight: 400; font-size: 11px; color: var(--text-muted); margin-left: 3px; }

/* ---------- gauge donut / "eyebrow" (estilo "Fuel level") ---------- */
.gauge-donut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}
.gauge-donut__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.gauge-donut__badge {
  font-family: var(--font-body);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--warn-soft);
  color: var(--warn);
}
.gauge-donut__ring { fill: none; stroke-linecap: round; }
.gauge-donut__track { stroke: var(--border-hair); }
.gauge-donut__value {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -46%);
  text-align: center;
}
.gauge-donut__value b {
  display: block;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 17px;
  color: var(--text-primary);
}
.gauge-donut__value span {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-faint);
}

.gauge-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- energy card (estado do robô) — estilo cartão de bateria da Tesla ---------- */
.energy-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: #060706;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.energy-card__top {
  background: linear-gradient(135deg, #eafccb 0%, #a9e07f 45%, #4c9a4c 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 16px 22px 30px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.energy-card__kwh {
  font-family: var(--font-bold);
  font-size: 15px;
  font-weight: 600;
  color: #1c2b12;
  letter-spacing: -0.01em;
}
.energy-card__kwh .unit { font-weight: 500; opacity: 0.75; margin-left: 2px; }
.energy-card__badge {
  position: relative;
  top: -2px;
  width: 46px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(135deg, #d8f5ab, #7ec24f);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}
.energy-card__badge svg { width: 20px; height: 20px; }
.energy-card__badge svg * { fill: none; stroke: #16210c; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.energy-card__body {
  background: #0a0b09;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 20px 22px 22px;
  margin-top: -16px;
}
.energy-card__segbar {
  height: 11px;
  border-radius: 6px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0, rgba(255, 255, 255, 0.09) 2px, transparent 2px, transparent 6px);
  position: relative;
  overflow: hidden;
  margin-bottom: 26px;
}
.energy-card__segbar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, #cdf29a, #7ec24f);
  transition: width 0.5s ease, background 0.3s ease;
}
.energy-card__stats {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}
.energy-card__stat--right { text-align: right; }
.energy-card__stat-label {
  font-family: var(--font-bold);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #a3e878;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.energy-card__stat--right .energy-card__stat-label { justify-content: flex-end; }
.energy-card__stat-label .unit {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: none;
  color: #7d8a76;
}
.energy-card__stat-tag {
  font-family: var(--font-bold);
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(163, 232, 120, 0.15);
  color: #a3e878;
}
.energy-card__stat-value {
  font-family: var(--font-bold);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.energy-card__stat-value--accent { color: var(--info); }

/* ---------- compass dial (heading / yaw) ---------- */
.compass {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid var(--border-hair);
  background: radial-gradient(circle at 50% 40%, rgba(255,255,255,0.04), transparent 70%), var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.compass__dial { transition: transform 0.3s ease; }
.compass__label {
  font-family: var(--font-body);
  font-size: 9px;
  fill: var(--text-faint);
}
.compass__needle { fill: var(--cta); }
.compass__center {
  position: absolute;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-panel);
  border: 1px solid var(--border-hair);
  border-radius: 50%;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- banner de alerta (estilo "Required break") ---------- */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border: 1px solid rgba(245, 166, 35, 0.3);
  color: var(--warn);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12.5px;
}
.alert-banner svg { width: 15px; height: 15px; flex-shrink: 0; }
.alert-banner svg * { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.alert-banner b { color: inherit; font-weight: 700; }

/* ---------- topbar: pesquisa, dropdown, user chip (estilo Haulix header) ---------- */
.topbar-right { display: flex; align-items: center; gap: 10px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  color: var(--text-faint);
  font-family: var(--font-body);
  font-size: 12.5px;
  min-width: 190px;
}
.search-box svg { width: 14px; height: 14px; flex-shrink: 0; }
.search-box svg * { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.search-box kbd {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-faint);
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 1px 5px;
}
.dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  color: var(--text-muted);
  position: relative;
  cursor: pointer;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn svg * { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn .badge {
  position: absolute;
  top: -3px; right: -3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-family: var(--font-body);
  font-size: 8.5px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-void);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border-hair);
  cursor: pointer;
}
.user-chip__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 11px;
}
.user-chip__name { font-family: var(--font-bold); font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.user-chip__role { font-family: var(--font-body); font-size: 10.5px; color: var(--text-faint); line-height: 1.2; }

/* segmented: ver bloco Tesla tabs mais abaixo */

/* ---------- lista de destino / waypoints (estilo Tesla "Select destination") ---------- */
.dest-list { display: flex; flex-direction: column; gap: 8px; }
.dest-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dest-row:hover { border-color: var(--border-accent); background: var(--accent-soft); }
.dest-row__icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.dest-row__body { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.dest-row__title { font-family: var(--font-bold); font-weight: 600; font-size: 13px; color: var(--text-primary); }
.dest-row__sub {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dest-row__chevron { width: 15px; height: 15px; color: var(--text-faint); flex-shrink: 0; }
.dest-row__chevron * { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- odometria: leitura compacta (substitui os cartões antigos) ---------- */
.odo-readout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
}
.odo-readout__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.odo-readout__label {
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.odo-readout__value {
  font-family: var(--font-bold);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.odo-readout__value b { color: var(--text-primary); font-weight: 600; }

.hint-text {
  font-family: var(--font-body);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-faint);
}
.hint-text code {
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---------- HUD flutuante sobre o mapa (estilo Tesla: PRND / velocidade / bateria) ---------- */
.map-hud {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}
.map-hud__gear {
  display: flex;
  gap: 4px;
  pointer-events: auto;
}
.map-hud__gear span {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 11px;
  color: var(--text-faint);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
}
.map-hud__gear span.active { color: var(--bg-void); background: var(--text-primary); }
.map-hud__battery {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
  pointer-events: auto;
}
.map-hud__battery svg { width: 15px; height: 15px; }
.map-hud__battery svg * { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- gauge de arco (estilo "Threat Level") ---------- */
.arc-gauge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.arc-gauge-card__sub {
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.arc-gauge {
  position: relative;
  width: 200px;
  height: 112px;
}
.arc-gauge svg { position: absolute; inset: 0; }
.arc-gauge__track { fill: none; stroke: var(--border-hair); stroke-width: 12; stroke-linecap: round; }
.arc-gauge__value { fill: none; stroke-linecap: round; transition: stroke-dasharray 0.5s ease, stroke 0.3s ease; }
.arc-gauge__min, .arc-gauge__max {
  position: absolute;
  bottom: 2px;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-faint);
}
.arc-gauge__min { left: 4px; }
.arc-gauge__max { right: 4px; }
.arc-gauge__center {
  position: absolute;
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 26px;
  color: var(--text-primary);
}
.arc-gauge-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 11.5px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

/* ---------- readouts numéricos ---------- */
.readout__label {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.readout__value {
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 25px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.readout__value .unit {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* ---------- anel de bateria ---------- */
.battery-ring {
  display: flex;
  align-items: center;
  gap: 20px;
}
.battery-ring svg { transform: rotate(-210deg); }
.battery-ring__track { fill: none; stroke: var(--border-hair); stroke-width: 8; }
.battery-ring__value {
  fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round;
  transition: stroke-dasharray 0.4s ease;
}

/* ---------- lista de serviços ---------- */
.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-hair);
  font-size: 13.5px;
  font-weight: 500;
}
.service-row:last-child { border-bottom: none; }
.service-row__actions button {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.service-row__actions button:hover { color: var(--accent); border-color: var(--border-accent); background: var(--accent-soft); }

/* ---------- joint grid ---------- */
.joint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  font-size: 12px;
}
.joint-cell {
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  padding: 9px 11px;
  color: var(--text-muted);
}
.joint-cell b {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-bold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.phase-bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.phase-bar {
  width: 4px;
  background: var(--accent);
  border-radius: 1px;
  height: 20%;
  transition: height 0.1s linear;
}

/* ---------- console / teleop ---------- */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.video-frame__placeholder {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.6;
  padding: 0 20px;
}
.video-frame img, .video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-frame__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--danger-soft);
  border: 1px solid rgba(240, 71, 95, 0.35);
  color: var(--danger);
}
.video-frame__badge.live {
  background: var(--accent-soft);
  border-color: var(--border-accent);
  color: var(--accent);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 12px 10px;
  border-radius: 7px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.action-btn svg {
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.action-btn:hover { color: var(--accent); border-color: var(--border-accent); background: var(--accent-soft); }
.action-btn.danger:hover { color: var(--danger); border-color: rgba(240,71,95,0.4); background: var(--danger-soft); }

/* joystick virtual — vidro fosco + esfera brilhante, estilo Tesla/Apple */
.joystick-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.joystick-base {
  position: relative;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  border: 1px solid var(--border-hair);
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,0.07), transparent 55%),
    radial-gradient(circle, var(--accent-soft) 0%, transparent 68%),
    linear-gradient(to right, transparent 49.3%, var(--border-hair) 49.3%, var(--border-hair) 50.7%, transparent 50.7%),
    linear-gradient(to bottom, transparent 49.3%, var(--border-hair) 49.3%, var(--border-hair) 50.7%, transparent 50.7%),
    var(--bg-input);
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.35);
  touch-action: none;
}
.joystick-base::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--border-hair);
  transform: scale(0.62);
}
.joystick-stick {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 28%, #ffffff 0%, var(--accent-strong) 50%, var(--accent) 100%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35), 0 0 0 5px rgba(255,255,255,0.05);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.joystick-stick.dragging {
  transition: none;
  cursor: grabbing;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3), 0 0 0 7px rgba(255,255,255,0.07);
}
.joystick-readout {
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
}

/* ---------- sliders estilo Apple/Tesla: pílula preenchida + thumb branco ---------- */
.joint-slider-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.joint-slider-row {
  display: grid;
  grid-template-columns: 132px 1fr 48px;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
}
.joint-slider-row label {
  color: var(--text-muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ===========================================================
   Sliders globais — track + tab mesma altura, radius reduzido
   =========================================================== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-hair);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  background: var(--bg-input);
  box-sizing: border-box;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 26px;
  border-radius: 3px;
  background: transparent;
}
/* tab = mesma altura que o track */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 26px;
  margin-top: 0;
  border-radius: 3px;
  background: #ffffff;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: grab;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
input[type="range"]:active::-webkit-slider-thumb,
input[type="range"].is-dragging::-webkit-slider-thumb {
  background: #005AFF !important;
  cursor: grabbing;
  box-shadow: 0 0 0 3px rgba(0, 90, 255, 0.28);
}
input[type="range"]::-moz-range-track {
  height: 28px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-hair);
}
input[type="range"]::-moz-range-thumb {
  width: 40px;
  height: 26px;
  border-radius: 3px;
  background: #ffffff;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: grab;
}
input[type="range"]:active::-moz-range-thumb,
input[type="range"].is-dragging::-moz-range-thumb {
  background: #005AFF !important;
  cursor: grabbing;
  box-shadow: 0 0 0 3px rgba(0, 90, 255, 0.28);
}

.joint-slider-row .val {
  color: var(--text-primary);
  font-family: var(--font-bold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}


/* ---------- restored: hand / services / config / speech ---------- */
.hand-card {
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  padding: 16px;
}
.hand-card__title {
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* Tesla 2-tab on/off (Ligar / Desligar) */
.engage-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.tesla-tabs,
.engage-toggle .tesla-tabs {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  overflow: hidden;
  background: transparent;
}
.tesla-tab,
.engage-toggle .tesla-tab {
  flex: 1;
  min-width: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tesla-tab + .tesla-tab,
.engage-toggle .tesla-tab + .tesla-tab {
  border-left: 1.5px solid rgba(255, 255, 255, 0.28);
}
.tesla-tab:hover,
.engage-toggle .tesla-tab:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.05);
}
.tesla-tab.active,
.engage-toggle .tesla-tab.active {
  color: #ffffff;
  background: var(--accent);
}
/* legado: botão único engajado */
.engage-toggle button.engaged {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

/* segmented (All/Parking…) alinhado ao mesmo sistema de tabs */
.segmented {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-radius: 7px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  overflow: hidden;
}
.segmented__item {
  flex: 1;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 0;
  border: none;
  border-right: 1.5px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.15s;
}
.segmented__item:last-child { border-right: none; }
.segmented__item:hover { color: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.05); }
.segmented__item.active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

/* ---------- serviços: cartões + log terminal ---------- */
.service-card {
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.service-card:hover { border-color: var(--border-accent); }
.service-card.selected { border-color: var(--border-accent); background: var(--accent-soft); }
.service-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  font-size: 13.5px;
}
.service-card__actions { display: flex; gap: 6px; margin-top: 10px; }
.service-card__actions button {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hair);
  background: var(--bg-panel);
  color: var(--text-muted);
  cursor: pointer;
}
.service-card__actions button:hover { color: var(--accent); border-color: var(--border-accent); }

.log-terminal {
  height: 420px;
  overflow-y: auto;
  background: #0a0d12;
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  color: #9fd8cc;
}
.log-terminal .log-line { white-space: pre-wrap; word-break: break-all; }
.log-terminal .log-info { color: var(--text-faint); font-style: italic; }
.log-terminal:empty::before {
  content: "seleciona um serviço à esquerda para ver os logs em tempo real";
  color: var(--text-faint);
}

/* ---------- navegação: mapa 2D ---------- */
.map-canvas-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: crosshair;
  background: #0a0d12;
}
.map-canvas-wrap canvas { display: block; width: 100%; height: 100%; }
.map-hint {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-faint);
  pointer-events: none;
}
.mode-toggle {
  display: flex;
  gap: 8px;
}
.mode-toggle button {
  flex: 1;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  padding: 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
}
.mode-toggle button.active {
  color: var(--cta-contrast);
  border-color: var(--cta);
  background: var(--cta);
}

/* ---------- definições: editor YAML ---------- */
.config-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.config-tab {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12.5px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
}
.config-tab.active {
  color: var(--cta-contrast);
  border-color: var(--cta);
  background: var(--cta);
}
.config-editor {
  width: 100%;
  height: 520px;
  background: #0a0d12;
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  color: #cfe8e2;
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.6;
  padding: 16px;
  resize: vertical;
  tab-size: 2;
}
.config-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.config-msg {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12.5px;
}
.config-msg.ok { color: var(--accent); }
.config-msg.error { color: var(--danger); }

/* ---------- sistema: barras de progresso ---------- */
.stat-bar-row { margin-bottom: 14px; }
.stat-bar-row__label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--border-hair);
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.stat-bar-fill.warn { background: var(--warn); }
.stat-bar-fill.danger { background: var(--danger); }

/* ---------- LED / Áudio ---------- */
.led-preview {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border-hair);
  flex-shrink: 0;
}
.color-swatches {
  display: flex;
  gap: 13px;
  margin: 14px 0;
}
.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.color-swatch:hover { transform: scale(1.08); }
/* seleção estilo Tesla: anel azul (--accent) com respiro da cor do painel */
.color-swatch.selected {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--bg-panel), 0 0 0 4px var(--accent);
  transform: scale(1.06);
}

.slider-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-muted);
}
.slider-inline input[type="range"] { flex: 1; }

.speak-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.speak-row input[type="text"] {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 9px 12px;
}
.speak-row input[type="text"]:focus { outline: none; border-color: var(--border-accent); }
.speak-row button {
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 13px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cta);
  background: var(--cta);
  color: var(--cta-contrast);
  cursor: pointer;
}
.speak-row button:hover { background: var(--cta-strong); border-color: var(--cta-strong); }

/* Estado Avançado — comandos setter/getter LocoClient (console.html) */
.setter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.setter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--text-muted);
}
.setter-row span { flex: 0 0 auto; min-width: 76px; }
.setter-row input[type="number"],
.setter-row input[type="text"] {
  width: 84px;
  background: var(--bg-input);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 8px;
}
.setter-row input[type="text"]#setVelocity { width: auto; }
.setter-row input:focus { outline: none; border-color: var(--border-accent); }
.setter-row .action-btn { padding: 0 12px; height: 30px; font-size: 11.5px; }
@media (max-width: 900px) {
  .setter-grid { grid-template-columns: 1fr; }
}


.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card { width: 360px; }
.login-card input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 11px 13px;
  margin-bottom: 12px;
}
.login-card input:focus { outline: none; border-color: var(--border-accent); }
.login-card button {
  width: 100%;
  background: var(--cta);
  border: 1px solid var(--cta);
  color: var(--cta-contrast);
  font-family: var(--font-bold);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding: 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.login-card button { box-shadow: 0 0 0 rgba(215,242,76,0); transition: background 0.15s, border-color 0.15s, box-shadow 0.2s; }
.login-card button:hover { background: var(--cta-strong); border-color: var(--cta-strong); box-shadow: 0 4px 22px rgba(215,242,76,0.18); }
.login-error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(240,71,95,0.3);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12.5px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.theme-toggle--floating {
  position: absolute;
  top: 22px;
  right: 22px;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 9px 14px !important;
  justify-content: flex-start !important;
  border: 1px solid var(--border-hair);
  background: var(--bg-panel);
  border-radius: var(--radius-sm);
}
.theme-toggle--floating .theme-toggle__label {
  opacity: 1 !important;
  width: auto !important;
}

/* login: logo sempre visível (não herda estado collapsed da sidebar) */
.login-card .sidebar__brand {
  opacity: 1 !important;
  width: auto !important;
  pointer-events: auto !important;
  overflow: visible;
}

/* ===========================================================
   Overview — layout estilo Unitree G1 (status ring, viewport,
   quick control, teleop, telemetria com sparkline, logs)
   =========================================================== */
.ov-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.ov-topbar__left { display: flex; align-items: center; gap: 14px; }
.ov-topbar__title { font-family: var(--font-bold); font-weight: 700; font-size: 22px; color: var(--text-primary); }
.ov-topbar__status {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-body); font-weight: 500; font-size: 13px;
  color: #3ddc84;
}
.ov-topbar__status .dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 8px rgba(61,220,132,0.7); }
.ov-topbar__status.offline { color: var(--danger); }
.ov-topbar__status.offline .dot { background: var(--danger); box-shadow: 0 0 8px rgba(240,71,95,0.6); }
.ov-topbar__right { display: flex; align-items: center; gap: 20px; }
.ov-topbar__icons { display: flex; align-items: center; gap: 14px; color: var(--text-muted); }
.ov-topbar__icons svg,
.ov-topbar__icons .tesla-ico {
  width: 20px;
  height: 20px;
  display: block;
}
.ov-topbar__battery { display: flex; align-items: center; gap: 7px; font-family: var(--font-bold); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-muted); }
/* Tesla-style clock */
.ov-topbar__clock {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-width: 0 !important;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border-hair);
  min-width: 64px;
  text-align: center;
  line-height: 1;
}
.ov-topbar__gear { color: var(--text-muted); cursor: pointer; display: flex; align-items: center; }
.ov-topbar__gear svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.ov-columns {
  display: grid;
  grid-template-columns: 296px 1fr 320px;
  gap: 18px;
  align-items: stretch; /* colunas à mesma altura (ref. sensores) */
}
@media (max-width: 1240px) {
  .ov-columns { grid-template-columns: 1fr; }
}
.ov-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}

/* --- Robot status ring ---
   Ring em cima, meta rows por baixo (sempre visíveis em desktop) */
.status-ring-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}
.status-ring {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  align-self: center;
}
.status-ring svg { transform: rotate(-90deg); }
.status-ring__track { fill: none; stroke: var(--border-hair); stroke-width: 9; }
.status-ring__value { fill: none; stroke: #3ddc84; stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray 0.4s ease, stroke 0.4s ease; }
.status-ring__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.status-ring__pct { font-family: var(--font-bold); font-weight: 700; font-size: 21px; font-variant-numeric: tabular-nums; color: var(--text-primary); line-height: 1.1; }
.status-ring__label { font-family: var(--font-bold); font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.status-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
.status-meta__row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.status-meta__label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--text-muted);
  width: 58px;
  flex-shrink: 0;
}
.status-meta__track {
  flex: 1 1 auto;
  min-width: 40px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border-hair);
  overflow: hidden;
}
.status-meta__fill { height: 100%; border-radius: var(--radius-pill); background: #3ddc84; transition: width 0.35s ease; }
.status-meta__fill.warn { background: var(--warn); }
.status-meta__fill.danger { background: var(--danger); }
.status-meta__val {
  font-family: var(--font-bold);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  width: 48px;
  text-align: right;
  flex-shrink: 0;
}
.status-meta__plain {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 2px;
}
.status-meta__plain b {
  font-family: var(--font-bold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* --- Sensors list --- */
.sensor-list { display: flex; flex-direction: column; gap: 4px; }
.sensor-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; }
.sensor-row__icon { width: 17px; height: 17px; color: var(--text-muted); flex-shrink: 0; }
.sensor-row__icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; }
.sensor-row__name { font-family: var(--font-body); font-size: 12.5px; color: var(--text-primary); flex: 1; }
.sensor-row__state { font-family: var(--font-body); font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 7px; }
.sensor-row__state .dot { width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 6px rgba(61,220,132,0.6); }
.sensor-row__state.offline { color: var(--text-faint); }
.sensor-row__state.offline .dot { background: var(--text-faint); box-shadow: none; }

/* --- Robot viewport (centro) — compacto, alinhado à coluna esquerda --- */
.ov-viewport {
  position: relative;
  height: auto;
  min-height: 480px;
  max-height: none;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-hair);
  background:
    radial-gradient(circle at 50% 30%, rgba(0,90,255,0.08), transparent 55%),
    var(--bg-panel);
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 12px;
  box-sizing: border-box;
}
.ov-viewport__badge {
  position: absolute;
  top: 18px; right: 18px;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: var(--font-bold); font-size: 11.5px; font-weight: 600;
  cursor: default;
}
.ov-viewport__badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ov-viewport__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ov-viewport__robot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
}
.ov-viewport__robot-img { width: auto; height: auto; max-height: 340px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5)); }
.ov-joint-list { width: 216px; display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; }
.ov-joint-row { display: flex; align-items: center; gap: 8px; padding: 6.5px 4px; font-family: var(--font-body); font-size: 12px; }
.ov-joint-row .dot { width: 6px; height: 6px; border-radius: 50%; background: #3ddc84; flex-shrink: 0; }
.ov-joint-row__name { color: var(--text-muted); flex: 1; }
.ov-joint-row__val { font-family: var(--font-bold); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.ov-viewport__actions { display: flex; gap: 10px; }
.ov-viewport__actions .action-btn { flex: 1; justify-content: center; }
.ov-viewport__actions--gestures { flex-wrap: wrap; }
.ov-viewport__actions--gestures .action-btn { flex: 1 1 128px; }

/* --- Quick control --- */
/* Quick Control — Tesla tall-icon outline (4 colunas partilham borda) */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  overflow: hidden;
  background: transparent;
}
.mode-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 18px 8px;
  min-height: 110px;
  border: none;
  border-right: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}
.mode-btn:last-child { border-right: none; }
.mode-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  stroke: none;
}
.mode-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}
.mode-btn.active {
  color: #ffffff;
  background: var(--accent);
}

.qc-slider-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 14px;
}
.qc-slider-row__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
}
.qc-slider-row__label span { font-weight: 500; }
.qc-slider-row__label b {
  color: var(--text-primary);
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.qc-slider-row input[type="range"] { width: 100%; }

.qc-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 4px; }
.qc-actions-grid .action-btn { justify-content: center; gap: 8px; }
.qc-actions-grid .action-btn svg { width: 15px; height: 15px; }
.btn-stop-all {
  width: 100%;
  margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(240,71,95,0.35);
  background: var(--danger-soft);
  color: var(--danger);
  font-family: var(--font-bold); font-weight: 600; font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-stop-all:hover { background: rgba(240,71,95,0.22); }
.btn-stop-all svg { width: 15px; height: 15px; }

/* --- Teleop card --- */
.teleop-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.btn-enter-teleop { margin-top: 14px; }
.btn-enter-teleop {
  display: block; width: 100%; text-align: center;
  padding: 11px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-bold); font-weight: 600; font-size: 13px;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-enter-teleop:hover { background: var(--accent-strong); }
.teleop-card__hint { text-align: center; font-family: var(--font-body); font-size: 11px; color: var(--text-faint); margin-top: 9px; }

/* --- Recent activity --- */
.activity-list { display: flex; flex-direction: column; gap: 11px; }
.activity-row { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-body); font-size: 12px; }
.activity-row__time { font-family: var(--font-body); font-variant-numeric: tabular-nums; color: var(--text-faint); flex-shrink: 0; }
.activity-row__text { color: var(--text-muted); }

/* --- Telemetria em tempo real (sparklines) — Apple Stocks style ---
   Luz/fill apenas para baixo da linha; sem glow omnidirecional. */
.telemetry-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1240px) { .telemetry-row { grid-template-columns: repeat(2, 1fr); } }
.spark-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  overflow: hidden;
}
.spark-card__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.spark-card__label { font-family: var(--font-body); font-size: 12px; color: var(--text-muted); }
.spark-card__val { font-family: var(--font-bold); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.spark-card svg {
  width: 100%;
  height: 48px;
  display: block;
  overflow: hidden; /* corta qualquer overflow para cima */
}
/* linha limpa, sem drop-shadow (o fill por baixo faz a luz) */
.spark-card svg path[stroke] {
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  /* glow suave APENAS para baixo */
  filter: drop-shadow(0 3px 3px rgba(0, 90, 255, 0.35));
}
#sparkBatt { filter: drop-shadow(0 3px 3px rgba(61, 220, 132, 0.35)); }
#sparkTemp { filter: drop-shadow(0 3px 3px rgba(240, 71, 95, 0.35)); }
/* área de fill: transição suave da forma */
.spark-card svg path[fill]:not([fill="none"]) {
  transition: d 0.45s ease;
}

/* --- System logs --- */
.log-list { display: flex; flex-direction: column; gap: 1px; font-family: var(--font-body); font-size: 12px; }
.log-row { display: flex; align-items: baseline; gap: 14px; padding: 7px 2px; border-bottom: 1px solid var(--border-hair); }
.log-row:last-child { border-bottom: none; }
.log-row__time { font-family: var(--font-body); font-variant-numeric: tabular-nums; color: var(--text-faint); flex-shrink: 0; width: 58px; }
.log-row__tag { font-weight: 700; flex-shrink: 0; width: 76px; }
.log-row__tag.tag-system { color: #3ddc84; }
.log-row__tag.tag-sensors { color: #3ddc84; }
.log-row__tag.tag-movement { color: var(--danger); }
.log-row__tag.tag-teleop { color: var(--info); }
.log-row__msg { color: var(--text-muted); font-family: var(--font-body); flex: 1; }


/* light theme — outline Tesla controls */
html[data-theme="light"] .mode-grid,
html[data-theme="light"] .tesla-tabs,
html[data-theme="light"] .segmented {
  border-color: #D0D1D2;
}
html[data-theme="light"] .mode-btn {
  border-right-color: #D0D1D2;
  color: #757575;
}
html[data-theme="light"] .mode-btn:last-child { border-right-color: transparent; }
html[data-theme="light"] .mode-btn:hover { color: #414141; background: rgba(0,0,0,0.04); }
html[data-theme="light"] .mode-btn.active { color: #fff; background: var(--accent); }
html[data-theme="light"] .tesla-tab,
html[data-theme="light"] .segmented__item {
  color: #757575;
  border-color: #D0D1D2;
}
html[data-theme="light"] .tesla-tab + .tesla-tab,
html[data-theme="light"] .segmented__item {
  border-left-color: #D0D1D2;
  border-right-color: #D0D1D2;
}
html[data-theme="light"] .tesla-tab.active,
html[data-theme="light"] .segmented__item.active {
  color: #fff;
  background: var(--accent);
}
html[data-theme="light"] .action-btn {
  border-color: #D0D1D2;
  color: #757575;
}

/* ---------- System page ---------- */
.sys-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) {
  .sys-layout { grid-template-columns: 1fr; }
}
.sys-col { display: flex; flex-direction: column; gap: 16px; }
.sys-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sys-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--border-hair);
  font-size: 13px;
}
.sys-list li:last-child { border-bottom: none; }
.sys-list li span {
  color: var(--text-muted);
  font-weight: 500;
}
.sys-list li b {
  color: var(--text-primary);
  font-family: var(--font-bold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.sys-health {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: #3ddc84;
}
.sys-health__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 8px rgba(61, 220, 132, 0.55);
}
.sys-health.is-bad { color: var(--danger); }
.sys-health.is-bad .sys-health__dot {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(240, 71, 95, 0.55);
}
.sys-table-wrap { overflow-x: auto; }
.sys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.sys-table th {
  text-align: left;
  color: var(--text-faint);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-hair);
}
.sys-table td {
  padding: 9px 10px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-hair);
  font-variant-numeric: tabular-nums;
}
.sys-table tr:last-child td { border-bottom: none; }
.sys-table__ip {
  color: var(--accent);
  font-weight: 600;
}
.sys-mon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 700px) {
  .sys-mon-grid { grid-template-columns: 1fr; }
}
.sys-mon-card {
  border: 1px solid var(--border-hair);
  border-radius: 10px;
  background: var(--bg-input);
  padding: 12px 12px 8px;
}
.sys-mon-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.sys-mon-card__head b {
  font-family: var(--font-bold);
  font-size: 13px;
  color: var(--text-primary);
  letter-spacing: 0;
}
.sys-spark {
  width: 100%;
  height: 72px;
  display: block;
}

/* ---------- Settings form ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
@media (max-width: 800px) {
  .settings-grid { grid-template-columns: 1fr; }
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.settings-field input[type="text"],
.settings-field input[type="password"],
.settings-field input[type="number"],
.settings-field input[type="email"] {
  -webkit-appearance: none;
  appearance: none;

  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 12px;
  outline: none;
  box-sizing: border-box;
}
.settings-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.settings-field--check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding-top: 22px;
}
.settings-field--check input { width: auto; accent-color: var(--accent); }
.settings-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.settings-input-row input { flex: 1; }
.settings-input-row .action-btn {
  flex-shrink: 0;
  padding: 10px 12px;
  white-space: nowrap;
}
.settings-hint {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-faint);
}
.settings-hint b { color: var(--text-muted); font-weight: 600; }
.settings-optional {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.settings-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.settings-actions-row--main {
  margin: 4px 0 8px;
}
#connModeTabs {
  width: 100%;
  max-width: 480px;
}
#connModeTabs .tesla-tab { min-width: 0; }
html[data-theme="light"] .settings-field input {
  border-color: #D0D1D2;
}

.settings-field--wide { grid-column: 1 / -1; }
.settings-field__hint {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.settings-field__hint.is-ok { color: #3ddc84; }
.settings-field__hint.is-bad { color: var(--danger); }
.settings-field em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
  font-size: 11px;
}
.settings-hint code {
  font-family: var(--font-body);
  font-size: 11.5px;
  background: var(--bg-input);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-muted);
}

details.settings-advanced {
  padding-top: 8px;
}
details.settings-advanced[open] summary {
  margin-bottom: 12px;
}
details.settings-advanced summary::-webkit-details-marker { display: none; }


.settings-fetch-aes {
  margin-top: 16px;
  padding: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: var(--bg-input);
}
.settings-fetch-aes__title {
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.settings-field select {
  width: 100%;
  background: var(--bg-void);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 11px 12px;
  outline: none;
}


/* Dev mode — canto discreto no fundo das definições */
.settings-dev-foot {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid var(--border-hair);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.45;
  transition: opacity 0.15s;
}
.settings-dev-foot:hover { opacity: 0.85; }
.settings-dev-foot__row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-faint);
  cursor: pointer;
  user-select: none;
}
.settings-dev-foot__row input {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
  cursor: pointer;
}
.settings-dev-foot__hint {
  font-size: 10.5px;
  color: var(--text-faint);
}


/* Topbar signal icons — estado real */
.ov-topbar__icons .tesla-ico {
  opacity: 0.28;
  transition: opacity 0.2s, color 0.2s;
  color: var(--text-muted);
}
.ov-topbar__icons .tesla-ico.is-on {
  opacity: 1;
  color: var(--text-primary);
}
.ov-topbar__icons .tesla-ico.is-weak {
  opacity: 0.55;
  color: var(--warn);
}
.ov-topbar__icons .tesla-ico.is-off {
  opacity: 0.25;
  color: var(--text-faint);
}

/* Lang switcher */
.lang-switch {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-hair);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 8px;
  cursor: pointer;
  margin-left: 4px;
}
.lang-switch:hover { color: var(--text-primary); border-color: var(--border-strong); }

/* Login page — polished */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 70% -10%, rgba(0, 90, 255, 0.12), transparent 55%),
    radial-gradient(700px 400px at 10% 110%, rgba(76, 141, 255, 0.06), transparent 50%),
    var(--bg-void);
}
.login-card {
  width: min(400px, 100%);
  padding: 32px 28px 28px;
  border-radius: var(--radius-lg);
}
.login-card__brand {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.login-card__brand img {
  height: 28px;
  width: auto;
}
.login-card__title {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 20px;
  text-align: center;
  margin: 0 0 6px;
  color: var(--text-primary);
}
.login-card__sub {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 22px;
}
.login-card label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.login-card input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.login-card input:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.login-card button[type="submit"] {
  width: 100%;
  margin-top: 6px;
  background: var(--cta);
  border: 1px solid var(--cta);
  color: var(--cta-contrast);
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 14px;
  padding: 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.login-card button[type="submit"]:hover {
  background: var(--cta-strong);
  border-color: var(--cta-strong);
}
.login-error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(240,71,95,0.3);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  padding: 10px 12px;
  margin-bottom: 14px;
  text-align: center;
}
.login-card__foot {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
}
.login-lang {
  position: absolute;
  top: 18px;
  right: 18px;
}


/* Sidebar user card */
.sidebar-user {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hair);
  background: var(--bg-input);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
}
html[data-sidebar="collapsed"] .sidebar:hover .sidebar-user,
html[data-sidebar="pinned"] .sidebar-user {
  display: flex;
}
.sidebar-user__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; background: var(--accent-soft);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--accent);
  overflow: hidden;
}
.sidebar-user__avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user__meta { min-width: 0; flex: 1; }
.sidebar-user__name {
  font-size: 12.5px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user__role {
  font-size: 10.5px; color: var(--text-faint);
  text-transform: capitalize;
}
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.user-card {
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.user-card__top { display: flex; align-items: center; gap: 12px; }
.user-card__avatar {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent); overflow: hidden; flex-shrink: 0;
}
.user-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }


.nav-map-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: calc(100% - 24px);
}
.nav-map-toolbar input[type="search"] {
  min-width: 180px;
  background: var(--bg-input);
  border: 1px solid var(--border-hair);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
}
.nav-map-toolbar select {
  background: var(--bg-input);
  border: 1px solid var(--border-hair);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 8px 10px;
}
.nav-route-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-hair);
}


/* Navegação — mapa alto, sem sobrepor sidebar */
.nav-layout {
  grid-template-columns: 1fr 300px !important;
  align-items: stretch !important;
  flex: 1 1 auto;
  min-height: 0;
}
.main:has(.nav-layout) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
  overflow-x: hidden;
}
.nav-layout__map {
  min-width: 0; /* evita overflow grid sobre a sidebar */
}
.nav-map-panel {
  padding: 0 !important;
  overflow: hidden !important;
  position: relative;
  isolation: isolate;
  z-index: 1;
  height: calc(100vh - 120px);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}
.nav-map-el {
  flex: 1 1 auto;
  width: 100%;
  height: 100% !important;
  min-height: 0;
  background: var(--bg-void);
  z-index: 0;
  position: relative;
}
/* Leaflet panes ficam dentro do panel — nunca acima da sidebar */
.nav-map-panel .leaflet-pane,
.nav-map-panel .leaflet-top,
.nav-map-panel .leaflet-bottom {
  z-index: auto;
}
.nav-map-panel .leaflet-container {
  width: 100%;
  height: 100%;
  z-index: 0 !important;
  background: var(--bg-void);
}
.nav-map-toolbar {
  z-index: 10 !important;
}
.nav-route-bar {
  z-index: 10 !important;
}
.sidebar {
  z-index: 2000 !important;
}
.sidebar-edge-toggle {
  z-index: 2010 !important;
}


.joystick-dual {
  display: flex;
  gap: 28px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}
.joystick-label {
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}


.joystick-panel {
  max-width: 420px;
}
.joystick-panel .joystick-base {
  width: 120px !important;
  height: 120px !important;
}
.joystick-dual {
  gap: 18px !important;
}


.robot-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.robot-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255,255,255,.08));
  background: var(--bg-elevated, rgba(255,255,255,.03));
}
.robot-card.is-active {
  border-color: #005AFF;
  box-shadow: 0 0 0 1px rgba(0,90,255,.35);
}
.robot-card__meta {
  flex: 1 1 180px;
  min-width: 0;
}
.robot-card__meta b {
  display: block;
  font-size: 14px;
}
.robot-card__meta span {
  font-size: 12px;
  color: var(--text-muted, #888);
}
.robot-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.robot-card__actions button {
  font-size: 12px;
  padding: 7px 12px;
}
.robot-card .badge-on {
  font-size: 10px;
  font-weight: 700;
  color: #25cb55;
  letter-spacing: .04em;
}
.robot-card .badge-off {
  font-size: 10px;
  font-weight: 700;
  color: #888;
}


/* ---- Joints split left / center robot / right ---- */
.ov-viewport__body--split {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 220px) 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
}
.ov-joint-list--left,
.ov-joint-list--right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 420px;
  overflow-y: auto;
  font-size: 11px;
}
.ov-joint-list--left .ov-joint-row__name { text-align: right; }
.ov-viewport__robot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ov-viewport__robot-img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}
