/* TODA INTERNET (base MAXINET): menu lateral de ícones, área clara, painel inicial em cards. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap");

:root {
  --color1: #ddd0ee;
  --color2: #9d86bd;
  --color3: #f8f4fd;
  --color4: #4b1f7a;
  --color5: #2a1145;
  --mx-navy: #1e0b36;
  --mx-blue: #4b1f7a;
  --mx-blue-dark: #36145a;
  --mx-page: #ece4f6;
  --mx-rail: #f6f1fc;
  --mx-card: #f6f1fc;
  --mx-card-in: #ebe2f6;
  --mx-line: #ded2ee;
  --mx-text: #1f2d3d;
  --mx-muted: #5d6b79;
  --mx-green: #3ddc84;
  --mx-green-soft: #d3f5e3;
  --mx-sky: #b78cf0;
  --mx-orange: #ff8a3d;
  --mx-bar: #6a35a8;
  --mx-track: #dfe5ea;
}

body,
input,
button,
select,
option,
textarea {
  font-family: "Noto Sans", "Segoe UI", Roboto, sans-serif;
}

body {
  display: grid !important;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: 100vh;
  height: 100vh;
  overflow: hidden;
  background: var(--mx-rail);
  color: var(--mx-text);
}

/* ---------- Menu lateral (ícones) ---------- */

#header {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  overflow: visible;
  background: var(--mx-rail) !important;
  border-bottom: 0 !important;
  color: var(--mx-text);
  position: relative;
}

#header > .logo {
  padding: 0;
  margin: 8px 0 22px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff url("/brand/icon.png") center / cover no-repeat;
  box-shadow: 0 1px 3px rgba(20, 40, 60, 0.18);
  overflow: hidden;
}

#header > .logo > img,
#header > .logo > .version {
  display: none;
}

#header > nav {
  position: static;
  display: block;
  margin: 0;
}

#header > nav > ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  width: auto;
}

#header > nav > ul > li {
  display: block;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

#header > nav > ul > li > a,
#header > nav > ul > li > a:visited,
#header > nav > ul > li > a:hover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 0;
  padding: 0;
  box-sizing: border-box;
  color: transparent !important;
  background: none !important;
  font-size: 0;
  text-decoration: none;
  border-radius: 8px;
}

#header > nav > ul > li.active > a,
#header > nav > ul > li > a:hover {
  background: #dfe6ec !important;
}

#header > nav > ul > li > a::before {
  content: "";
  width: 20px;
  height: 20px;
  background: #3d4d5c;
  -webkit-mask: var(--mx-icon) center / contain no-repeat;
  mask: var(--mx-icon) center / contain no-repeat;
}

#header > nav > ul > li.active > a::before {
  background: var(--mx-text);
}

/* Rótulo ao passar o mouse */
#header > nav > ul > li > a::after {
  position: absolute;
  left: 44px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 9px;
  border-radius: 6px;
  background: #22313f;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 40;
}

#header > nav > ul > li > a:hover::after {
  opacity: 1;
}

#header > nav a[href="#!/overview"] {
  --mx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M3 11 12 3.5 21 11'/%3E%3Cpath d='M5.5 9.5V20h4.5v-5.5h4V20h4.5V9.5'/%3E%3C/svg%3E");
}
#header > nav a[href="#!/devices"],
#header > nav a[href="/visao"] {
  --mx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='13' width='18' height='7' rx='2'/%3E%3Cpath d='M7 16.5h.01M11 16.5h.01M12 13V9'/%3E%3Cpath d='M8.5 7.5a5 5 0 0 1 7 0M6 5a8.5 8.5 0 0 1 12 0'/%3E%3C/svg%3E");
}
#header > nav a[href="#!/faults"] {
  --mx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 6.5a4 4 0 0 0-5.3 5.1L3.5 17.3a1.8 1.8 0 0 0 2.5 2.5l5.7-5.7a4 4 0 0 0 5.1-5.3l-2.6 2.6-2.3-.4-.4-2.3z'/%3E%3Cpath d='M18 15v6M15 18h6'/%3E%3C/svg%3E");
}
#header > nav a[href="#!/admin"] {
  --mx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E");
}
#header > nav a[href="#!/overview"]::after { content: "Painel"; }
#header > nav a[href="#!/devices"]::after { content: "Dispositivos"; }
#header > nav a[href="#!/devices-x"]::after,
#header > nav a[href="/visao"]::after { content: "Equipamentos"; }
#header > nav a[href="#!/faults"]::after { content: "Falhas"; }
#header > nav a[href="#!/admin"]::after { content: "Sistema"; }

#mx-rail-bottom {
  margin: auto 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #3d4d5c;
}
#mx-rail-bottom:hover { background: #dfe6ec; }
#mx-rail-bottom svg { width: 20px; height: 20px; }

/* Menu de usuário original: oculto (substituído pela barra superior) */
#header > .user-menu {
  display: none !important;
}

#header > .drawer-wrapper {
  position: fixed;
  z-index: 30;
  width: min(720px, calc(100vw - 120px));
  margin-left: 0;
  left: 80px;
  top: 52px;
}

/* ---------- Barra superior ---------- */

#mx-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 64px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 14px 0 0;
  z-index: 25;
  pointer-events: none;
}

#mx-topbar > * {
  pointer-events: auto;
}

#mx-topbar .mx-assist {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  margin-top: 6px;
  border: 1px solid #c9d3dc;
  border-radius: 999px;
  background: #f7f9fb;
  color: var(--mx-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
#mx-topbar .mx-assist:hover { background: #fff; }
#mx-topbar .mx-assist svg { width: 14px; height: 14px; }

#mx-topbar .mx-avatar {
  width: 26px;
  height: 26px;
  margin-top: 6px;
  border: 0;
  border-radius: 50%;
  background: #ec6f8a;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#mx-topbar .mx-search,
#mx-topbar .mx-usermenu {
  position: absolute;
  top: 40px;
  right: 14px;
  background: #fff;
  border: 1px solid var(--mx-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(20, 40, 60, 0.16);
}
#mx-topbar [hidden] { display: none !important; }

#mx-topbar .mx-search {
  width: min(420px, calc(100vw - 100px));
  padding: 10px;
}
#mx-topbar .mx-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  font-size: 14px;
}
#mx-topbar .mx-results a {
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: 8px;
  align-items: center;
  padding: 8px 6px;
  border-radius: 8px;
  color: var(--mx-text);
  text-decoration: none;
  font-size: 13px;
}
#mx-topbar .mx-results a:hover { background: #f1f5f9; }
#mx-topbar .mx-results small { grid-column: 2; color: var(--mx-muted); font-size: 12px; }

#mx-topbar .mx-usermenu {
  min-width: 170px;
  padding: 6px;
}
#mx-topbar .mx-usermenu .mx-uname {
  padding: 8px 10px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--mx-line);
  margin-bottom: 4px;
}
#mx-topbar .mx-usermenu a,
#mx-topbar .mx-usermenu button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--mx-text);
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
#mx-topbar .mx-usermenu a:hover,
#mx-topbar .mx-usermenu button:hover { background: #f1f5f9; }

/* ---------- Área de conteúdo ---------- */

#content-wrapper {
  grid-column: 2;
  grid-row: 1;
  height: calc(100vh - 34px);
  margin-top: 34px;
  overflow: auto;
  background: var(--mx-page);
  border-top-left-radius: 14px;
}

#side-menu {
  width: 220px;
  min-width: 220px;
  background: var(--mx-card);
  border-right: 1px solid var(--mx-line);
}

#side-menu > ul > li > a {
  margin: 4px 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--mx-text);
}

#side-menu > ul > li > a:hover,
#side-menu > ul > li.active > a {
  background: #dfe7ef;
  color: var(--mx-blue);
}

#content {
  margin: 18px 22px;
}

h1 {
  color: var(--mx-text);
  font-weight: 700;
}

table.table th {
  color: #5c6b7a;
  background: #f8fafc;
  border-bottom: 1px solid var(--mx-line);
}

table.table.highlight > tbody > tr:hover {
  background: #f3f8fd;
}

:is(input[type="button"], button).primary {
  background: var(--mx-blue) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 8px !important;
}

:is(input[type="button"], button).primary:hover:enabled {
  background: var(--mx-blue-dark) !important;
  color: #fff !important;
}

.CodeMirror,
textarea,
select,
input {
  background: #fff;
  border-color: var(--mx-line);
  border-radius: 8px;
}

/* ---------- Painel inicial ---------- */

html.mx-dash-on #content {
  display: none !important;
}

#mx-dash {
  display: none;
}

html.mx-dash-on #mx-dash {
  display: block;
  padding: 10px 12px 16px;
}

.mx-loading,
.mx-banner {
  margin: 40px auto;
  text-align: center;
  color: var(--mx-muted);
}
.mx-banner {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff4e5;
  color: #8a4b00;
  font-size: 13px;
}

.mx-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(250px, auto);
  gap: 12px;
}

.mx-card {
  position: relative;
  min-width: 0;
  padding: 14px 16px;
  background: var(--mx-card);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(20, 40, 60, 0.06);
  color: var(--mx-text);
  font-size: 13px;
}

.mx-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
}

.mx-card-head h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.mx-i svg {
  width: 13px;
  height: 13px;
  color: #98a5b1;
  vertical-align: -1px;
}
.mx-i.dark svg { color: #33414e; }

.mx-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aab5bf;
}
.mx-dot.on { background: var(--mx-green); }
.mx-dot.off { background: #aab5bf; }

.mx-empty {
  color: var(--mx-muted);
  font-size: 13px;
  padding: 10px 0;
}
.mx-empty.pad { padding: 30px 10px; text-align: center; }

.mx-progress {
  height: 9px;
  border-radius: 99px;
  background: var(--mx-track);
  overflow: hidden;
}
.mx-progress > div {
  height: 100%;
  border-radius: 99px;
}
.mx-progress.green > div { background: var(--mx-green); }
.mx-progress.blue > div { background: #5b2a94; }

/* Status */
.mx-bignums {
  display: flex;
  justify-content: space-around;
  margin: 8px 0 10px;
  text-align: center;
}
.mx-bignums b {
  display: block;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
}
.mx-bignums small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--mx-muted);
  font-size: 12px;
}
.mx-warn svg { width: 15px; height: 15px; vertical-align: -2px; }
.mx-status .mx-progress { margin: 0 8% 14px; }
.mx-sub {
  text-align: center;
  color: var(--mx-muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.mx-vchart,
.mx-rchart {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mx-vlabel {
  color: #33414e;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
}
.mx-vbars {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 56px;
}
.mx-vbar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-radius: 99px;
  background: var(--mx-green-soft);
  overflow: hidden;
}
.mx-vbar > div {
  width: 100%;
  border-radius: 99px;
  background: var(--mx-green);
}
.mx-avgline {
  position: absolute;
  left: -4px;
  right: -4px;
  height: 1px;
  background: rgba(40, 60, 80, 0.35);
  pointer-events: none;
  z-index: 1;
}

/* Rede */
.mx-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--mx-card-in);
}
.mx-tabs button {
  border: 0;
  padding: 5px 16px;
  border-radius: 8px;
  background: none;
  color: #33414e;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.mx-tabs button.on {
  background: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(20, 40, 60, 0.1);
}
.mx-net-body {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.mx-pct {
  text-align: center;
}
.mx-pct b {
  display: block;
  font-size: 32px;
  font-weight: 600;
}
.mx-pct b small {
  font-size: 14px;
}
.mx-pct span {
  display: block;
  color: var(--mx-muted);
  font-size: 12px;
  margin: 2px 0 14px;
}
.mx-pct .mx-progress {
  height: 6px;
  width: 80%;
  margin: 0 auto;
}
.mx-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  border-radius: 10px;
  background: var(--mx-card-in);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
}
.mx-ok { color: #5b2a94; display: inline-flex; }
.mx-ok svg { width: 16px; height: 16px; }
.mx-box {
  padding: 12px 8px;
  border-radius: 10px;
  background: var(--mx-card-in);
  text-align: center;
}
.mx-box-t {
  color: var(--mx-muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.mx-trio {
  display: flex;
  justify-content: space-around;
}
.mx-trio b {
  display: block;
  font-size: 20px;
  font-weight: 600;
}
.mx-trio small {
  color: var(--mx-muted);
  font-size: 11px;
}
.mx-red { color: #d33; }

/* Resumo */
.mx-spark { display: inline-flex; color: #3d4d5c; }
.mx-spark svg { width: 18px; height: 18px; }
.mx-ago {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--mx-muted);
  font-size: 12px;
}
.mx-ago svg { width: 12px; height: 12px; }
.mx-ai-text {
  margin-top: 8px;
  max-height: 120px;
  overflow: auto;
  padding-right: 6px;
  line-height: 2;
  font-size: 12.5px;
  color: #2c3a47;
}
.mx-ai-fb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-left: 6px;
  color: #3d4d5c;
  font-size: 12px;
}
.mx-ai-fb button {
  display: inline-flex;
  padding: 3px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #3d4d5c;
  cursor: pointer;
}
.mx-ai-fb button:hover { background: var(--mx-card-in); }
.mx-ai-fb svg { width: 13px; height: 13px; }

/* Cards com esquerda/direita */
.mx-split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: center;
  height: calc(100% - 30px);
}
.mx-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.mx-left small {
  color: var(--mx-muted);
  font-size: 12px;
  margin-bottom: 18px;
}
.mx-right h4 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}
.mx-topuser {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
}
.mx-topuser b { font-weight: 600; }
.mx-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ec6f8a;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.mx-mid {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}
.mx-mid.big { font-size: 32px; }
.mx-model {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.mx-model.sm { margin-top: 14px; }

.mx-hbars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mx-hbar {
  position: relative;
  height: 20px;
  border-radius: 99px;
  background: var(--mx-track);
  overflow: hidden;
}
.mx-hbar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 99px;
}
.mx-hbars.sky .mx-hbar-fill { background: var(--mx-sky); }
.mx-hbars.orange .mx-hbar-fill { background: var(--mx-orange); }
.mx-hbar span {
  position: relative;
  display: block;
  padding: 0 8px;
  line-height: 20px;
  font-size: 11.5px;
  font-weight: 500;
  color: #17222d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Resets */
.mx-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--mx-card-in);
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.mx-note span { display: inline-flex; color: var(--mx-green); }
.mx-note svg { width: 17px; height: 17px; flex: none; }
.mx-note.bad { background: #fde9dc; }
.mx-rbars {
  position: relative;
  flex: 1;
  display: flex;
  gap: 8px;
  height: 116px;
}
.mx-rcol {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mx-rbar {
  width: 16px;
  flex: 1;
  display: flex;
  align-items: flex-end;
  border-radius: 99px;
  background: var(--mx-track);
  overflow: hidden;
}
.mx-rbar > div {
  width: 100%;
  border-radius: 99px;
  background: var(--mx-bar);
}
.mx-rcol small {
  color: var(--mx-muted);
  font-size: 11px;
}
.mx-resets .mx-avgline { left: -6px; right: -6px; }

/* Histórico */
.mx-hist { grid-column: 1; }
.mx-hist .mx-tabs button { padding: 7px 14px; }
.mx-table-wrap {
  max-height: 190px;
  overflow: auto;
  margin-top: 8px;
}
.mx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.mx-table th {
  position: sticky;
  top: 0;
  background: var(--mx-card);
  padding: 8px 6px;
  text-align: left;
  font-weight: 500;
  color: #3d4d5c;
  border-bottom: 1px solid var(--mx-line);
}
.mx-table td {
  padding: 10px 6px;
  vertical-align: middle;
}
.mx-table tbody tr { cursor: pointer; }
.mx-table tbody tr:hover { background: #e5ebf0; }
.mx-star {
  display: inline-flex;
  padding: 2px;
  border: 0;
  background: none;
  color: #a7b2bc;
  cursor: pointer;
}
.mx-star svg { width: 15px; height: 15px; fill: none; }
.mx-star.on { color: #f0a500; }
.mx-star.on svg { fill: currentColor; }

@media (max-width: 1400px) {
  .mx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mx-hist { grid-column: 1 / -1; }
}

@media (max-width: 800px) {
  .mx-grid { grid-template-columns: minmax(0, 1fr); }
  .mx-net-body,
  .mx-split { grid-template-columns: minmax(0, 1fr); }
}

/* Acesso */
body:has(#content.page-login) #header > .user-menu {
  display: none;
}

body:has(#content.page-login) #content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

body:has(#content.page-login) #content.page-login {
  flex-grow: 0;
  width: min(440px, calc(100vw - 100px));
  min-height: 0;
  margin: 24px auto;
  padding: 32px 32px 20px;
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(11, 35, 71, 0.08);
  box-sizing: border-box;
}

body:has(#content.page-login) #content.page-login::after {
  content: none;
  padding: 0;
}

#content.page-login h1 {
  margin: 0 0 6px;
  font-size: 0;
  line-height: 0;
  text-align: left;
}

#content.page-login h1::after {
  content: "Acesso ao sistema";
  display: block;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--mx-navy);
}

#content.page-login form::before {
  content: "Informe usuário e senha para entrar.";
  display: block;
  margin: 0 0 18px;
  color: #607089;
  font-size: 14px;
  line-height: 1.4;
}

#content.page-login form p {
  margin: 0 0 14px;
}

#content.page-login label[for="username"],
#content.page-login label[for="password"] {
  display: block;
  font-size: 0 !important;
  line-height: 0;
}

#content.page-login label[for="username"]::after,
#content.page-login label[for="password"]::after {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #607089;
}

#content.page-login label[for="username"]::after { content: "Usuário"; }
#content.page-login label[for="password"]::after { content: "Senha"; }

#content.page-login input[type="text"],
#content.page-login input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 11px 12px !important;
  border: 1px solid #cfd8e3 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #2a1145 !important;
  font-size: 15px;
}

#content.page-login input:focus {
  border-color: var(--mx-blue) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

#content.page-login button.primary {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px !important;
  border-radius: 8px !important;
  background: var(--mx-blue) !important;
  color: transparent !important;
  font-size: 0;
}

#content.page-login button.primary::after {
  content: "Entrar";
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

#content.page-login button.primary:hover:enabled {
  background: var(--mx-blue-dark) !important;
  color: transparent !important;
}

#content.page-login > a {
  display: block;
  margin-top: 8px;
  font-size: 0;
  line-height: 0;
  text-align: center;
  background: none !important;
}

#content.page-login > a::after {
  content: "Alterar senha";
  font-size: 13px;
  line-height: 1.4;
  color: var(--mx-blue);
}

body:has(#content.page-login) #content-wrapper::after {
  content: "TODA INTERNET";
  display: block;
  margin: 0 0 24px;
  color: #7b8ba0;
  font-size: 12px;
  text-align: center;
}

#header .notification.error {
  color: #3a1214;
}


/* Ajustes finos do painel */
.mx-card-head h3 { white-space: nowrap; }
.mx-hist .mx-card-head h3 .mx-i { display: none; }
.mx-hist .mx-tabs button { white-space: nowrap; padding: 6px 12px; font-size: 12px; }
.mx-right h4 .mx-i { margin-left: 6px; }
.mx-table td:nth-child(4),
.mx-table td:nth-child(5),
.mx-table th { white-space: nowrap; }
.mx-table td:first-child,
.mx-table th:first-child { width: 14px; padding-right: 0; }
.mx-left .mx-topuser + small { margin-top: 2px; }
.mx-card { overflow: hidden; }
.mx-card-head { flex-wrap: wrap; row-gap: 6px; }
.mx-rbars { gap: 4px; }
.mx-rbar { width: 14px; }

/* ---------- Dispositivos (lista) ---------- */

html.mx-devs-on #content { display: none !important; }
#mx-devs { display: none; }
html.mx-devs-on #mx-devs {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  padding: 10px 12px 12px;
}

.mx-dh {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 12px;
}
.mx-dh h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--mx-text);
}
.mx-dh p {
  margin: 1px 0 0;
  color: var(--mx-muted);
  font-size: 12.5px;
}
.mx-dh-actions {
  display: flex;
  gap: 8px;
}
.mx-popwrap { position: relative; }

.mx-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f4f7f9;
  color: var(--mx-text);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.mx-btn:hover { background: #fff; }
.mx-btn.icon { width: 32px; padding: 0; justify-content: center; }
.mx-btn svg { width: 15px; height: 15px; fill: none; }
.mx-btn.on { color: var(--mx-blue); border-color: #b9d3ee; background: #fff; }
.mx-btn.icon.on svg { fill: #f0a500; color: #f0a500; }
.mx-btn.outline {
  height: 28px;
  border-color: #5b2a94;
  background: #fff;
  color: #1e6fae;
  font-size: 12.5px;
}
.mx-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  border-radius: 99px;
  background: var(--mx-blue);
  color: #fff;
  font-size: 11px;
}

.mx-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 200px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--mx-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(20, 40, 60, 0.16);
  font-size: 13px;
}
.mx-pop label {
  display: block;
  margin: 4px 4px 10px;
  color: var(--mx-muted);
  font-size: 12px;
}
.mx-pop select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 7px 8px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  color: var(--mx-text);
  font-size: 13px;
}
.mx-pop-filters { width: 240px; }
.mx-pop-views button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--mx-text);
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}
.mx-pop-views button:hover { background: #f1f5f9; }
.mx-pop-views button.on { background: #e7f0fb; color: var(--mx-blue); font-weight: 600; }
.mx-pop-t {
  margin: 4px 6px 6px;
  color: var(--mx-muted);
  font-size: 12px;
  font-weight: 600;
}
.mx-pop label.mx-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px;
  border-radius: 6px;
  color: var(--mx-text);
  font-size: 13px;
  cursor: pointer;
}
.mx-pop label.mx-check:hover { background: #f1f5f9; }
.mx-link {
  border: 0;
  background: none;
  color: var(--mx-blue);
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px;
}

.mx-dt-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 10px;
  background: var(--mx-card);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(20, 40, 60, 0.06);
}
.mx-dt-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.mx-dt-search {
  display: flex;
  align-items: center;
  width: min(400px, 100%);
  height: 28px;
  border-radius: 6px;
  background: var(--mx-card-in);
}
.mx-select {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 150px;
  height: 100%;
  padding: 0 10px;
  box-sizing: border-box;
  border-right: 1px solid #d3dbe2;
  color: #3d4d5c;
  font-size: 12px;
  cursor: pointer;
}
.mx-select svg { width: 14px; height: 14px; }
.mx-select select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.mx-dt-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: #7d8a96;
}
.mx-dt-input svg { width: 13px; height: 13px; flex: none; }
.mx-dt-input input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  padding: 0;
  color: var(--mx-text);
  font-size: 12px;
  outline: none;
  box-shadow: none;
}

.mx-dt-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.mx-dt {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #2c3a47;
}
.mx-dt th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 8px;
  background: var(--mx-card);
  border-bottom: 1px solid #cdd6de;
  text-align: left;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--mx-text);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.mx-dt th + th:not(.mx-dt-dot) { border-left: 1px solid #d9e0e6; }
.mx-dt th.asc::after { content: " ▲"; font-size: 8px; color: #7d8a96; }
.mx-dt th.desc::after { content: " ▼"; font-size: 8px; color: #7d8a96; }
.mx-dt td {
  padding: 6px 8px;
  border-bottom: 1px solid #e0e6eb;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mx-dt td.mono {
  font-family: "Consolas", "DejaVu Sans Mono", monospace;
  font-size: 11px;
}
.mx-dt tbody tr { cursor: pointer; }
.mx-dt tbody tr:hover { background: #e3e9ee; }
.mx-dt .mx-dt-dot {
  width: 14px;
  padding-left: 10px;
  padding-right: 4px;
  cursor: default;
}
.mx-dt .mx-dot { width: 9px; height: 9px; vertical-align: middle; }
.mx-dt .mx-dot.off { background: #b7c0c8; }
.mx-dt-empty td { padding: 30px; text-align: center; color: var(--mx-muted); cursor: default; }
.mx-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 7px;
  border-radius: 99px;
  background: #dbe8f5;
  color: #1e5f96;
  font-size: 11px;
}

.mx-dt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 0;
  color: var(--mx-muted);
  font-size: 12px;
}
.mx-pager { display: flex; gap: 6px; }
.mx-pager button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: var(--mx-card-in);
  color: #3d4d5c;
  cursor: pointer;
}
.mx-pager button:disabled { opacity: 0.45; cursor: default; }
.mx-pager svg { width: 14px; height: 14px; }

@media (max-width: 800px) {
  .mx-dh { flex-direction: column; }
  .mx-dt-tools { flex-direction: column; align-items: stretch; }
  .mx-dt-search { width: 100%; }
}
html.mx-devs-on #mx-devs,
html.mx-dash-on #mx-dash { flex: 1 1 auto; width: 100%; min-width: 0; }
.mx-dt-card, .mx-dt-wrap { min-width: 0; max-width: 100%; }
.mx-dt td { padding: 5px 8px; }

/* ---------- Detalhe do dispositivo ---------- */

html.mx-det-on #content { display: none !important; }
#mx-det { display: none; }
html.mx-det-on #mx-det {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
}
.mx-muted { color: var(--mx-muted); }

.mx-det-head {
  flex: none;
  margin: 8px 10px 0;
  padding: 10px 16px 0;
  background: var(--mx-card);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(20, 40, 60, 0.06);
}
.mx-det-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mx-back {
  display: inline-flex;
  color: #5d6b79;
  margin-right: -6px;
}
.mx-back svg { width: 18px; height: 18px; }
.mx-det-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid #1e9a78;
  border-radius: 9px;
  color: #1f2d3d;
  background: #fff;
}
.mx-det-ic svg { width: 22px; height: 22px; }
.mx-det-title { flex: 1; min-width: 0; font-size: 13px; }
.mx-det-title b { font-weight: 600; font-size: 13.5px; }
.mx-det-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 3px;
  font-size: 11.5px;
}
.mx-det-meta span { display: inline-flex; align-items: center; gap: 4px; }
.mx-det-meta svg { width: 12px; height: 12px; }
.mx-det-meta code { font-family: "Consolas", "DejaVu Sans Mono", monospace; font-size: 11px; }
.mx-det-right { display: flex; align-items: center; gap: 12px; }
.mx-det-live {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-right: 14px;
  border-right: 1px solid var(--mx-line);
  font-size: 11px;
  font-weight: 600;
}
.mx-det-live span { display: inline-flex; align-items: center; gap: 4px; }
.mx-det-live svg { width: 11px; height: 11px; }
.mx-det-live.on { color: #24b36b; }
.mx-det-live.off { color: #c0392b; }
.mx-det-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #6a35a8;
  color: #fff;
  cursor: pointer;
}
.mx-det-refresh svg { width: 16px; height: 16px; }
.mx-det-more {
  display: inline-flex;
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #33414e;
  cursor: pointer;
}
.mx-det-more:hover { background: var(--mx-card-in); }
.mx-det-more svg { width: 18px; height: 18px; }
.mx-det-right .mx-pop { min-width: 220px; }

.mx-det-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
}
.mx-det-tabs button {
  padding: 7px 10px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #33414e;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.mx-det-tabs button:hover { color: var(--mx-text); }
.mx-det-tabs button.on { color: #5b2a94; border-bottom-color: #5b2a94; }

.mx-det-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}
.mx-d-row1 {
  display: grid;
  grid-template-columns: minmax(200px, 0.9fr) minmax(220px, 1fr) minmax(300px, 1.9fr) minmax(280px, 1.9fr);
  gap: 10px;
  margin-bottom: 10px;
}
.mx-d-row2 {
  display: grid;
  grid-template-columns: minmax(320px, 1.9fr) minmax(220px, 0.9fr) minmax(260px, 1.4fr) minmax(260px, 1.4fr);
  gap: 10px;
  margin-bottom: 10px;
}
.mx-det-body .mx-card { padding: 12px; }
.mx-wide { margin-bottom: 10px; }
.mx-sec { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.mx-scroll { overflow: auto; }
.mx-scroll.tall { max-height: calc(100vh - 260px); }

/* Tiles */
.mx-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 30px 8px 12px;
  border-radius: 9px;
  background: var(--mx-card-in);
}
.mx-tile.dark { background: #d9e0e7; }
.mx-tile.dim { opacity: 0.55; }
.mx-tile-ic { display: inline-flex; flex: none; color: #33414e; }
.mx-tile-ic svg { width: 17px; height: 17px; }
.mx-tile-tx { min-width: 0; }
.mx-tile-tx b {
  display: block;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mx-tile-tx small { display: block; color: var(--mx-muted); font-size: 11px; }
.mx-copy {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  padding: 3px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #8b98a4;
  cursor: pointer;
}
.mx-copy + .mx-copy { right: 26px; }
.mx-copy:hover { background: rgba(0, 0, 0, 0.06); color: #33414e; }
.mx-copy svg { width: 13px; height: 13px; }

.mx-d-info { display: flex; flex-direction: column; gap: 6px; }
.mx-d-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--mx-card-in);
}
.mx-d-state b { font-size: 12.5px; }
.mx-d-state small { display: block; color: var(--mx-muted); font-size: 11px; }
.mx-d-state.on b { color: #24b36b; }
.mx-d-state.off b { color: #c0392b; }

.mx-d-opt { display: flex; flex-direction: column; gap: 10px; }
.mx-ports { display: flex; justify-content: center; gap: 5px; }
.mx-port {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  border: 1.5px solid #9fd8d0;
  border-radius: 4px;
  color: #6fbfb4;
  background: #f3faf9;
}
.mx-port svg { width: 20px; height: 20px; }
.mx-port.up { background: #3cc0b0; border-color: #3cc0b0; color: #fff; }
.mx-port.fiber { border-color: #9a7fd6; background: #9a7fd6; color: #fff; margin-right: 6px; }
.mx-opt {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: var(--mx-card-in);
}
.mx-opt h4 { margin: 0 0 8px; text-align: center; font-size: 12.5px; font-weight: 500; }
.mx-opt-body { display: flex; align-items: center; gap: 10px; }
.mx-opt-charts { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mx-spark-svg { display: block; width: 100%; height: 44px; }
.mx-opt-vals { display: flex; flex-direction: column; gap: 10px; }
.mx-opt-vals b { display: block; font-size: 20px; font-weight: 500; }
.mx-opt-vals b small { font-size: 12px; margin-left: 2px; }
.mx-opt-vals b.warn { color: #d98200; }
.mx-opt-vals b.bad { color: #d33; }
.mx-opt-vals span { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--mx-muted); }
.mx-opt-vals span svg { width: 13px; height: 13px; }
.mx-opt-vals span.tx svg { color: #2bb3a3; }
.mx-opt-vals span.rx svg { color: #9a7fd6; }

.mx-wan-box,
.mx-wifi-box {
  padding: 10px;
  border: 1px solid #c9d3dc;
  border-radius: 10px;
}
.mx-wan-head,
.mx-wifi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 10px;
  font-size: 13px;
}
.mx-wan-head > span:first-child,
.mx-wifi-head > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.mx-wan-head svg,
.mx-wifi-head svg { width: 15px; height: 15px; }
.mx-conn { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; }
.mx-conn i { width: 7px; height: 7px; border-radius: 50%; background: #aab5bf; }
.mx-conn.on { color: #24b36b; }
.mx-conn.on i { background: var(--mx-green); }
.mx-conn.off { color: #c0392b; }
.mx-conn.off i { background: #e46a5e; }
.mx-wan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.mx-wan-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mx-d-wan .mx-wan-grid { max-height: 176px; overflow: auto; }

.mx-d-sum { display: flex; flex-direction: column; }
.mx-d-sum .mx-ai-text { flex: 1; max-height: 150px; }
.mx-sum-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.mx-sum-actions button,
.mx-sum-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px;
  border: 0;
  border-radius: 9px;
  background: var(--mx-card-in);
  color: #33414e;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.mx-sum-actions button:hover,
.mx-sum-actions a:hover { background: #d9e0e7; }
.mx-sum-actions svg { width: 13px; height: 13px; }

/* Hosts */
.mx-hosts-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; margin-top: 6px; }
.mx-host-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; padding-right: 4px; }
.mx-host {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--mx-card-in);
}
.mx-host-main { flex: 1; min-width: 0; }
.mx-host-top { display: flex; align-items: center; gap: 6px; }
.mx-host-ic { display: inline-flex; color: #33414e; }
.mx-host-ic svg { width: 16px; height: 16px; }
.mx-host-top b { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-band { padding: 0 5px; border-radius: 4px; background: #d3dbe2; font-size: 10px; }
.mx-host small { display: block; margin: 1px 0 5px 22px; color: var(--mx-muted); font-size: 11px; }
.mx-hchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #d9e0e7;
  font-size: 10.5px;
  font-weight: 500;
}
.mx-hchip svg { width: 11px; height: 11px; }
.mx-hchip.good { color: #16734d; }
.mx-hchip.mid { color: #8a6100; }
.mx-hchip.bad { color: #a5341f; }
.mx-score {
  flex: none;
  width: 70px;
  padding-left: 8px;
  border-left: 1px solid #cfd8e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.mx-score b { font-size: 15px; font-weight: 600; }
.mx-score small { font-size: 10px; color: var(--mx-muted); }
.mx-score.na { color: var(--mx-muted); }
.mx-score-bar {
  position: relative;
  width: 44px;
  height: 4px;
  margin: 3px 0;
  border-radius: 2px;
  background: linear-gradient(90deg, #e2574c, #f0a500 45%, #3cbf7c 75%, #6a35a8);
}
.mx-score-bar i {
  position: absolute;
  top: -5px;
  width: 0;
  height: 0;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: #1f2d3d;
}
.mx-hosts-side h4 { margin: 14px 0 8px; font-size: 12.5px; font-weight: 500; }
.mx-hosts-side h4:first-child { margin-top: 30px; }
.mx-side-row { display: flex; align-items: center; gap: 10px; }
.mx-side-row .mx-spark-svg { width: 90px; height: 36px; flex: none; }
.mx-side-row b { font-size: 26px; font-weight: 500; }
.mx-side-row b small { font-size: 11px; color: var(--mx-muted); font-weight: 400; }
.mx-side-row b.big { font-size: 26px; }
.mx-side-row .mx-score-bar { width: 72px; }
.mx-note-s { display: flex; align-items: center; gap: 5px; margin: 8px 0 0; color: var(--mx-muted); font-size: 11px; font-style: italic; }
.mx-note-s svg { width: 12px; height: 12px; }

/* Diagnósticos */
.mx-diag-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mx-diag {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--mx-card-in);
}
.mx-diag-ic { display: inline-flex; color: #33414e; }
.mx-diag-ic svg { width: 17px; height: 17px; }
.mx-diag-tx { flex: 1; min-width: 0; }
.mx-diag-tx b { display: block; font-size: 12.5px; font-weight: 500; }
.mx-diag-tx small { display: block; margin-top: 3px; font-size: 11px; color: var(--mx-muted); overflow-wrap: anywhere; }
.mx-diag-tx small.ok { color: #16734d; }
.mx-diag-tx small.bad { color: #a5341f; }
.mx-diag-host {
  width: 100%;
  max-width: 150px;
  margin-top: 4px;
  padding: 3px 7px !important;
  border: 1px solid #cdd6de !important;
  border-radius: 6px !important;
  background: #f4f7f9 !important;
  font-size: 11.5px;
}
.mx-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #cfd7df;
  color: #33414e;
  cursor: pointer;
}
.mx-play:hover:enabled { background: #bcc6d0; }
.mx-play svg { width: 14px; height: 14px; margin-left: 2px; }
.mx-spin {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #33414e;
  border-radius: 50%;
  animation: mx-spin 0.8s linear infinite;
}
.mx-spin.light { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
@keyframes mx-spin { to { transform: rotate(360deg); } }

/* Wi-Fi */
.mx-d-wifi .mx-wifi-box { margin-top: 8px; }
.mx-d-wifi h5 { margin: 12px 2px 8px; font-size: 12px; font-weight: 500; }
.mx-wifi-devs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.mx-wdev {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #c9d3dc;
  border-radius: 50%;
  background: var(--mx-card-in);
  color: #33414e;
}
.mx-wdev svg { width: 17px; height: 17px; }
.mx-wdev i { position: absolute; right: 0; bottom: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--mx-green); }

/* Histórico do dispositivo */
.mx-usage h5 { margin: 18px 0 6px; text-align: center; font-size: 12px; font-weight: 500; }
.mx-usage-row { display: flex; align-items: center; justify-content: center; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--mx-line); }
.mx-usage-row:last-child { border-bottom: 0; }
.mx-dbars { display: flex; align-items: flex-end; gap: 3px; height: 46px; }
.mx-dbars div { width: 7px; height: 100%; display: flex; align-items: flex-end; border-radius: 3px; background: #d9e0e7; overflow: hidden; }
.mx-dbars i { width: 100%; border-radius: 3px; }
.mx-dbars.down i { background: #b07fe0; }
.mx-dbars.up i { background: #2cbfa7; }
.mx-dbars div:not(:last-child) i { opacity: 0.8; }
.mx-usage-v b { display: block; font-size: 26px; font-weight: 500; }
.mx-usage-v b small { font-size: 13px; margin-left: 2px; }
.mx-usage-v span { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--mx-muted); }
.mx-usage-v span svg { width: 13px; height: 13px; }
.mx-usage-v span.dn svg { color: #b07fe0; }
.mx-usage-v span.upl svg { color: #2cbfa7; }
.mx-events { max-height: 290px; overflow: auto; margin-top: 8px; }
.mx-ev { display: flex; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--mx-line); font-size: 11.5px; }
.mx-ev span { flex: none; color: var(--mx-muted); }
.mx-ev b { font-weight: 500; }

.mx-portlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mx-dt-input.boxed { height: 28px; min-width: 240px; border-radius: 6px; background: var(--mx-card-in); }
.mx-props .mx-card-head { margin-bottom: 8px; }
.mx-props td { white-space: normal; word-break: break-all; max-width: none; }
.mx-props td.mono { width: 55%; }
.mx-w { color: #5b2a94; font-size: 10px; }
.mx-det-body .mx-dt tbody tr { cursor: default; }

.mx-toast {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: 380px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #22313f;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.mx-toast.bad { background: #8c2f23; }

@media (max-width: 1500px) {
  .mx-d-row1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mx-d-row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .mx-d-row1,
  .mx-d-row2,
  .mx-hosts-body,
  .mx-wan-grid.four { grid-template-columns: minmax(0, 1fr); }
  .mx-det-top { flex-wrap: wrap; }
}
.mx-tile { padding-right: 12px; }
.mx-tile:has(.mx-copy) { padding-right: 30px; }
.mx-tile:has(.mx-copy + .mx-copy) { padding-right: 50px; }
.mx-det-body > .mx-d-row2:has(> .mx-d-diag:first-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Conectividade ---------- */

.mx-conn {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
  min-height: calc(100vh - 170px);
}
.mx-cnav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: var(--mx-card);
  border-radius: 12px;
  align-self: stretch;
}
.mx-cnav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--mx-text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.mx-cnav button:hover { background: var(--mx-card-in); }
.mx-cnav button.on { background: #2f9ce0; color: #fff; }
.mx-cnav svg { width: 16px; height: 16px; flex: none; }

.mx-cpanel {
  min-width: 0;
  padding: 14px 16px;
  background: var(--mx-card);
  border-radius: 12px;
}
.mx-cpanel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.mx-cpanel-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.mx-cpanel-head p { margin: 3px 0 0; color: var(--mx-muted); font-size: 12.5px; }

.mx-utabs {
  display: flex;
  margin: 4px 0 14px;
  border-bottom: 1px solid var(--mx-line);
}
.mx-utabs button {
  flex: 1;
  padding: 9px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: #5d6b79;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.mx-utabs button.on { color: #5b2a94; border-bottom-color: #5b2a94; }

.mx-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fff4e5;
  color: #7a4a00;
  font-size: 12.5px;
}
.mx-hint > svg { width: 15px; height: 15px; flex: none; }
.mx-hint span { flex: 1; }
.mx-banner.bad { background: #fde9e6; color: #8c2f23; margin-bottom: 12px; }

.mx-ccard {
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--mx-card-in);
  overflow: hidden;
}
.mx-ccard-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #d9e0e7;
  cursor: pointer;
}
.mx-ccard:not(.open) .mx-ccard-head { background: var(--mx-card-in); }
.mx-ccard-t { flex: 1; min-width: 0; }
.mx-ccard-t b { display: block; font-size: 13px; font-weight: 600; }
.mx-ccard-t small { display: inline-flex; align-items: center; gap: 4px; color: #3d4d5c; font-size: 12px; }
.mx-ccard-t small svg { width: 12px; height: 12px; }
.mx-chev { display: inline-flex; color: #33414e; }
.mx-chev svg { width: 18px; height: 18px; }
.mx-cloud { display: inline-flex; margin-left: 6px; color: #2bb37a; vertical-align: -2px; }
.mx-cloud svg { width: 14px; height: 14px; }
.mx-cloud.big svg { width: 20px; height: 20px; }
.mx-pill-st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1.5px solid currentColor;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.mx-pill-st i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mx-pill-st.on { color: #1faa6b; }
.mx-pill-st.off { color: #c0392b; }
.mx-pend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #fff1d6;
  color: #8a5a00;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.mx-pend svg { width: 11px; height: 11px; }

.mx-toggle {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: #b7c1ca;
  cursor: pointer;
  transition: background 0.15s;
}
.mx-toggle i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}
.mx-toggle.on { background: #6a35a8; }
.mx-toggle.on i { left: 19px; }
.mx-toggle.unknown { opacity: 0.4; cursor: default; }

.mx-ccard-body { padding: 0 14px; }
.mx-sec-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #cfd8e0;
}
.mx-sec-row:last-child { border-bottom: 0; }
.mx-sec-main { flex: 1; min-width: 0; }
.mx-sec-row h5 { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; }
.mx-kv { color: #3d4d5c; font-size: 12px; line-height: 1.6; }
.mx-kv b { font-weight: 600; color: #33414e; }
.mx-kv em { color: var(--mx-muted); }
.mx-kv.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 20px; }
.mx-kv a { color: #5b2a94; }
.mx-ebtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: #d3dbe2;
  color: #33414e;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.mx-ebtn:hover { background: #c6d0d9; }
.mx-ebtn svg { width: 13px; height: 13px; }
.mx-icbtn {
  display: inline-flex;
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #7d8a96;
  cursor: pointer;
}
.mx-icbtn:hover { background: #fde9e6; color: #c0392b; }
.mx-icbtn svg { width: 15px; height: 15px; }

.mx-eform {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px 14px;
  margin-top: 8px;
}
.mx-f span { display: block; margin-bottom: 4px; color: var(--mx-muted); font-size: 11.5px; font-weight: 500; }
.mx-f input,
.mx-f select {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 9px !important;
  border: 1px solid #c3cdd6 !important;
  border-radius: 7px !important;
  background: #fff !important;
  color: var(--mx-text);
  font-size: 13px;
}
.mx-f input:focus,
.mx-f select:focus { outline: none; border-color: #6a35a8 !important; box-shadow: 0 0 0 3px rgba(30, 143, 214, 0.15); }
.mx-fnote { grid-column: 1 / -1; margin: 0; font-size: 11.5px; }
.mx-eform-act { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.mx-btn.primary { background: #6a35a8; color: #fff; }
.mx-btn.primary:hover { background: #1878b5; }
.mx-btn.primary:disabled { opacity: 0.6; }
.mx-btn.outline svg { width: 14px; height: 14px; }

.mx-topo-wrap { padding: 10px 0; overflow: auto; }
.mx-topo { display: block; width: 100%; min-width: 620px; height: auto; }
.mx-topo rect { fill: #fff; stroke: #c3cdd6; stroke-width: 1.2; }
.mx-topo .inet rect { fill: #e7f0fb; stroke: #7fb3e0; }
.mx-topo .onu rect { fill: #e5f6f1; stroke: #5cc4a8; stroke-width: 1.6; }
.mx-topo .t1 { font-size: 12px; font-weight: 600; fill: #1f2d3d; }
.mx-topo .t2 { font-size: 10.5px; fill: #5d6b79; }
.mx-topo .ln { fill: none; stroke: #9fb0bf; stroke-width: 1.4; }
.mx-topo .ln.wf { stroke-dasharray: 4 3; stroke: #6a35a8; }

@media (max-width: 900px) {
  .mx-conn { grid-template-columns: minmax(0, 1fr); }
  .mx-cnav { flex-direction: row; overflow-x: auto; }
  .mx-cnav button { white-space: nowrap; }
}
.mx-conn { align-items: start; }
.mx-cnav { align-self: stretch; }
.mx-plain { padding: 0 10px; border-radius: 10px; }
.mx-plain .mx-sec-row { border-bottom: 1px solid #cfd8e0; }
.mx-sub-h { margin: 18px 0 10px; font-size: 13px; font-weight: 600; }
.mx-ccard-head.slim { padding: 9px 14px; }
.mx-vsep { width: 1px; height: 20px; background: #b9c4ce; }
.mx-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 6px;
  border: 1.5px solid #e0a100;
  border-radius: 50%;
  color: #c08a00;
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  vertical-align: 1px;
}
.mx-ebtn:disabled { opacity: 0.45; cursor: default; }
.mx-toggle:disabled:not(.unknown) { opacity: 0.5; }
