* {
  box-sizing: border-box;
}

:root {
  --bg: #05070c;
  --panel: #0c111b;
  --panel-2: #101826;
  --panel-3: #151f30;
  --line: #263349;
  --line-strong: #38506f;
  --text: #eef4fb;
  --muted: #9ba9bb;
  --muted-2: #738195;
  --green: #38d47a;
  --green-soft: #113923;
  --cyan: #47b8e8;
  --cyan-soft: #102f42;
  --amber: #f4c95d;
  --amber-soft: #342a12;
  --red: #ef5b72;
  --red-soft: #3b1720;
  --purple: #a88cff;
  --shadow: 0 18px 42px rgba(0, 0, 0, .32);
  --radius: 8px;
}

@keyframes nocFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nocGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(56, 212, 122, .18);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(56, 212, 122, 0);
  }
}

@keyframes nocScan {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes nocStatusBlink {
  0%, 100% {
    opacity: .72;
    transform: scale(.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes nocLogoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes nocLiveFlash {
  0% {
    border-color: rgba(71, 184, 232, .55);
    box-shadow: 0 0 0 rgba(71, 184, 232, 0);
  }
  50% {
    border-color: rgba(71, 184, 232, .95);
    box-shadow: 0 0 24px rgba(71, 184, 232, .16);
  }
  100% {
    border-color: rgba(71, 184, 232, .28);
    box-shadow: 0 0 0 rgba(71, 184, 232, 0);
  }
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(71, 184, 232, .08), transparent 260px),
    linear-gradient(135deg, #05070c 0%, #0b111b 48%, #070b12 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  scroll-behavior: smooth;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .22;
}

a {
  color: inherit;
}

h2,
h3 {
  margin: 0 0 8px;
  color: #fff;
  line-height: 1.2;
}

h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

p {
  line-height: 1.5;
}

.wrap {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 72px;
  animation: nocFadeUp .42s ease both;
}

.login {
  width: min(440px, 100%);
  margin: 9vh auto 0;
}

.topbar,
.hero,
.panel,
.card,
.metric,
.event,
.empty-state {
  background: linear-gradient(180deg, rgba(21, 31, 48, .94), rgba(12, 17, 27, .96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.card:hover,
.metric:hover,
.event:hover,
.company-card-clean:hover,
.home-metrics article:hover {
  transform: translateY(-3px);
  border-color: #466582;
  box-shadow: 0 22px 46px rgba(0, 0, 0, .36);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark,
.icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #09101b;
  border: 1px solid var(--line-strong);
  flex: 0 0 auto;
}

.brand strong,
.title h1 {
  color: #fff;
}

.brand strong {
  display: block;
  font-size: 17px;
}

.brand span,
.muted,
.title p,
.card p,
.event-meta,
.field span,
.metric span {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.hero {
  padding: 22px;
  margin-bottom: 16px;
  border-color: var(--line-strong);
}

.hero-row,
.section-head,
.card-head,
.event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.vpn-card-top,
.vpn-identity {
  display: flex;
  align-items: flex-start;
}

.vpn-card-top {
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(55, 80, 111, .55);
}

.vpn-identity {
  gap: 12px;
  min-width: 0;
}

.vpn-title-copy {
  min-width: 0;
}

.vpn-title-copy h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.vpn-title-copy p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.device-badge {
  width: 58px;
  min-height: 58px;
  border-radius: 10px;
  border: 1px solid #2b405b;
  background: linear-gradient(180deg, #0c1725, #070d16);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
  transition: transform .18s ease, border-color .18s ease;
}

.device-badge img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.device-badge.device-mikrotik {
  background: linear-gradient(180deg, #123026, #071611);
  border-color: rgba(143, 231, 194, .55);
  box-shadow: 0 0 0 1px rgba(143, 231, 194, .08), 0 12px 28px rgba(0, 0, 0, .25);
}

.device-badge.device-mikrotik img,
.device-inline img[src$="mikrotik.svg"] {
  filter: drop-shadow(0 0 8px rgba(143, 231, 194, .35));
}

.device-badge span {
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.card:hover .device-badge {
  transform: translateY(-2px) scale(1.03);
  border-color: #4b789d;
}

.device-inline {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

.device-inline img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.vpn-meta-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.vpn-meta-strip > div {
  min-width: 0;
  padding: 12px;
  background: #09101b;
}

.vpn-meta-strip span,
.vpn-status-panel span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.vpn-meta-strip strong,
.vpn-status-panel strong {
  color: #fff;
  overflow-wrap: anywhere;
}

.vpn-status-panel {
  display: grid;
  grid-template-columns: minmax(100px, .7fr) minmax(120px, .8fr) minmax(120px, .8fr) minmax(0, 1.5fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09101b;
}

.vpn-status-panel.ok {
  border-color: rgba(56, 212, 122, .28);
  background: linear-gradient(90deg, rgba(56, 212, 122, .10), rgba(9, 16, 27, .98));
}

.vpn-status-panel.err {
  border-color: rgba(239, 91, 114, .30);
  background: linear-gradient(90deg, rgba(239, 91, 114, .10), rgba(9, 16, 27, .98));
}

.vpn-status-panel.warn {
  border-color: rgba(244, 201, 93, .30);
  background: linear-gradient(90deg, rgba(244, 201, 93, .10), rgba(9, 16, 27, .98));
}

.vpn-status-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.live-refresh {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 9px 11px;
  border: 1px solid rgba(71, 184, 232, .28);
  border-radius: var(--radius);
  background: rgba(8, 16, 27, .76);
  color: var(--muted);
  font-size: 13px;
}

.live-refresh strong {
  color: #dff7ff;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(56, 212, 122, .12);
  animation: nocStatusBlink 1.8s ease-in-out infinite;
}

.vpn-item.live-updated {
  animation: nocLiveFlash .85s ease;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-list.compact {
  margin-top: 10px;
}

.history-item {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 11px 12px 11px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09101b;
}

.history-item::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 17px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(244, 201, 93, .10);
}

.history-item.ok::before {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(56, 212, 122, .10);
}

.history-item.err::before {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(239, 91, 114, .10);
}

.history-item span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
}

.history-item strong {
  color: #fff;
  line-height: 1.25;
}

.history-item small {
  color: var(--muted);
  line-height: 1.35;
}

.empty-state.small {
  min-height: auto;
  padding: 12px;
  font-size: 13px;
}

.vpn-actions-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.vpn-actions-main form {
  margin: 0;
}

.advanced-actions {
  border-color: rgba(244, 201, 93, .34);
}

.advanced-actions summary {
  color: #ffe09a;
}

.title h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.08;
}

.title p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.toolbar,
.actions,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.actions form,
.toolbar form {
  margin: 0;
}

.toolbar {
  margin-top: 16px;
}

.btn,
button.btn {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 11px 14px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #38d47a, #19a75a);
  color: #04140c;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease;
  font-family: inherit;
  font-size: 14px;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn.secondary,
.btn2 {
  background: #121d2d;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn.blue {
  background: linear-gradient(135deg, #47b8e8, #2478b8);
  color: #fff;
}

.btn.purple {
  background: linear-gradient(135deg, #a88cff, #5b75d6);
  color: #fff;
}

.btn.red,
.danger {
  background: linear-gradient(135deg, #ef5b72, #b92c45);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.card,
.metric,
.event {
  padding: 18px;
}

.panel {
  margin-bottom: 16px;
}

.card,
.metric,
.event {
  margin-bottom: 14px;
}

.metric span,
.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  color: #fff;
  font-size: 28px;
  line-height: 1.1;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
}

.score {
  min-width: 172px;
  text-align: center;
  background: #09101b;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 16px;
}

.score strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.score span {
  color: var(--muted);
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 850;
}

.pill.ok,
.ok {
  background: var(--green-soft);
  color: #7df0aa;
}

.pill.err,
.bad {
  background: var(--red-soft);
  color: #ff99a9;
}

.pill.warn,
.warn {
  background: var(--amber-soft);
  color: #ffdd85;
}

.pill.info {
  background: var(--cyan-soft);
  color: #9bdfff;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(56, 212, 122, .12);
  animation: nocStatusBlink 1.8s ease-in-out infinite, nocGlow 2.2s ease-in-out infinite;
}

.dot.red {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(239, 91, 114, .12);
  animation: nocStatusBlink 2.4s ease-in-out infinite;
}

.dot.yellow {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(244, 201, 93, .12);
  animation: nocStatusBlink 2.1s ease-in-out infinite;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.field-grid.two-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  background: #09101b;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 0;
}

.field strong {
  color: #fff;
  word-break: break-word;
}

input,
select,
textarea,
.input {
  width: 100%;
  background: #080d16;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: #fff;
  padding: 11px 12px;
  font: inherit;
  outline: none;
}

input:focus,
select:focus,
textarea:focus,
.input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(71, 184, 232, .12);
}

label {
  display: block;
  color: #fff;
  font-weight: 800;
  margin-bottom: 10px;
}

details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09101b;
  padding: 10px 12px;
}

summary {
  cursor: pointer;
  color: #dce9f7;
  font-weight: 850;
}

.code,
pre,
.script-box {
  margin: 12px 0 0;
  background: #050811;
  border: 1px solid #1e2b3d;
  border-radius: var(--radius);
  padding: 14px;
  color: #dce9f7;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.script-box {
  min-height: 300px;
}

.notice {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 14px;
  margin-bottom: 14px;
  background: #09101b;
}

.notice.ok {
  border-color: rgba(56, 212, 122, .45);
}

.notice.err {
  border-color: rgba(239, 91, 114, .5);
}

.notice.warn {
  border-color: rgba(244, 201, 93, .5);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.filter {
  border: 1px solid var(--line);
  background: #0a111d;
  color: var(--text);
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 800;
}

.filter.active {
  background: var(--cyan-soft);
  border-color: var(--cyan);
  color: #c8f0ff;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.filter-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.graph-preview {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #050811;
}

.graph-preview img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  padding: 0 10px 4px;
}

.table td {
  background: #09101b;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
}

.table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 7px 0 0 7px;
}

.table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 7px 7px 0;
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.copy-alert {
  display: none;
  margin-top: 10px;
}

.is-hidden {
  display: none !important;
}

/* Painel executivo da empresa */
.company-command,
.whatsapp-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 31, 48, .96), rgba(10, 15, 24, .98));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.company-command::after,
.whatsapp-command::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0, rgba(71, 184, 232, .08) 40%, transparent 70%);
}

.command-copy,
.health-ring,
.whatsapp-command .score {
  position: relative;
  z-index: 1;
}

.command-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.04;
}

.command-copy p {
  max-width: 760px;
  color: var(--muted);
}

.company-signal-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.company-signal-row span {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(71, 184, 232, .18);
  border-radius: var(--radius);
  background: rgba(7, 14, 24, .72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.company-signal-row b {
  display: block;
  margin-bottom: 3px;
  color: #fff;
  font-size: 15px;
}

.company-command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.health-ring {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at center, #08101c 58%, transparent 59%),
    conic-gradient(var(--cyan) var(--score, 0%), rgba(38, 51, 73, .82) 0);
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 160px;
  isolation: isolate;
}

.health-ring strong {
  color: #fff;
  font-size: 44px;
  line-height: 1;
  text-shadow: 0 8px 28px rgba(0, 0, 0, .42);
}

.health-ring small {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 850;
}

.health-ring span {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 850;
}

.health-ring.ok {
  border-color: rgba(56, 212, 122, .45);
  box-shadow: inset 0 0 34px rgba(56, 212, 122, .10);
}

.health-ring.warn {
  border-color: rgba(244, 201, 93, .45);
  box-shadow: inset 0 0 34px rgba(244, 201, 93, .10);
}

.health-ring.err {
  border-color: rgba(239, 91, 114, .45);
  box-shadow: inset 0 0 34px rgba(239, 91, 114, .10);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.service-card {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 31, 48, .94), rgba(12, 17, 27, .96));
  display: grid;
  align-content: start;
  gap: 7px;
}

.service-status-light {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(244, 201, 93, .10);
}

.service-card img,
.service-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07101a;
  padding: 5px;
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9bdfff;
  font-size: 12px;
  font-weight: 900;
}

.service-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.service-card strong {
  color: #fff;
  font-size: 22px;
  line-height: 1.1;
}

.service-card small {
  color: var(--muted-2);
  line-height: 1.35;
}

.service-url {
  margin-top: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(71, 184, 232, .28);
  border-radius: 8px;
  background: rgba(7, 16, 26, .74);
  min-width: 0;
}

.service-url span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.service-url a,
.service-url em {
  display: block;
  color: #9bdfff;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.service-card.ok {
  border-color: rgba(56, 212, 122, .30);
}

.service-card.ok .service-status-light {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(56, 212, 122, .12);
  animation: nocStatusBlink 2.8s ease-in-out infinite;
}

.service-card.warn {
  border-color: rgba(244, 201, 93, .35);
}

.service-card.err {
  border-color: rgba(239, 91, 114, .35);
}

.service-card.err .service-status-light {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(239, 91, 114, .12);
}

.company-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-bottom: 16px;
}

.company-vpn-panel,
.company-side-panel {
  padding: 20px;
}

.mini-vpn-list {
  display: grid;
  gap: 8px;
}

.mini-vpn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09101b;
}

.mini-vpn-row strong {
  color: #fff;
}

.mini-vpn-row span:not(.pill):not(.dot) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.company-side-panel {
  display: grid;
  align-content: start;
  gap: 9px;
}

.zabbix-url-box {
  padding: 12px;
  border: 1px solid rgba(71, 184, 232, .32);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(13, 26, 40, .9), rgba(8, 14, 23, .94));
}

.zabbix-url-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.zabbix-url-box a,
.zabbix-url-box strong {
  color: #9bdfff;
  font-size: 13px;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.side-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09101b;
  color: #fff;
  text-decoration: none;
  font-weight: 850;
}

.side-action:hover {
  border-color: #4b789d;
  transform: translateY(-1px);
}

.side-timeline {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.side-timeline h3 {
  margin: 0 0 2px;
  color: #fff;
  font-size: 15px;
}

/* Central WhatsApp */
.whatsapp-command {
  grid-template-columns: minmax(0, 1fr) 210px;
}

.wa-brand img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.whatsapp-command .score.ok {
  border-color: rgba(56, 212, 122, .45);
  box-shadow: inset 0 0 30px rgba(56, 212, 122, .12);
}

.whatsapp-command .score.warn {
  border-color: rgba(244, 201, 93, .45);
  box-shadow: inset 0 0 30px rgba(244, 201, 93, .10);
}

.whatsapp-command .score.err {
  border-color: rgba(239, 91, 114, .45);
  box-shadow: inset 0 0 30px rgba(239, 91, 114, .10);
}

.whatsapp-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.whatsapp-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.whatsapp-main-card {
  padding: 20px;
}

.whatsapp-fields {
  margin: 14px 0;
}

.group-field {
  grid-column: span 1;
}

.config-details {
  margin-top: 12px;
}

.config-details form,
.setup-box form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.setup-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09101b;
}

.setup-box h3 {
  margin-top: 0;
}

.toolbar.stacked {
  display: grid;
  margin-top: 12px;
}

/* Assistente de criação de empresa */
.company-create-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 31, 48, .96), rgba(10, 15, 24, .98));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.company-create-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0, rgba(56, 212, 122, .09) 44%, transparent 74%);
}

.company-create-hero .command-copy,
.company-create-hero .score {
  position: relative;
  z-index: 1;
}

.company-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.company-create-main,
.company-create-aside {
  padding: 20px;
}

.company-create-main label {
  display: grid;
  gap: 7px;
}

.create-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.create-step h2 {
  margin: 0;
}

.step-badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(71, 184, 232, .45);
  background: rgba(71, 184, 232, .12);
  color: #9bdfff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex: 0 0 auto;
}

.preview-field {
  min-height: 70px;
}

.switch-row {
  display: inline-flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(56, 212, 122, .35);
  border-radius: 999px;
  background: rgba(56, 212, 122, .12);
  color: #8ff0b5;
  font-weight: 850;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.switch-row.status-row {
  cursor: default;
}

.device-picker.compact .device-option {
  min-height: 104px;
}

.company-create-aside {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
}

.create-safe-notes {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.create-safe-notes span {
  padding: 10px 12px;
  border: 1px solid rgba(71, 184, 232, .22);
  border-radius: var(--radius);
  background: rgba(7, 16, 26, .66);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.is-muted {
  opacity: .48;
  filter: grayscale(.25);
}

.company-graph img {
  max-height: 360px;
}

/* Criação de VPN */
.vpn-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.vpn-create-main,
.vpn-create-aside {
  padding: 20px;
}

.vpn-create-hero .score.compact strong {
  font-size: 28px;
}

.form-section {
  margin-top: 18px;
}

.section-head.tight {
  margin-bottom: 10px;
}

.section-head p {
  margin: 4px 0 0;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.btn.mini {
  min-height: 44px;
  padding: 9px 12px;
}

.device-picker,
.mode-picker {
  display: grid;
  gap: 10px;
}

.device-picker {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mode-picker {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.device-option,
.mode-option {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09101b;
  padding: 14px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.device-option {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 7px;
}

.device-option img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.device-option strong,
.mode-option strong {
  color: #fff;
}

.device-option span,
.mode-option span,
.aside-row span {
  color: var(--muted);
  font-size: 12px;
}

.mode-option {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 84px;
}

.device-option:hover,
.mode-option:hover {
  transform: translateY(-2px);
  border-color: #4b789d;
}

.choice-radio:checked + .device-option,
.choice-radio:checked + .mode-option {
  border-color: var(--green);
  background: linear-gradient(180deg, rgba(56, 212, 122, .16), rgba(9, 16, 27, .98));
  box-shadow: 0 0 0 3px rgba(56, 212, 122, .08);
}

.form-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.vpn-create-aside h2 {
  margin-bottom: 14px;
}

.aside-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09101b;
  margin-bottom: 10px;
}

.aside-row strong {
  color: #fff;
  word-break: break-word;
}

.logo-strip {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.logo-strip img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09101b;
  padding: 8px;
}

/* Home compacta NOC */
.home-shell {
  display: grid;
  gap: 16px;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  background: rgba(12, 17, 27, .88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .24);
  animation: nocFadeUp .34s ease both;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.home-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0b1825;
  border: 1px solid #28415c;
  color: #8fe2ff;
  font-weight: 900;
  font-size: 14px;
  animation: nocLogoFloat 3.2s ease-in-out infinite;
}

.home-brand strong {
  display: block;
  color: #fff;
  font-size: 18px;
  line-height: 1.15;
}

.home-brand span:last-child {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.home-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.home-nav a,
.company-actions-clean a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid #2a3a52;
  background: #101927;
  color: #dce8f5;
  text-decoration: none;
  font-weight: 750;
  font-size: 13px;
}

.home-nav a:hover,
.company-actions-clean a:hover {
  border-color: #487196;
  background: #142235;
  transform: translateY(-1px);
}

.home-hero-clean {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  background: linear-gradient(180deg, rgba(18, 28, 43, .96), rgba(10, 15, 24, .98));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: nocFadeUp .42s ease .04s both;
}

.home-hero-clean::after,
.hero::after,
.panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 48%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(128, 220, 255, .65), transparent);
  opacity: .75;
  animation: nocScan 4.8s linear infinite;
}

.hero,
.panel {
  position: relative;
  overflow: hidden;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 8px;
  border: 1px solid #2c465f;
  border-radius: 999px;
  color: #9bdfff;
  background: #0d2130;
  font-size: 12px;
  font-weight: 850;
}

.home-hero-clean h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.08;
}

.home-hero-clean p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
}

.global-noc-hero {
  grid-template-columns: minmax(0, 1fr) 240px;
}

.home-alert-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.home-alert-strip span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 14, 24, .72);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.home-alert-strip .ok {
  color: #8ef0b1;
  border-color: rgba(56, 212, 122, .34);
  background: rgba(13, 45, 29, .82);
}

.home-alert-strip .warn {
  color: #ffe09a;
  border-color: rgba(244, 201, 93, .38);
  background: rgba(48, 37, 14, .82);
}

.home-alert-strip .err {
  color: #ffacba;
  border-color: rgba(239, 91, 114, .38);
  background: rgba(53, 20, 28, .82);
}

.health-card {
  border-radius: var(--radius);
  border: 1px solid #2b4964;
  background: #08111c;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform .18s ease, border-color .18s ease;
}

.health-card:hover {
  transform: translateY(-2px);
  border-color: #4b789d;
}

.health-card span,
.health-card small,
.home-metrics span,
.home-metrics small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.health-card strong {
  margin: 7px 0;
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.global-score-card.ok {
  border-color: rgba(56, 212, 122, .42);
  box-shadow: inset 0 0 30px rgba(56, 212, 122, .10);
}

.global-score-card.warn {
  border-color: rgba(244, 201, 93, .42);
  box-shadow: inset 0 0 30px rgba(244, 201, 93, .10);
}

.global-score-card.err {
  border-color: rgba(239, 91, 114, .42);
  box-shadow: inset 0 0 30px rgba(239, 91, 114, .10);
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.home-metrics.six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.home-metrics article {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(14, 22, 34, .95);
  animation: nocFadeUp .42s ease both;
}

.home-metrics article.metric-danger {
  border-color: rgba(239, 91, 114, .34);
  background: linear-gradient(180deg, rgba(53, 20, 28, .70), rgba(14, 22, 34, .95));
}

.home-metrics article.metric-warn {
  border-color: rgba(244, 201, 93, .34);
  background: linear-gradient(180deg, rgba(48, 37, 14, .70), rgba(14, 22, 34, .95));
}

.home-metrics article.metric-ok {
  border-color: rgba(56, 212, 122, .28);
}

.home-metrics article:nth-child(1) { animation-delay: .08s; }
.home-metrics article:nth-child(2) { animation-delay: .12s; }
.home-metrics article:nth-child(3) { animation-delay: .16s; }
.home-metrics article:nth-child(4) { animation-delay: .20s; }
.home-metrics article:nth-child(5) { animation-delay: .24s; }
.home-metrics article:nth-child(6) { animation-delay: .28s; }

.home-metrics strong {
  display: block;
  margin: 8px 0 5px;
  color: #fff;
  font-size: 23px;
  line-height: 1.1;
}

.home-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
}

.home-section-title h2 {
  margin: 0;
}

.home-section-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.home-status-inline,
.company-tags-clean {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.home-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-watch-panel {
  min-height: 290px;
  padding: 18px;
}

.watch-list {
  display: grid;
  gap: 9px;
}

.watch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09101b;
  color: #fff;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.watch-item:hover {
  transform: translateY(-1px);
  border-color: #4b789d;
  background: #0d1725;
}

.watch-item strong,
.watch-item span {
  display: block;
}

.watch-item strong {
  color: #fff;
  line-height: 1.25;
}

.watch-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.watch-item b {
  flex: 0 0 auto;
  color: #fff;
  font-size: 13px;
  text-align: right;
}

.watch-item.ok {
  border-color: rgba(56, 212, 122, .26);
}

.watch-item.warn {
  border-color: rgba(244, 201, 93, .32);
}

.watch-item.err {
  border-color: rgba(239, 91, 114, .36);
  background: linear-gradient(90deg, rgba(53, 20, 28, .62), #09101b);
}

.home-history-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-status-inline span,
.company-tags-clean span,
.score-chip {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 850;
  border: 1px solid transparent;
}

.home-status-inline .ok,
.company-tags-clean .ok,
.score-chip.ok {
  color: #8ef0b1;
  background: #0d2d1d;
  border-color: #1c6b3d;
}

.home-status-inline .err,
.company-tags-clean .err,
.score-chip.err {
  color: #ffacba;
  background: #35141c;
  border-color: #743040;
}

.home-status-inline .warn,
.company-tags-clean .warn,
.score-chip.warn {
  color: #ffe09a;
  background: #30250e;
  border-color: #80601e;
}

.company-list-clean {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.company-card-clean {
  display: grid;
  gap: 14px;
  min-height: 260px;
  padding: 18px;
  border: 1px solid #273952;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #111b2b, #0c1320);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .25);
  animation: nocFadeUp .46s ease both;
}

.company-card-clean.ok {
  border-color: rgba(56, 212, 122, .22);
}

.company-card-clean.warn {
  border-color: rgba(244, 201, 93, .34);
}

.company-card-clean.err {
  border-color: rgba(239, 91, 114, .40);
  background: linear-gradient(180deg, rgba(53, 20, 28, .35), #0c1320);
}

.company-card-clean:nth-child(1) { animation-delay: .10s; }
.company-card-clean:nth-child(2) { animation-delay: .16s; }
.company-card-clean:nth-child(3) { animation-delay: .22s; }
.company-card-clean:nth-child(4) { animation-delay: .28s; }
.company-card-clean:nth-child(5) { animation-delay: .34s; }

.company-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.company-main h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.company-main p {
  margin: 0;
  color: var(--muted);
}

.company-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.company-kpis span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #09111d;
  border: 1px solid #202e42;
  color: var(--muted);
  font-size: 13px;
}

.company-kpis b {
  color: #fff;
}

.company-actions-clean {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.company-actions-clean a.primary {
  background: #1d8f58;
  border-color: #2aae71;
  color: #04140c;
}

.score-chip.ok {
  animation: nocGlow 2.8s ease-in-out infinite;
}

.metric-title,
.title-logo,
.hero-logo,
.mini-logo,
.company-tags-clean span img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.metric-title {
  gap: 8px;
}

.metric-title img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: contain;
  background: #07101a;
  border: 1px solid #26364d;
  padding: 2px;
  transition: transform .18s ease;
}

.home-metrics article:hover .metric-title img,
.company-card-clean:hover .mini-logo,
.card:hover .title-logo {
  transform: translateY(-2px) scale(1.04);
}

.title-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
  background: #07101a;
  border: 1px solid #26364d;
  padding: 3px;
  vertical-align: middle;
}

.title-logo.wide {
  width: 52px;
  padding: 2px 4px;
}

.hero-logo {
  width: 34px;
  height: 34px;
  margin-right: 10px;
  border-radius: 8px;
  object-fit: contain;
  background: #07101a;
  border: 1px solid #26364d;
  padding: 4px;
  vertical-align: -6px;
}

.mini-logo {
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 5px;
  background: #07101a;
  border: 1px solid #26364d;
}

.mini-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.company-kpis span {
  align-items: center;
}

.company-kpis span b {
  margin-left: auto;
}

.company-tags-clean span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.company-tags-clean span img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 3px;
}

@media (max-width: 980px) {
  .hero-row,
  .section-head,
  .card-head,
  .event-head,
  .topbar,
  .search-row {
    display: block;
  }

  .toolbar,
  .actions,
  .filters {
    margin-top: 12px;
  }

  .grid,
  .grid.two,
  .grid.four,
  .field-grid,
  .field-grid.two-wide,
  .vpn-meta-strip,
  .vpn-status-panel,
  .vpn-create-layout,
  .device-picker,
  .mode-picker {
    grid-template-columns: 1fr;
  }

  .score {
    margin-top: 16px;
    min-width: 0;
  }

  .home-header,
  .home-section-title {
    display: block;
  }

  .home-nav,
  .home-status-inline {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .home-hero-clean,
  .home-metrics,
  .home-board,
  .home-history-grid,
  .company-list-clean,
  .company-command,
  .company-create-hero,
  .company-create-layout,
  .company-signal-row,
  .whatsapp-command,
  .service-grid,
  .whatsapp-status-grid,
  .company-layout {
    grid-template-columns: 1fr;
  }

  .health-ring {
    min-height: 120px;
  }

  .company-create-aside {
    position: static;
  }

  .mini-vpn-row {
    display: grid;
  }
}

@media (max-width: 620px) {
  .wrap {
    width: min(100% - 20px, 1280px);
    padding-top: 12px;
  }

  .hero,
  .panel,
  .card,
  .metric,
  .event {
    padding: 14px;
  }

  .btn,
  button.btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
