:root {
  --bg: #0a0b0d;
  --bg-2: #0d0f12;
  --surface: #14171c;
  --surface-2: #1a1e24;
  --surface-3: #232830;
  --border: #25282e;
  --border-strong: #353a42;
  --text: #f1f3f6;
  --text-dim: #9aa0a8;
  --text-faint: #5d636b;
  --accent: #c5f436;
  --accent-soft: rgba(197, 244, 54, 0.12);
  --accent-dim: rgba(197, 244, 54, 0.4);
  --terminal: #5af78e;
  --warn: #ff7b5c;
  --warn-soft: rgba(255, 123, 92, 0.12);
  --info: #5cb8ff;
  --info-soft: rgba(92, 184, 255, 0.12);
  --good: #4ade80;
  --good-soft: rgba(74, 222, 128, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
.hidden { display: none !important; }

/* ============ LOGIN ============ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.login-bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.85;
}

.login-bg-orbs {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}
.orb-1 {
  top: 8%; left: 6%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(197,244,54,0.55), transparent 65%);
  animation: orb-float 22s ease-in-out infinite;
}
.orb-2 {
  bottom: 4%; right: 6%;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(92,184,255,0.45), transparent 65%);
  animation: orb-float 24s ease-in-out infinite -8s;
}
.orb-3 {
  top: 50%; left: 50%;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(90,247,142,0.30), transparent 65%);
  animation: orb-float-center 28s ease-in-out infinite -14s;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(40px,-30px) scale(1.08); }
  66%      { transform: translate(-30px,25px) scale(0.95); }
}
@keyframes orb-float-center {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.15); }
}

.login-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  width: min(1100px, 92vw);
  align-items: center;
}
.login-wrap--centered {
  display: flex;
  justify-content: center;
  align-items: center;
  grid-template-columns: none;
  width: min(460px, 92vw);
}
.login-wrap--centered .login-card {
  width: 100%;
}
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; gap: 32px; max-width: 460px; }
  .login-marketing { display: none; }
}

.login-marketing { padding-right: 12px; }
.login-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(197,244,54,0.06);
  border: 1px solid rgba(197,244,54,0.2);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.login-pill .pulse {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s ease-out infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(197,244,54,0.6); }
  70%  { box-shadow: 0 0 0 12px rgba(197,244,54,0); }
  100% { box-shadow: 0 0 0 0 rgba(197,244,54,0); }
}
.login-headline {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}
.accent-gradient {
  background: linear-gradient(135deg, #c5f436 0%, #5af78e 50%, #5cb8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.login-lede {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 24px;
  max-width: 500px;
}
.login-feats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-feats li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  font-family: var(--mono);
}
.login-feats .dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent);
}

.login-card {
  background: rgba(20, 23, 28, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.04) inset;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(197,244,54,0.5), transparent 40%, transparent 60%, rgba(92,184,255,0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.brand-logo--glow {
  box-shadow: 0 0 30px rgba(197,244,54,0.45), 0 0 60px rgba(197,244,54,0.2);
  animation: glow-pulse 3.5s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 30px rgba(197,244,54,0.45), 0 0 60px rgba(197,244,54,0.2); }
  50%      { box-shadow: 0 0 40px rgba(197,244,54,0.65), 0 0 80px rgba(197,244,54,0.3); }
}
.login-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.login-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.form-input--glow {
  background: rgba(10,11,13,0.6) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  transition: all 0.2s ease;
}
.form-input--glow:focus {
  border-color: var(--accent) !important;
  box-shadow:
    0 0 0 3px rgba(197,244,54,0.12),
    0 0 20px rgba(197,244,54,0.08) !important;
  background: rgba(10,11,13,0.85) !important;
  outline: none;
}

.btn-shimmer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #c5f436 0%, #a8d92e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 24px rgba(197,244,54,0.25);
  transition: all 0.2s ease;
}
.btn-shimmer:hover {
  box-shadow: 0 10px 32px rgba(197,244,54,0.4);
  transform: translateY(-1px);
}
.btn-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 2.6s ease infinite;
}
@keyframes shimmer {
  0%, 100% { left: -100%; }
  50%      { left: 100%; }
}
.btn-arrow { font-size: 16px; transition: transform 0.2s ease; }
.btn-shimmer:hover .btn-arrow { transform: translateX(3px); }

.login-submit { width: 100%; margin-top: 8px; padding: 12px 16px; }
.login-error {
  color: var(--danger);
  font-size: 12px;
  font-family: var(--mono);
  padding: 10px 12px;
  background: var(--danger-soft);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
}
.login-foot {
  margin-top: 4px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 12px;
}
.login-foot-text {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* ============ APP WINDOW ============ */
.app {
  display: grid;
  grid-template-rows: 32px 50px 1fr 24px;
  height: 100vh;
}

/* ============ WIZARD ============ */
.wizard-card { max-width: 520px; }
.wizard-steps {
  display: flex;
  gap: 4px;
  margin: 4px 0 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.wizard-step {
  flex: 1;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  padding: 6px 8px;
  border-radius: 6px;
  text-align: center;
  transition: 0.15s ease;
}
.wizard-step.active {
  color: var(--accent);
  background: rgba(197,244,54,0.08);
}
.wizard-step.done {
  color: var(--good);
}
.wizard-pane { display: none; flex-direction: column; gap: 12px; }
.wizard-pane.active { display: flex; }
.wizard-intro {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}
.wizard-intro code {
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
}
.wizard-check {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
}
.wizard-check.ok {
  border-color: rgba(74,222,128,0.4);
  background: rgba(74,222,128,0.06);
}
.wizard-check.warn {
  border-color: rgba(255,123,92,0.4);
  background: rgba(255,123,92,0.06);
}
.wizard-check-status {
  font-size: 22px;
  width: 28px;
  text-align: center;
}
.wizard-check-title {
  font-weight: 600;
  font-size: 14px;
}
.wizard-check-detail {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ============ TITLE BAR ============ */
.titlebar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  user-select: none;
}
.traffic-lights { display: flex; gap: 6px; }
.traffic-lights span {
  width: 11px; height: 11px;
  border-radius: 50%;
  cursor: default;
}
.traffic-lights span:nth-child(1) { background: #ff5f57; }
.traffic-lights span:nth-child(2) { background: #febc2e; }
.traffic-lights span:nth-child(3) { background: #28c840; }
.titlebar-text {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  margin: 0 auto;
}
.titlebar-text strong { color: var(--text-dim); }
.titlebar-version {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
}

/* ============ TOPBAR / TABS ============ */
.topbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 4px;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 20px;
  margin-right: 12px;
  border-right: 1px solid var(--border);
  height: 30px;
}
.brand-logo {
  width: 22px; height: 22px;
  background: linear-gradient(135deg, var(--accent), #8fb820);
  border-radius: 6px;
  flex-shrink: 0;
}
.brand-logo--big { width: 40px; height: 40px; border-radius: 10px; }
.brand-sub {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 11px;
  font-family: var(--mono);
}
.tabs { display: flex; gap: 2px; }
.tab {
  padding: 7px 16px;
  border-radius: 7px 7px 0 0;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-bottom: none;
  position: relative;
  top: 1px;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border);
  border-bottom: 1px solid var(--surface);
}
.tab .ico { font-size: 14px; }
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-status .dot {
  width: 7px; height: 7px;
  background: var(--good);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--good);
}
.topbar-status.warn .dot { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px 4px 5px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.user-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--warn), #d44d04);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 10px;
  color: #fff;
}
.user-name { font-size: 11.5px; font-weight: 500; }
.user-logout {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
}
.user-logout:hover { color: var(--warn); }

/* ============ MAIN CONTENT ============ */
.main {
  background: var(--surface);
  overflow: hidden;
  position: relative;
}
.view {
  display: none;
  height: 100%;
  overflow-y: auto;
}
.view.active { display: block; }

/* ============ DASHBOARD ============ */
.dash-content { padding: 24px 28px; }
.dash-head { margin-bottom: 24px; }
.dash-greeting {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.dash-greeting .name { color: var(--accent); font-style: italic; }
.dash-date {
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--mono);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}
.kpi.warn::before { background: var(--warn); }
.kpi.info::before { background: var(--info); }
.kpi.good::before { background: var(--good); }
.kpi-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.kpi-value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}
.kpi-sub .pos { color: var(--good); }
.kpi-sub .neg { color: var(--warn); }

.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}
.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.panel-link {
  font-size: 11px;
  color: var(--accent);
  font-family: var(--mono);
  cursor: pointer;
}

/* Activity feed */
.activity { padding: 6px 0; }
.activity-empty,
.empty-state {
  padding: 28px 16px;
  text-align: center;
  font-family: var(--mono);
  color: var(--text-faint);
  font-size: 12px;
}
.activity-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  cursor: default;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--surface-2); }
.activity-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}
.activity-icon.ok { background: var(--good-soft); color: var(--good); }
.activity-icon.run { background: var(--info-soft); color: var(--info); }
.activity-icon.warn { background: var(--warn-soft); color: var(--warn); }
.activity-icon.err { background: var(--danger-soft); color: var(--danger); }
.activity-text { flex: 1; min-width: 0; }
.activity-text strong { color: var(--text); font-weight: 600; }
.activity-meta {
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--mono);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  flex-shrink: 0;
}

/* Quick actions */
.quick-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.quick-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  font-family: var(--body);
}
.quick-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent-dim);
}
.quick-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.quick-btn-icon { font-size: 20px; margin-bottom: 8px; display: block; }
.quick-btn-title {
  font-weight: 600;
  font-size: 12.5px;
  margin-bottom: 2px;
}
.quick-btn-sub {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.4;
}

/* ============ EQUIPAMENTOS ============ */
.eq-content,
.user-content { padding: 24px 28px; }
.eq-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 22px;
  gap: 16px;
}
.eq-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.eq-sub { font-size: 12.5px; color: var(--text-dim); }
.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 8px 14px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--body);
}
.btn-primary:hover { background: #d4ff4d; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 7px;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--body);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--accent-dim); }

.eq-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.eq-search {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 12px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--mono);
  max-width: 320px;
}
.eq-search:focus { outline: none; border-color: var(--accent); }
.filter-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 11.5px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--mono);
}
.filter-chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* Tables */
.eq-table {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  padding: 11px 16px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-family: var(--mono);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr.equipment-row { cursor: pointer; transition: background 0.1s; }
tr.equipment-row:hover { background: var(--surface-2); }

.eq-name { display: flex; align-items: center; gap: 10px; }
.eq-icon-mini {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.eq-icon-mini.router { background: rgba(244, 67, 54, 0.15); color: #f44336; }
.eq-icon-mini.olt { background: rgba(33, 150, 243, 0.15); color: #2196f3; }
.eq-icon-mini.server { background: rgba(156, 39, 176, 0.15); color: #ce93d8; }
.eq-icon-mini.switch { background: rgba(255, 152, 0, 0.15); color: #ffb74d; }
.eq-name-text { display: flex; flex-direction: column; gap: 1px; }
.eq-name-text .nm { font-weight: 600; font-size: 12.5px; }
.eq-name-text .ip { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }

.badge-proto {
  background: var(--surface-3);
  color: var(--text-dim);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--mono);
}
.status-pill::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.status-pill.online { background: var(--good-soft); color: var(--good); }
.status-pill.offline,
.status-pill.unknown { background: var(--surface-3); color: var(--text-faint); }
.status-pill.warn,
.status-pill.drift { background: var(--warn-soft); color: var(--warn); }

.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.row-btn {
  width: 26px; height: 26px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 12px;
  font-family: var(--body);
}
.row-btn:hover { color: var(--accent); border-color: var(--accent-dim); }
.row-btn.primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
  width: auto;
  padding: 0 10px;
  font-size: 11px;
}
.row-btn.primary:hover { background: #d4ff4d; }
.row-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

/* ============ USUÁRIOS ============ */
.user-role-pill {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.user-role-pill.admin { background: var(--accent-soft); color: var(--accent); }
.user-role-pill.operator { background: var(--info-soft); color: var(--info); }
.user-role-pill.viewer { background: var(--surface-3); color: var(--text-dim); }

.user-avatar-big {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.av-1 { background: linear-gradient(135deg, #ff7b5c, #d44d04); }
.av-2 { background: linear-gradient(135deg, #5cb8ff, #2196f3); }
.av-3 { background: linear-gradient(135deg, #c5f436, #8fb820); color: #000; }
.av-4 { background: linear-gradient(135deg, #a78bfa, #6d40c4); }
.av-5 { background: linear-gradient(135deg, #4ade80, #16a34a); }

.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.role-card { padding: 16px; }
.role-card-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.role-card-label.role-admin { color: var(--accent); }
.role-card-label.role-operator { color: var(--info); }
.role-card-label.role-viewer { color: var(--text-faint); }
.role-card-body {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.55;
}
.role-card-body strong { color: var(--text); }

/* ============ TERMINAL ============ */
.terminal-view {
  display: none;
  height: 100%;
  background: #050608;
  flex-direction: column;
}
.terminal-view.active { display: flex; }
.term-header {
  padding: 10px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.term-back {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--body);
}
.term-back:hover { color: var(--text); border-color: var(--border-strong); }
.term-info-block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.term-info-icon {
  width: 30px; height: 30px;
  background: var(--accent);
  color: #000;
  border-radius: 7px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
}
.term-info-icon.olt { background: #2196f3; color: #fff; }
.term-info-icon.server { background: #ce93d8; color: #fff; }
.term-info-icon.switch { background: #ffb74d; color: #000; }
.term-info-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.term-info-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}
.term-conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--good);
  font-size: 11px;
  font-family: var(--mono);
  margin-left: auto;
}
.term-conn-status .dot {
  width: 6px; height: 6px;
  background: var(--good);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--good);
}
.term-conn-status.warn { color: var(--warn); }
.term-conn-status.warn .dot { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.term-conn-status.err { color: var(--danger); }
.term-conn-status.err .dot { background: var(--danger); box-shadow: 0 0 6px var(--danger); }

.term-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: #d4d8de;
}
.term-line { padding: 1px 0; white-space: pre-wrap; word-break: break-word; }
.term-prompt { color: var(--accent); font-weight: 700; }
.term-user { color: var(--warn); }
.term-ai { color: var(--info); font-weight: 600; }
.term-output { color: var(--terminal); }
.term-cmd { color: var(--terminal); }
.term-info-text { color: var(--text-dim); }
.term-warn { color: var(--warn); }
.term-comment { color: #6272a4; font-style: italic; }
.term-error-text { color: var(--danger); }
.term-tool-call {
  color: var(--info);
  font-style: italic;
}
.term-tool-result {
  color: var(--text-dim);
  background: rgba(92, 184, 255, 0.04);
  border-left: 2px solid rgba(92, 184, 255, 0.3);
  padding: 6px 10px;
  margin: 4px 0;
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}
/* Bloco "terminal do equipamento" — mostra prompt + comando + output bruto */
.term-device-cmd {
  margin-top: 8px;
  padding: 3px 0;
}
.term-device-prompt {
  color: var(--accent);
  font-weight: 700;
}
.term-device-input {
  color: var(--text);
}
.term-device-block {
  background: #050608;
  border: 1px solid #1a2a1a;
  border-left: 3px solid var(--terminal);
  border-radius: 6px;
  margin: 4px 0 10px 0;
  overflow: hidden;
}
.term-device-output {
  color: var(--terminal);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}
.term-device-meta {
  border-top: 1px solid #1a2a1a;
  padding: 4px 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  background: rgba(90, 247, 142, 0.03);
}

.term-diag-hint {
  margin: 8px 0 12px 0;
  border: 1px solid rgba(255, 123, 92, 0.4);
  border-left: 3px solid var(--warn);
  background: rgba(255, 123, 92, 0.06);
  border-radius: 6px;
  overflow: hidden;
}
.term-diag-title {
  padding: 8px 12px;
  font-weight: 600;
  color: var(--warn);
  border-bottom: 1px solid rgba(255, 123, 92, 0.2);
  background: rgba(255, 123, 92, 0.05);
}
.term-diag-body {
  padding: 10px 12px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
  white-space: pre-wrap;
}

.term-cursor::after {
  content: "▊";
  color: var(--accent);
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.term-indent { padding-left: 16px; }

.term-input-wrap {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.term-input-prompt {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
}
.term-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
}
.term-input:disabled { opacity: 0.5; }
.term-input::placeholder { color: var(--text-faint); }
.term-send {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--body);
}
.term-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ STATUSBAR ============ */
.statusbar {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
}
.statusbar .item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.statusbar .item.right { margin-left: auto; }
.statusbar strong { color: var(--text-dim); font-weight: 500; }

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-backdrop.active { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 22px;
  cursor: pointer;
  width: 28px; height: 28px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.form-row.full { grid-template-columns: 1fr; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 11px;
  color: var(--text);
  font-size: 12.5px;
  font-family: var(--mono);
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--accent); }

.proto-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 7px;
  padding: 3px;
}
.proto-tab {
  flex: 1;
  text-align: center;
  padding: 6px;
  font-size: 11px;
  color: var(--text-dim);
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 600;
}
.proto-tab.active { background: var(--accent); color: #000; }
.proto-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.test-result {
  background: var(--good-soft);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--good);
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 11.5px;
  margin: 12px 0;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: pre-wrap;
}
.test-result.fail {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}
.test-result.testing {
  background: var(--info-soft);
  border-color: rgba(92, 184, 255, 0.3);
  color: var(--info);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  align-items: center;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Audit table specifics */
.audit-action {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-3);
  padding: 2px 8px;
  border-radius: 4px;
}
.audit-details {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

/* ============================================================
 * MELHORIAS V2 — dashboard rico, audit filtrado, topbar notif
 * ============================================================ */

/* ---------------- Topbar approvals notification ---------------- */
.topbar-notif {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warn, #f59e0b);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.topbar-notif:hover {
  background: rgba(245, 158, 11, 0.2);
}
.topbar-notif.hidden { display: none; }
.topbar-notif .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--warn, #f59e0b);
  color: white;
  font-size: 10px;
  font-weight: 700;
}

/* ---------------- Health grid (categorias) ---------------- */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.health-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  transition: border-color 0.15s;
}
.health-card.good   { border-left: 3px solid var(--good, #10b981); }
.health-card.warn   { border-left: 3px solid var(--warn, #f59e0b); }
.health-card.bad    { border-left: 3px solid var(--danger, #ef4444); }
.health-card.muted  { border-left: 3px solid var(--text-faint, #6b7280); opacity: 0.6; }
.health-icon {
  font-size: 22px;
  width: 36px;
  text-align: center;
}
.health-body { flex: 1; min-width: 0; }
.health-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.health-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}
.health-value span {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 400;
}
.health-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.health-bar > div {
  height: 100%;
  background: currentColor;
  transition: width 0.6s ease;
}
.health-card.good  .health-bar > div { background: var(--good, #10b981); }
.health-card.warn  .health-bar > div { background: var(--warn, #f59e0b); }
.health-card.bad   .health-bar > div { background: var(--danger, #ef4444); }
.health-pct {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

/* ---------------- KPI sparklines ---------------- */
.kpi { position: relative; }
.kpi-spark {
  display: block;
  width: 100%;
  height: 36px;
  margin-top: 8px;
  color: var(--accent, #6366f1);
  opacity: 0.85;
}
.kpi.good .kpi-spark { color: var(--good, #10b981); }
.kpi.warn .kpi-spark { color: var(--warn, #f59e0b); }
.kpi.info .kpi-spark { color: var(--accent, #6366f1); }

/* ---------------- Chart 24h ---------------- */
.chart-card {
  padding: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.chart-title {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chart-meta {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--mono);
}
.chart-bars {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  height: 60px;
  align-items: flex-end;
}
.chart-bar {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  cursor: default;
}
.chart-bar > div {
  width: 100%;
  background: var(--accent, #6366f1);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  opacity: 0.7;
  transition: opacity 0.15s, transform 0.15s;
}
.chart-bar:hover > div { opacity: 1; transform: scaleY(1.05); transform-origin: bottom; }
.chart-bar.empty > div { background: rgba(255,255,255,0.06); opacity: 0.4; }
.chart-bar.peak > div { background: var(--warn, #f59e0b); opacity: 1; }
.chart-labels {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-faint);
}
.chart-labels span {
  text-align: center;
}

/* ---------------- Activity filters ---------------- */
.activity-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}
.activity-chip {
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.activity-chip:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.activity-chip.active {
  background: rgba(99,102,241,0.15);
  color: var(--accent, #6366f1);
  border-color: rgba(99,102,241,0.35);
}

/* Activity items targets/meta */
.activity-target {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
}
.activity-meta {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
  font-family: var(--mono);
}

/* ---------------- Top equipments panel ---------------- */
.top-eq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.top-eq-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.top-eq-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border, rgba(255,255,255,0.1));
}
.top-eq-rank {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
  width: 26px;
}
.top-eq-body { flex: 1; min-width: 0; }
.top-eq-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-eq-bar {
  height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.top-eq-bar > div {
  height: 100%;
  background: var(--accent, #6366f1);
  transition: width 0.6s ease;
}
.top-eq-count {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 32px;
  text-align: right;
}
.top-eq-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
}

/* ---------------- Audit filters ---------------- */
.audit-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 10px;
}
.audit-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.audit-filter-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 68px;
}
.audit-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.audit-chip {
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.audit-chip:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.audit-chip.active {
  background: rgba(99,102,241,0.15);
  color: var(--accent, #6366f1);
  border-color: rgba(99,102,241,0.35);
}

/* Audit table */
.audit-table .audit-row { cursor: pointer; }
.audit-table .audit-row:hover { background: rgba(255,255,255,0.03); }
.audit-table .audit-details-full {
  display: none;
}
.audit-table .audit-row.expanded .audit-details-short { display: none; }
.audit-table .audit-row.expanded .audit-details-full {
  display: block;
  margin-top: 6px;
  background: rgba(0,0,0,0.3);
  padding: 8px 10px;
  border-radius: 6px;
}
.audit-table .audit-row.expanded .audit-details-full pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.audit-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}
.audit-user-name {
  font-size: 12.5px;
  color: var(--text);
}
.audit-user-email {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 1px;
}
.audit-target-name {
  font-size: 12px;
  color: var(--text);
}
.audit-target-sub {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  margin-left: 4px;
}
.audit-details-short {
  font-size: 12px;
  color: var(--text-dim);
}
.audit-details-short code {
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(255,255,255,0.04);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text);
}

/* Audit badges (humanizado) */
.audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.audit-badge-run   { background: rgba(99,102,241,0.15);  color: var(--accent, #6366f1); }
.audit-badge-ok    { background: rgba(16,185,129,0.15);  color: var(--good, #10b981); }
.audit-badge-warn  { background: rgba(245,158,11,0.15);  color: var(--warn, #f59e0b); }
.audit-badge-err   { background: rgba(239,68,68,0.15);   color: var(--danger, #ef4444); }
.audit-badge-muted { background: rgba(255,255,255,0.06); color: var(--text-dim); }

/* Audit pager */
.audit-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-dim);
}
.audit-pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.text-dim { color: var(--text-dim); }

/* ============================================================
 * MELHORIAS V3 — Equipamentos cards, Usuários enhanced, Config IA pro
 * ============================================================ */

/* ============= EQUIPAMENTOS — stats + toolbar + cards ============= */
.eq-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.eq-stat {
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
}
.eq-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint, #6b7280);
}
.eq-stat-val {
  font-family: var(--display, sans-serif);
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--text);
}
.eq-stat-val.good    { color: var(--good, #10b981); }
.eq-stat-val.warn    { color: var(--warn, #f59e0b); }
.eq-stat-val.danger  { color: var(--danger, #ef4444); }

.eq-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 10px;
}
.eq-toolbar .eq-search {
  flex: 1;
  min-width: 200px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
}
.eq-toolbar .eq-search:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
}
.eq-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.eq-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 7px;
  overflow: hidden;
}
.eq-view-toggle button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.eq-view-toggle button.active {
  background: var(--accent, #6366f1);
  color: white;
}
.eq-view-toggle button:hover:not(.active) {
  background: rgba(255,255,255,0.05);
}

/* Card grid */
.eq-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.eq-card {
  padding: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  transition: border-color 0.15s, transform 0.15s;
}
.eq-card:hover {
  border-color: rgba(99,102,241,0.4);
  transform: translateY(-1px);
}
.eq-card.online   { border-left: 3px solid var(--good, #10b981); }
.eq-card.offline  { border-left: 3px solid var(--danger, #ef4444); opacity: 0.85; }
.eq-card.drift    { border-left: 3px solid var(--warn, #f59e0b); }
.eq-card.unknown  { border-left: 3px solid var(--text-faint, #6b7280); }

.eq-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.eq-card .eq-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}
.eq-card .eq-icon.router   { background: rgba(99,102,241,0.15);  color: #818cf8; }
.eq-card .eq-icon.olt      { background: rgba(16,185,129,0.15);  color: #34d399; }
.eq-card .eq-icon.switch   { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.eq-card .eq-icon.wireless { background: rgba(236,72,153,0.15);  color: #f472b6; }
.eq-card .eq-icon.server   { background: rgba(139,92,246,0.15);  color: #a78bfa; }
.eq-card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eq-card-ip {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.eq-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.eq-badge {
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.eq-badge.ssh    { background: rgba(99,102,241,0.15);  color: #818cf8; }
.eq-badge.telnet { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.eq-badge.api    { background: rgba(16,185,129,0.15);  color: #34d399; }
.eq-badge.drift  { background: rgba(245,158,11,0.18);  color: #fbbf24; text-transform: none; }
.eq-badge.offline{ background: rgba(239,68,68,0.18);   color: #f87171; text-transform: none; }
.eq-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  margin-bottom: 12px;
}
.eq-meta-k {
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.eq-meta-v {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}
.eq-card-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}
.eq-card-actions > button:first-child {
  flex: 1;
  background: rgba(99,102,241,0.18);
  border: 1px solid rgba(99,102,241,0.35);
  color: var(--accent, #818cf8);
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.eq-card-actions > button:first-child:hover {
  background: rgba(99,102,241,0.3);
}
.eq-card-actions .icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 7px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.eq-card-actions .icon-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

/* ============= USUÁRIOS — linha enhanced ============= */
.user-row-enhanced {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.user-row-enhanced:hover {
  border-color: rgba(99,102,241,0.3);
}
.user-row-enhanced .user-avatar-big {
  width: 42px;
  height: 42px;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-row-main {
  flex: 1;
  min-width: 0;
}
.user-row-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-row-you {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-faint);
}
.user-row-inactive {
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(239,68,68,0.15);
  color: var(--danger, #ef4444);
  font-size: 10px;
  font-weight: 500;
}
.user-row-email {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta {
  display: flex;
  gap: 18px;
  margin-right: 14px;
}
.user-meta-block {
  text-align: right;
}
.user-meta-label {
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.user-meta-val {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}
.user-meta-val.user-meta-good { color: var(--good, #10b981); }
.user-meta-val.user-meta-dim  { color: var(--text-dim); }
.role-select {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 7px;
  padding: 6px 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  cursor: pointer;
}
.role-select:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
}
.role-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.users-hint {
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}
.users-hint .user-role-pill {
  margin: 0 2px;
}

/* ============= CONFIG IA — provider-card-pro ============= */
.provider-card-pro {
  padding: 16px;
  margin-bottom: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  transition: border-color 0.2s;
}
.provider-card-pro.active {
  border-color: rgba(99,102,241,0.45);
  background: linear-gradient(180deg, rgba(99,102,241,0.06) 0%, rgba(255,255,255,0.02) 60%);
  box-shadow: 0 4px 18px rgba(99,102,241,0.10);
}
.provider-card-pro.muted {
  opacity: 0.78;
}
.provider-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.provider-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.provider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.provider-dot.on  { background: var(--good, #10b981); box-shadow: 0 0 8px rgba(16,185,129,0.5); }
.provider-dot.off { background: var(--text-faint, #6b7280); }
.provider-active-badge {
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(99,102,241,0.2);
  color: var(--accent, #818cf8);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.provider-config-badge {
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(16,185,129,0.15);
  color: var(--good, #10b981);
  font-family: var(--mono);
  font-size: 10px;
}
.provider-empty-badge {
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
}
.provider-key-info {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
}
.provider-key-info code {
  color: var(--text);
  background: rgba(255,255,255,0.05);
  padding: 1px 5px;
  border-radius: 3px;
}

.provider-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 9px;
}
.provider-stat-label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.provider-stat-val {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-top: 3px;
}

.provider-spark {
  height: 30px;
  margin-top: 6px;
}
.provider-spark-caption {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-faint);
  text-align: center;
  margin-top: 2px;
  margin-bottom: 10px;
}

.provider-form {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}
.provider-form .form-input {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  width: 100%;
}
.provider-form .form-label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: block;
  margin-bottom: 4px;
}
.provider-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  align-items: center;
}

@media (max-width: 720px) {
  .provider-stats { grid-template-columns: repeat(2, 1fr); }
  .provider-form  { grid-template-columns: 1fr; }
  .user-meta { display: none; }
}

.text-mono { font-family: var(--mono); font-size: 11px; }
.text-warn { color: var(--warn, #f59e0b); }

/* ============================================================
 * CHAT FLUTUANTE IA — FAB + painel deslizante
 * ============================================================ */

/* FAB: escondido por default, aparece quando logado */
.chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 950;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  border: 1px solid rgba(99,102,241,0.5);
  box-shadow: 0 8px 24px rgba(99,102,241,0.35),
              0 2px 6px rgba(0,0,0,0.4);
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: none;          /* escondido por default */
  align-items: center;
  justify-content: center;
  transition: transform 0.18s, box-shadow 0.18s;
}
body.is-logged .chat-fab:not(.hidden) {
  display: inline-flex;
}
.chat-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 30px rgba(99,102,241,0.5),
              0 4px 8px rgba(0,0,0,0.5);
}
.chat-fab-icon {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.chat-fab-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn, #f59e0b);
  border: 2px solid #1a1a1a;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s, transform 0.15s;
}
.chat-fab-dot.active {
  opacity: 1;
  transform: scale(1);
}

/* Painel */
.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 960;
  width: min(420px, calc(100vw - 30px));
  height: min(640px, calc(100vh - 60px));
  background: #15141c;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  box-shadow: 0 22px 56px rgba(0,0,0,0.55),
              0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(99,102,241,0.12) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.chat-head-info { flex: 1; min-width: 0; }
.chat-head-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text, #fff);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-head-title::before {
  content: "●";
  color: var(--good, #10b981);
  font-size: 10px;
  animation: chat-pulse 2.5s infinite;
}
.chat-head-sub {
  font-family: var(--mono, monospace);
  font-size: 10.5px;
  color: var(--text-faint, #6b7280);
  margin-top: 2px;
}
.chat-head-actions { display: flex; gap: 4px; }
.chat-icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 7px;
  color: var(--text-dim, #9ca3af);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
}
.chat-icon-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text, #fff);
}

@keyframes chat-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Body / messages */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

/* Empty state */
.chat-empty {
  margin: auto;
  text-align: center;
  padding: 20px;
}
.chat-empty-icon {
  font-size: 38px;
  margin-bottom: 8px;
  filter: grayscale(0.2);
}
.chat-empty-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text, #fff);
  margin-bottom: 4px;
}
.chat-empty-sub {
  font-size: 12px;
  color: var(--text-dim, #9ca3af);
  line-height: 1.5;
  margin-bottom: 12px;
}
.chat-suggest {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-suggest-btn {
  padding: 7px 10px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 8px;
  color: var(--accent, #818cf8);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.chat-suggest-btn:hover {
  background: rgba(99,102,241,0.18);
}

/* Message bubbles */
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 92%;
}
.chat-msg-user {
  align-self: flex-end;
  align-items: flex-end;
}
.chat-msg-ai {
  align-self: flex-start;
  align-items: flex-start;
}
.chat-bubble {
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: normal;
}
.chat-bubble-user {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-bubble-ai {
  background: rgba(255,255,255,0.05);
  color: var(--text, #fff);
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom-left-radius: 4px;
}
.chat-bubble-error {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}
.chat-bubble-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(245,158,11,0.18);
  color: var(--warn, #f59e0b);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  margin-right: 6px;
  vertical-align: middle;
}
.chat-bubble code {
  font-family: var(--mono, monospace);
  font-size: 11.5px;
  background: rgba(0,0,0,0.35);
  padding: 1px 5px;
  border-radius: 3px;
}
.chat-bubble pre.chat-code {
  background: rgba(0,0,0,0.4);
  border-radius: 7px;
  padding: 9px 11px;
  margin: 6px 0;
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,0.04);
}
.chat-bubble pre.chat-code code {
  background: transparent;
  padding: 0;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre;
  display: block;
}
.chat-bubble strong {
  color: var(--accent, #a5b4fc);
  font-weight: 600;
}
.chat-msg-meta {
  font-family: var(--mono, monospace);
  font-size: 9px;
  color: var(--text-faint, #6b7280);
  margin-top: 3px;
  padding-left: 4px;
}

/* Typing indicator */
.chat-typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 2px;
}
.chat-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim, #9ca3af);
  animation: chat-typing 1.4s infinite both;
}
.chat-typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes chat-typing {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.7); }
  40% { opacity: 1; transform: scale(1); }
}

/* Input area */
.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.2);
}
.chat-input {
  flex: 1;
  resize: none;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 8px 11px;
  color: var(--text, #fff);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  min-height: 36px;
  max-height: 120px;
  overflow-y: auto;
}
.chat-input:focus {
  outline: none;
  border-color: rgba(99,102,241,0.5);
}
.chat-input::-webkit-scrollbar { width: 6px; }
.chat-input::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
.chat-send {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  border: none;
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-send:hover:not(:disabled) {
  transform: scale(1.05);
}
.chat-send:disabled {
  background: rgba(255,255,255,0.08);
  color: var(--text-faint, #6b7280);
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .chat-panel {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    height: min(560px, calc(100vh - 30px));
  }
  .chat-fab {
    right: 14px;
    bottom: 14px;
  }
}

/* ============================================================
 * TERMINAL IA — indicador "executando..." entre comando e resultado
 * ============================================================ */
.term-executing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin: 4px 0 8px;
  background: linear-gradient(90deg, rgba(99,102,241,0.10) 0%, rgba(99,102,241,0.03) 100%);
  border-left: 3px solid var(--accent, #6366f1);
  border-radius: 0 7px 7px 0;
  font-family: var(--mono, monospace);
  font-size: 12px;
  color: var(--accent, #a5b4fc);
  animation: term-executing-fade-in 0.18s ease-out;
}
.term-executing.slow {
  background: linear-gradient(90deg, rgba(245,158,11,0.10) 0%, rgba(245,158,11,0.03) 100%);
  border-left-color: var(--warn, #f59e0b);
  color: var(--warn, #fbbf24);
}
.term-executing.slow .term-spinner {
  border-top-color: var(--warn, #f59e0b);
}
.term-executing-label {
  flex: 1;
  font-weight: 500;
}
.term-executing-elapsed {
  font-family: var(--mono, monospace);
  font-size: 11px;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

@keyframes term-executing-fade-in {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Spinner */
.term-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(99,102,241,0.18);
  border-top-color: var(--accent, #6366f1);
  animation: term-spinner-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes term-spinner-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
 *  RESPONSIVO TOTAL
 *  Breakpoints:
 *    1280px  → laptop 14" (compacta espaçamentos)
 *    1024px  → tablet landscape / laptop pequeno
 *     768px  → tablet portrait / celular grande
 *     480px  → celular médio
 *     380px  → celular pequeno
 *  Estratégia: progressive collapse. Grids encolhem; topbar scrolla;
 *  blocos viram coluna; touch targets ≥ 44px em mobile.
 * ============================================================ */

/* =========== 14" LAPTOP (1280px) =========== */
@media (max-width: 1280px) {
  .topbar { padding: 0 12px; gap: 2px; }
  .tab { padding: 7px 12px; font-size: 12.5px; }
  .brand { padding-right: 14px; margin-right: 8px; font-size: 14px; }
  .brand-sub { display: none; }  /* libera espaço no topbar */
  .kpi-grid { gap: 12px; }
  .kpi-value { font-size: 26px; }
  .health-grid { gap: 10px; }
  .eq-card-grid { gap: 12px; }
  .provider-stats { gap: 8px; padding: 10px; }
  .provider-stat-val { font-size: 15px; }
  .dash-content,
  .eq-content,
  .user-content { padding: 18px 16px; }
}

/* =========== TABLET LANDSCAPE (1024px) =========== */
@media (max-width: 1024px) {
  /* Dashboard fica 1 coluna */
  .dash-grid { grid-template-columns: 1fr; }
  /* KPIs viram 2x2 */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  /* Health: máximo 2 por linha */
  .health-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  /* Equipamento cards menores */
  .eq-card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  /* Audit pode ter scroll horizontal */
  .audit-table, .eq-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .audit-table table, .eq-table table { min-width: 720px; }
  /* User meta esconde alguns blocos pra caber */
  .user-meta { gap: 12px; }
  /* Provider stats 2x2 */
  .provider-stats { grid-template-columns: repeat(2, 1fr); }
  .provider-form { grid-template-columns: 1fr; }
  /* Statusbar quebra */
  .statusbar { flex-wrap: wrap; padding: 6px 12px; font-size: 11px; }
  .statusbar .item.right { margin-left: auto; }
}

/* =========== TABLET PORTRAIT / CELULAR GRANDE (768px) =========== */
@media (max-width: 768px) {
  /* Titlebar: esconde semáforo + version */
  .titlebar-controls { display: none; }
  .titlebar-version { display: none; }
  .titlebar { padding: 0 10px; }
  .titlebar-text { font-size: 11px; }

  /* TOPBAR: vira scroll horizontal */
  .topbar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 8px;
  }
  .topbar::-webkit-scrollbar { display: none; }
  .tabs { flex-shrink: 0; }
  .tab {
    flex-shrink: 0;
    padding: 9px 14px;
    font-size: 12px;
  }
  .tab .ico { font-size: 13px; }
  .brand { padding-right: 10px; margin-right: 6px; border-right: none; font-size: 13px; }
  .brand-logo { width: 22px; height: 22px; }
  /* topbar-right: encolhe */
  .topbar-right { gap: 6px; padding-left: 8px; }
  .topbar-status { font-size: 10.5px; padding: 4px 8px; }
  .topbar-status span:first-of-type ~ #topbar-status-text { display: inline; }
  .user-chip { padding: 3px 8px; gap: 4px; }
  .user-chip .user-name { display: none; }  /* só avatar em mobile */
  .topbar-notif { padding: 4px 7px; font-size: 11px; }
  .topbar-notif span:not(.badge) { display: none; }

  /* Conteúdo */
  .dash-content,
  .eq-content,
  .user-content { padding: 14px 12px; }

  /* Heading e textos */
  .dash-greeting { font-size: 20px; }
  .eq-title { font-size: 20px; }
  .dash-date { font-size: 11px; }

  /* KPI uma coluna */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 22px; }
  .kpi-label { font-size: 10.5px; }

  /* Health: 1 coluna mas com altura compacta */
  .health-grid { grid-template-columns: 1fr; gap: 8px; }
  .health-card { padding: 10px 12px; }
  .health-value { font-size: 18px; }

  /* Equipamentos: 1 coluna */
  .eq-card-grid { grid-template-columns: 1fr; gap: 10px; }
  .eq-card { padding: 12px; }
  .eq-card-name { font-size: 13.5px; }
  .eq-card-meta { gap: 6px; padding: 8px; }
  .eq-meta-v { font-size: 11.5px; }

  /* eq-summary: 3 colunas (2 linhas) */
  .eq-summary { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .eq-stat { padding: 8px 10px; }
  .eq-stat-val { font-size: 18px; }
  .eq-stat-label { font-size: 9px; }

  /* eq-toolbar: empilha */
  .eq-toolbar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
  .eq-toolbar .eq-search { min-width: 0; }
  .eq-chips { flex-wrap: wrap; }
  .eq-view-toggle { align-self: flex-end; }

  /* Activity filters wrap */
  .activity-filters { gap: 4px; }
  .activity-chip { padding: 5px 10px; font-size: 11px; }

  /* User row: empilha */
  .user-row-enhanced {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    align-items: flex-start;
  }
  .user-row-enhanced .user-avatar-big {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }
  .user-row-main { flex: 1 1 calc(100% - 60px); }
  .user-meta {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 0;
    margin-right: 0;
    padding: 8px 0 0;
    border-top: 1px solid var(--border, rgba(255,255,255,0.06));
    display: flex;
  }
  .user-meta-block { text-align: center; }
  .user-meta-val { font-size: 13px; }
  .role-select { flex: 0 0 auto; font-size: 10.5px; padding: 5px 8px; }
  .users-hint { font-size: 11px; padding: 10px 12px; }

  /* Audit filtros */
  .audit-filters { padding: 10px; gap: 6px; }
  .audit-filter-row { flex-wrap: wrap; gap: 6px; }
  .audit-filter-label { min-width: auto; font-size: 10px; }
  .audit-chip { padding: 4px 9px; font-size: 10.5px; }
  .eq-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .eq-head > div:last-child { width: 100%; }
  .eq-head .btn-primary,
  .eq-head .btn-secondary { width: 100%; }

  /* Audit details meta */
  .activity-meta { font-size: 10.5px; }

  /* Chart 24h: barras menores */
  .chart-bars { height: 50px; }
  .chart-labels { font-size: 8px; }

  /* Provider cards */
  .provider-card-pro { padding: 12px; }
  .provider-stats { grid-template-columns: repeat(2, 1fr); padding: 10px; }
  .provider-stat-val { font-size: 14px; }
  .provider-header { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* TERMINAL IA: ajusta header em mobile */
  .term-header { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .term-info-block { gap: 8px; min-width: 0; flex: 1; }
  .term-info-icon { width: 32px; height: 32px; font-size: 13px; }
  .term-info-name { font-size: 13px; }
  .term-info-sub { font-size: 10px; }
  .term-back { padding: 6px 10px; font-size: 11.5px; min-height: 36px; }
  .term-conn-status { font-size: 10.5px; padding: 4px 8px; }
  .term-body { padding: 10px; font-size: 12px; }
  .term-input-wrap { padding: 8px 10px; gap: 6px; }
  .term-input { font-size: 14px; padding: 9px 11px; }  /* 14px evita zoom no iOS */
  .term-send { padding: 9px 14px; font-size: 12px; min-height: 40px; }

  /* Modal full-screen em mobile */
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal {
    width: 100%;
    max-width: none;
    max-height: 100%;
    border-radius: 0;
    margin: 0;
  }
  .modal-body { padding: 14px; }
  .form-row { flex-direction: column; gap: 10px; }
  .form-input { font-size: 14px; padding: 9px 11px; }

  /* Quick actions: 2 colunas */
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .quick-btn { padding: 12px 10px; }

  /* Touch targets garantidos 44px+ */
  .btn-primary,
  .btn-secondary,
  .row-btn { min-height: 40px; padding: 9px 14px; }
  .icon-btn { min-width: 38px; min-height: 38px; }

  /* Status bar bem compacta */
  .statusbar { display: none; }  /* libera viewport pra conteúdo em mobile */

  /* Chat flutuante: já tem media query própria mais agressiva, garantir */
  .chat-fab { right: 12px; bottom: 12px; }

  /* Top-eq panel mais compacto */
  .top-eq-item { padding: 7px 9px; }
  .top-eq-name { font-size: 11.5px; }
}

/* =========== CELULAR MÉDIO (480px) =========== */
@media (max-width: 480px) {
  /* eq-summary: 2 colunas */
  .eq-summary { grid-template-columns: repeat(2, 1fr); }

  /* KPIs: 1 coluna */
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi { padding: 10px 12px; }
  .kpi-value { font-size: 24px; }

  /* User-meta vira grid 3 colunas pra caber tudo */
  .user-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .user-meta-label { font-size: 8.5px; }
  .user-meta-val { font-size: 12px; }

  /* Topbar mais compacto */
  .tab { padding: 9px 11px; font-size: 11.5px; }
  .topbar-status { padding: 3px 7px; }

  /* Quick actions: 1 coluna */
  .quick-grid { grid-template-columns: 1fr; }

  /* Empty state menor */
  .empty-state { padding: 30px 16px; font-size: 12px; }

  /* Login card padding */
  .login-card { padding: 24px 20px; }
  .login-title { font-size: 22px; }
  .login-sub { font-size: 12px; }

  /* Modal: padding menor */
  .modal-body { padding: 12px; }
  .modal-head { padding: 12px; }
  .modal-title { font-size: 16px; }
  .modal-actions { flex-wrap: wrap; gap: 6px; }

  /* Chat: input maior pra dedo */
  .chat-input { font-size: 14px; min-height: 40px; }
  .chat-send { width: 40px; height: 40px; }
}

/* =========== CELULAR PEQUENO (380px) =========== */
@media (max-width: 380px) {
  .titlebar-text { font-size: 10px; }
  .brand { font-size: 12px; }
  .brand-logo { width: 20px; height: 20px; }
  .tab { padding: 8px 9px; font-size: 11px; }
  .tab .ico { font-size: 11px; }
  .dash-greeting { font-size: 17px; }
  .eq-title { font-size: 17px; }
  .eq-stat-val { font-size: 16px; }
  .kpi-value { font-size: 21px; }
}

/* =========== AJUSTES TOUCH (qualquer dispositivo com toque) =========== */
@media (hover: none) and (pointer: coarse) {
  /* Sem hover real: substitui efeito hover por feedback de tap */
  .eq-card:hover { transform: none; }
  .health-card:hover { transform: none; }
  .top-eq-item:hover { transform: none; }
  .quick-btn:hover { transform: none; }
  /* Botões maiores */
  button, .btn-primary, .btn-secondary, .tab, .filter-chip, .audit-chip {
    -webkit-tap-highlight-color: rgba(99,102,241,0.15);
  }
  /* Smooth scroll em listas */
  .term-body, .audit-table, .eq-table, .chat-body {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
  /* Inputs: garante 16px font-size mínimo (iOS senão dá zoom automático) */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* =========== ORIENTAÇÃO LANDSCAPE em celular =========== */
@media (max-height: 480px) and (orientation: landscape) {
  .titlebar { display: none; }
  .topbar { padding: 0 6px; }
  .tab { padding: 6px 10px; font-size: 11.5px; }
  .dash-content,
  .eq-content,
  .user-content { padding: 10px 12px; }
  .dash-head { margin-bottom: 12px; }
  .term-body { padding: 8px; }
  .chat-panel { height: calc(100vh - 30px); }
}

/* =========== DARK MODE força em mobile (consistência visual) =========== */
@media (prefers-color-scheme: light) and (max-width: 768px) {
  :root { color-scheme: dark; }  /* Mantém escuro em mobile mesmo se OS for claro */
}

/* =========== PRINT (impressão de audit) =========== */
@media print {
  .topbar, .titlebar, .statusbar, .chat-fab, .chat-panel,
  .audit-filters, .audit-pager, .eq-toolbar { display: none !important; }
  body { background: white !important; color: black !important; }
  .eq-content, .user-content, .dash-content { padding: 0; }
  table { font-size: 10px; color: black; }
}

/* ============ TR-069 / ACS (Sprint 5) ============ */
.cpe-table { width: 100%; border-collapse: collapse; }
.cpe-table thead th {
  text-align: left; font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-faint); padding: 12px 16px;
  border-bottom: 1px solid var(--border); font-weight: 600;
}
.cpe-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.cpe-table tbody tr:last-child td { border-bottom: none; }
.cpe-table tbody tr:hover { background: var(--surface-2); }
.cpe-table .mono { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.cpe-name { font-weight: 600; color: var(--text); }
.cpe-serial { font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.cpe-mfr { font-family: var(--mono); font-size: 10px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-dim); padding: 2px 7px; border-radius: 6px; }

.cpe-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.cpe-pill.online { background: var(--good-soft); color: var(--good); }
.cpe-pill.offline { background: var(--danger-soft); color: var(--danger); }
.cpe-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }

.cpe-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.cpe-act { padding: 6px 9px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-dim); font-size: 12px; cursor: pointer; font-family: var(--body); }
.cpe-act:hover { background: var(--surface-3); color: var(--text); }
.cpe-act.warn:hover { border-color: var(--warn); color: var(--warn); }
.cpe-act.danger { color: var(--danger); }
.cpe-act.danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.cpe-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.cpe-live .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: cpe-pulse 1.6s infinite; }
@keyframes cpe-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.cpe-params { display: flex; flex-direction: column; }
.cpe-prow { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.cpe-prow:last-child { border-bottom: none; }
.cpe-pkey { color: var(--text-dim); font-family: var(--mono); font-size: 11.5px; }
.cpe-pval { color: var(--text); font-family: var(--mono); font-size: 11.5px; text-align: right; word-break: break-all; }

/* TR-069 — titulos de secao no modal de detalhes (Sprint 5.1) */
.cpe-sec-title { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 18px 0 6px; }
.cpe-sec-title:first-child { margin-top: 0; }

/* TR-069 — detalhes ricos (Sprint 5.2) */
.cpe-sec-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cpe-sec-actions { display: inline-flex; gap: 6px; }
.cpe-sec-actions .cpe-act { padding: 4px 8px; font-size: 11px; }
.cpe-mini { width: 100%; border-collapse: collapse; font-size: 12px; }
.cpe-mini th { text-align: left; font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.cpe-mini td { padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.cpe-mini tbody tr:last-child td { border-bottom: none; }
.cpe-log { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 10.5px; line-height: 1.5; color: var(--text-dim); max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin-top: 4px; }

/* TR-069 — laudo de diagnóstico IA (Fase 1) */
.diag { background: linear-gradient(180deg, var(--accent-soft), var(--surface-2)); border: 1px solid var(--accent-dim); border-radius: 14px; padding: 14px; margin-bottom: 8px; }
.diag-h { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 15px; margin-bottom: 6px; flex-wrap: wrap; }
.diag-verdict { margin-left: auto; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.diag-verdict.good { background: var(--good-soft); color: var(--good); }
.diag-verdict.warn { background: var(--warn-soft); color: var(--warn); }
.diag-verdict.danger { background: var(--danger-soft); color: var(--danger); }
.diag-summary { font-size: 12.5px; color: var(--text-dim); margin-bottom: 12px; }
.diag-find { display: flex; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--border); }
.diag-ico { width: 18px; text-align: center; flex-shrink: 0; font-size: 13px; }
.diag-ft { font-size: 12.5px; line-height: 1.5; }
.diag-rec { font-size: 11.5px; color: var(--text); background: var(--bg-2); border-left: 2px solid var(--accent); padding: 6px 10px; border-radius: 6px; margin-top: 5px; }

/* TR-069 — Copiloto de Rede IA (Fase 2) */
.tr069-ai-fab{position:fixed;right:22px;bottom:22px;z-index:55;display:flex;align-items:center;gap:8px;background:linear-gradient(135deg,var(--accent),#9bd400);color:#0a0b0d;border:none;border-radius:999px;padding:11px 18px;font-weight:700;font-size:13px;cursor:pointer;box-shadow:0 8px 30px var(--accent-dim);font-family:var(--body)}
.tr069-ai-fab span{font-size:13px}
.tr069-ai{position:fixed;right:22px;bottom:22px;width:430px;max-width:94vw;height:76vh;background:var(--surface);border:1px solid var(--border-strong);border-radius:16px;box-shadow:0 30px 80px rgba(0,0,0,.6);display:flex;flex-direction:column;overflow:hidden;z-index:56}
.tr069-ai.hidden{display:none}
.aih{display:flex;align-items:center;gap:10px;padding:13px 15px;border-bottom:1px solid var(--border);background:linear-gradient(180deg,var(--accent-soft),transparent)}
.aiico{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,var(--accent),#9bd400);display:flex;align-items:center;justify-content:center;font-size:18px}
.aititle{font-family:var(--display);font-weight:700;font-size:15px}.aisub{font-size:11px;color:var(--text-dim)}
.aiclose{margin-left:auto;background:none;border:none;color:var(--text-dim);font-size:22px;cursor:pointer;line-height:1}
.aibody{flex:1;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:12px}
.aimsg{max-width:90%;font-size:12.5px}.aimsg.u{align-self:flex-end}.aimsg.a{align-self:flex-start;width:100%}
.aiwho{font-family:var(--mono);font-size:9px;color:var(--text-faint);text-transform:uppercase;margin-bottom:4px}
.aibub{padding:9px 12px;border-radius:13px;line-height:1.5}
.aimsg.u .aibub{background:var(--accent);color:#0a0b0d;border-bottom-right-radius:4px;font-weight:500}
.aimsg.a .aibub{background:var(--surface-2);border:1px solid var(--border);border-bottom-left-radius:4px}
.aibub code{font-family:var(--mono);font-size:11px;background:var(--bg-2);padding:1px 5px;border-radius:4px}
.aityping{color:var(--text-dim);font-style:italic}
.aiwelcome{margin:auto;text-align:center;color:var(--text-dim)}.aiwt{font-size:13px;margin-bottom:10px}
.aichips{display:flex;flex-direction:column;gap:6px;align-items:center}
.aichip{font-size:12px;color:var(--text-dim);background:var(--surface-2);border:1px solid var(--border);padding:6px 12px;border-radius:9px;cursor:pointer}
.aichip:hover{border-color:var(--accent-dim);color:var(--accent)}
.aiaction{align-self:flex-start;width:100%;background:var(--warn-soft);border:1px solid rgba(255,123,92,.35);border-radius:13px;padding:12px;font-size:12.5px}
.aiaction-h{font-weight:700;margin-bottom:6px}.aiaction-d{margin-bottom:4px}
.aiaction-warn{font-size:11.5px;color:var(--warn);margin:6px 0}
.aiaction-btns{display:flex;gap:8px;margin-top:9px;align-items:center}
.aiaction .b-go{background:var(--accent);color:#0a0b0d;border:none;padding:8px 13px;border-radius:8px;font-weight:600;font-size:12px;cursor:pointer}
.aiaction .b-no{background:var(--surface-3);color:var(--text-dim);border:1px solid var(--border-strong);padding:8px 13px;border-radius:8px;font-size:12px;cursor:pointer}
.aidone{color:var(--good);font-size:12px}
.aiinput{display:flex;gap:8px;padding:11px 13px;border-top:1px solid var(--border);align-items:flex-end}
.aita{flex:1;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:10px;padding:9px 11px;color:var(--text);font-family:var(--body);font-size:12.5px;resize:none;max-height:90px}
.aisend{background:var(--accent);color:#0a0b0d;border:none;width:38px;height:38px;border-radius:10px;font-size:16px;cursor:pointer}

/* TR-069 — banner de alertas (Fase 3a) */
.cpe-alerts{background:var(--surface);border:1px solid var(--border);border-radius:12px;overflow:hidden;margin-bottom:14px}
.cpe-alerts-h{padding:10px 14px;font-weight:700;font-size:13px;color:var(--warn);background:var(--warn-soft);border-bottom:1px solid var(--border)}
.cpe-alert{display:flex;align-items:center;gap:10px;padding:9px 14px;border-bottom:1px solid var(--border);cursor:pointer;font-size:12.5px}
.cpe-alert:last-child{border-bottom:none}
.cpe-alert:hover{background:var(--surface-2)}
.cpe-alert.crit{border-left:3px solid var(--danger)}
.cpe-alert.warn{border-left:3px solid var(--warn)}
.ca-ico{flex-shrink:0}
.ca-cli{min-width:130px;flex-shrink:0}
.ca-msg{flex:1;color:var(--text-dim)}
.ca-go{color:var(--accent);font-size:11px;flex-shrink:0}

/* TR-069 — status "sem dados" (bootstrap raso) */
.cpe-pill.nodata{background:var(--warn-soft);color:var(--warn)}

/* TR-069 — botoes de solucao automatica (⚡) */
.diag-fix{margin-top:7px;background:var(--accent);color:#0a0b0d;border:none;padding:6px 12px;border-radius:8px;font-weight:600;font-size:12px;cursor:pointer;font-family:var(--body)}
.diag-fix:hover{filter:brightness(1.08)}
.ca-fix{background:var(--accent);color:#0a0b0d;border:none;padding:4px 11px;border-radius:7px;font-weight:600;font-size:11px;cursor:pointer;flex-shrink:0;margin-right:8px;font-family:var(--body)}
.ca-fix:hover{filter:brightness(1.08)}

/* TR-069 — toast de progresso da auto-correcao */
.cpe-toast{position:fixed;top:18px;left:50%;transform:translateX(-50%);background:var(--surface);border:1px solid var(--accent-dim);border-radius:10px;padding:11px 18px;font-size:13px;color:var(--text);box-shadow:0 10px 40px rgba(0,0,0,.55);z-index:200;display:none;max-width:90vw}
.cpe-toast b{color:var(--accent)}

/* TR-069 — Mapa da Rede (Leaflet overlay) */
.btn-map{background:var(--surface-2);color:var(--text);border:1px solid var(--border-strong);padding:9px 14px;border-radius:9px;font-weight:500;font-size:13px;cursor:pointer;font-family:var(--body);margin-right:8px}
.btn-map:hover{background:var(--surface-3)}
.tr069-map-ov{position:fixed;inset:0;background:var(--bg);z-index:300;display:none;flex-direction:column}
.tr069-map-ov.open{display:flex}
.tr069-map-h{height:54px;display:flex;align-items:center;gap:12px;padding:0 20px;border-bottom:1px solid var(--border);background:var(--bg-2);flex-shrink:0}
.tr069-map-h .t{font-family:var(--display);font-weight:700;font-size:16px}
.tr069-map-h .x{margin-left:auto;background:var(--surface-2);border:1px solid var(--border-strong);color:var(--text);width:34px;height:34px;border-radius:9px;cursor:pointer;font-size:18px}
#tr069-map{position:absolute;inset:0}
.tr069-map-leg{position:absolute;left:14px;bottom:20px;z-index:500;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:9px 13px;display:flex;gap:14px;font-size:11px;color:var(--text-dim)}
.tr069-map-leg .d{width:10px;height:10px;border-radius:50%;display:inline-block;margin-right:5px;vertical-align:middle}
.leaflet-popup-content-wrapper{background:var(--surface);color:var(--text);border:1px solid var(--border-strong);border-radius:10px}
.leaflet-popup-tip{background:var(--surface)}
.leaflet-popup-content{margin:11px 13px;font-family:var(--body);font-size:12.5px}
.leaflet-control-layers{background:var(--surface)!important;border:1px solid var(--border-strong)!important;color:var(--text)}
.leaflet-control-layers-expanded{padding:8px 12px!important}
.mp-h{font-weight:700;font-family:var(--display);font-size:14px;margin-bottom:4px}
.mp-r{font-size:11.5px;color:var(--text-dim);margin-top:2px}
.mp-b{margin-top:9px;background:var(--accent);color:#0a0b0d;border:none;border-radius:7px;padding:6px 12px;font-size:11px;font-weight:600;cursor:pointer;font-family:var(--body)}

/* ============================================================
   NetCopilot — Camada RESPONSIVA (mobile). Aditiva, so afeta
   telas pequenas; desktop fica intacto. (Sprint UI-mobile)
   ============================================================ */
@media (max-width: 860px) {
  .main { padding: 14px !important; }

  /* Topbar / abas: barra rolavel horizontal */
  .topbar { height: auto; min-height: 52px; padding: 8px 10px; gap: 8px; flex-wrap: wrap; }
  .brand-sub { display: none; }
  .tabs { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .tabs::-webkit-scrollbar { height: 0; }
  .tab { white-space: nowrap; padding: 8px 12px; font-size: 12.5px; flex-shrink: 0; }
  .topbar-right { margin-left: auto; gap: 8px; }
  .user-name { display: none; }

  /* Títulos e cabeçalhos de seção */
  .eq-head, .dash-head { flex-wrap: wrap; gap: 10px; align-items: flex-start; }
  .eq-title { font-size: 20px; }

  /* Grids: 2 colunas no celular */
  .eq-summary, .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .dash-grid, .row2 { grid-template-columns: 1fr !important; }

  /* Toolbar de busca/filtros empilha */
  .eq-toolbar { flex-wrap: wrap; }
  .eq-search { min-width: 100%; }

  /* Tabelas: rolagem horizontal (cabem em qualquer largura) */
  .eq-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .eq-table table, .cpe-table { min-width: 680px; }

  /* Ações em linha que quebram bonito */
  .cpe-actions { flex-wrap: wrap; gap: 5px; }

  /* Modais ocupam quase a tela toda */
  .modal { width: 96vw !important; max-width: 96vw !important; max-height: 90vh; }
  .modal-body { max-height: 74vh; }

  /* Chat flutuante IA em tela cheia */
  .chat-panel { width: 100vw !important; height: 100dvh !important; right: 0 !important; bottom: 0 !important; border-radius: 0 !important; }
  .chat-fab { right: 16px; bottom: 16px; }

  /* Banner de alertas: empilha o conteudo */
  .cpe-alert { flex-wrap: wrap; }
  .cpe-alert .ca-msg { flex-basis: 100%; order: 5; }

  /* Cabecalho do mapa */
  .tr069-map-h { padding: 0 12px; }
  .tr069-map-h #tr069-map-sub { display: none; }

  /* Status bar / titlebar mais enxutos */
  .statusbar { font-size: 10px; flex-wrap: wrap; gap: 6px; }
}

/* Telas bem pequenas (celular em pe) */
@media (max-width: 460px) {
  .eq-summary, .kpi-grid { grid-template-columns: 1fr 1fr !important; }
  .eq-stat-val, .kpi-value { font-size: 22px; }
  .eq-title { font-size: 18px; }
  .btn-primary, .btn-secondary { padding: 8px 12px; font-size: 12.5px; }
}

/* ============================================================
   NetCopilot — Shell SIDEBAR (desktop) + drawer (mobile)
   ============================================================ */
.app.nc-shell { display: flex; flex-direction: row; height: 100vh; overflow: hidden; }
.nc-side { width: 228px; flex-shrink: 0; background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; height: 100vh; z-index: 100; }
.nc-side-top { padding: 4px 6px 16px; }
.nc-side-top .brand { font-size: 16px; }
.nc-side-nav { display: flex !important; flex-direction: column !important; gap: 4px !important; margin-left: 0 !important; overflow: visible !important; }
.nc-side-nav .tab { width: 100%; justify-content: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.nc-side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.nc-side-foot .user-chip { width: 100%; }

.nc-main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.nc-shell .titlebar { display: none; }
.nc-shell .topbar { height: auto; min-height: 54px; }
.nc-shell .topbar .brand, .nc-shell .topbar .tabs { display: none; }
.nc-shell .main { flex: 1; overflow: auto; min-height: 0; }

.nc-burger { display: none; width: 38px; height: 38px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text); font-size: 17px; cursor: pointer; margin-right: 4px; }
.nc-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 95; }
.nc-scrim.open { display: block; }

@media (max-width: 860px) {
  .nc-side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 14px 44px rgba(0,0,0,.55); }
  .nc-side.open { transform: none; }
  .nc-burger { display: flex; }
}

/* ============================================================
   NetCopilot — Mobile completo (bottom-nav + fluido p/ qualquer tela)
   ============================================================ */
.nc-bnav { display: none; position: fixed; left: 0; right: 0; bottom: 0; height: 60px;
  background: rgba(12,14,17,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
  z-index: 96; padding-bottom: env(safe-area-inset-bottom); }
.nc-bnav-i { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: none; border: none; color: var(--text-faint); font-size: 9.5px; cursor: pointer;
  font-family: var(--body); padding: 0; min-width: 0; }
.nc-bnav-i .ic { font-size: 18px; line-height: 1; }
.nc-bnav-i.on { color: var(--accent); }

/* Mobile / tablets pequenos */
@media (max-width: 860px) {
  .nc-bnav { display: flex; }
  .nc-shell .main { padding-bottom: 74px; }
  .chat-fab { bottom: 76px !important; }
  .chat-panel { padding-bottom: 0 !important; }

  /* Grids FLUIDOS — se adaptam a qualquer largura de aparelho */
  .eq-summary, .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) !important; gap: 10px !important; }
  .dash-grid, .row2 { grid-template-columns: 1fr !important; }
  .form-row { grid-template-columns: 1fr !important; }

  /* Modais e drawers respeitam a tela */
  .modal { width: 96vw !important; max-width: 96vw !important; }
  .nc-side { width: min(82vw, 300px); }

  .eq-head { gap: 8px; }
  .eq-title { font-size: 19px; }
  .cpe-table, .eq-table table { min-width: 640px; }
  .eq-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Telas medias: 2-3 colunas conforme couber (fluido) */
@media (min-width: 461px) and (max-width: 860px) {
  .eq-summary, .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
}

/* Celular em pe / telas bem pequenas */
@media (max-width: 460px) {
  .nc-shell .main { padding-left: 12px; padding-right: 12px; }
  .eq-summary, .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .eq-stat { padding: 11px 12px; }
  .eq-stat-val, .kpi-value { font-size: 21px; }
  .cpe-act { padding: 7px 8px; font-size: 11px; }
  .btn-primary, .btn-secondary, .btn-map { padding: 8px 11px; font-size: 12px; }
  .nc-side-foot .user-name { display: inline; }
}

/* Aparelhos minusculos (<=340px) */
@media (max-width: 340px) {
  .eq-summary, .kpi-grid { grid-template-columns: 1fr !important; }
  .nc-bnav-i span:not(.ic) { display: none; }
  .nc-bnav-i .ic { font-size: 20px; }
}

/* ============================================================
   NetCopilot — Tabela de CPEs (ACS) vira CARDS no celular
   ============================================================ */
@media (max-width: 680px) {
  #tr069-table-wrap .eq-table { overflow-x: visible !important; border: none; background: transparent; }
  .cpe-table { min-width: 0 !important; display: block; }
  .cpe-table thead { display: none; }
  .cpe-table tbody { display: block; }
  .cpe-table tr {
    display: block; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 13px; margin-bottom: 11px; padding: 5px 0; overflow: hidden;
  }
  .cpe-table td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    border: none !important; padding: 8px 15px; font-size: 13px;
  }
  .cpe-table td::before {
    content: attr(data-label); color: var(--text-faint); font-family: var(--mono);
    font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; flex-shrink: 0;
  }
  /* primeira celula (nome/serial) sem rotulo, em destaque */
  .cpe-table td[data-label="CPE"] {
    flex-direction: column; align-items: flex-start; gap: 2px;
    background: var(--surface-3); margin: -5px 0 4px; padding: 11px 15px;
  }
  .cpe-table td[data-label="CPE"]::before { display: none; }
  .cpe-table td[data-label="CPE"] .cpe-name { font-size: 14px; }
  /* acoes ocupam a largura */
  .cpe-table td[data-label="Ações"] { flex-direction: column; align-items: stretch; gap: 6px; }
  .cpe-table td[data-label="Ações"]::before { margin-bottom: 2px; }
  .cpe-table .cpe-actions { justify-content: flex-start; flex-wrap: wrap; gap: 7px; }
  .cpe-table .cpe-act { flex: 1; min-width: 72px; text-align: center; padding: 9px 8px; }
}

/* ============================================================
   NetCopilot — Mapa: polimento visual (tema escuro premium)
   ============================================================ */
/* Pinos com brilho por status */
.nc-pin { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--c);
  border: 2.5px solid #0a0b0d; box-shadow: 0 0 0 2px var(--c), 0 3px 10px rgba(0,0,0,.6); transition: transform .12s; }
.nc-pin:hover { transform: scale(1.25); }
.nc-pin.crit { animation: nc-pulse 1.5s infinite; }
.nc-pin.warn { box-shadow: 0 0 0 2px var(--c), 0 0 10px var(--c); }
@keyframes nc-pulse { 0%,100% { box-shadow: 0 0 0 2px var(--c), 0 0 0 0 rgba(242,85,85,.5); } 50% { box-shadow: 0 0 0 2px var(--c), 0 0 0 10px rgba(242,85,85,0); } }

/* Header do mapa mais limpo */
.tr069-map-h { background: linear-gradient(180deg, var(--bg-2), rgba(13,15,18,.9)); backdrop-filter: blur(10px); }
.tr069-map-h .t { display: flex; align-items: center; gap: 8px; }

/* Controles do Leaflet no tema escuro */
.leaflet-bar { border: 1px solid var(--border-strong) !important; box-shadow: 0 6px 22px rgba(0,0,0,.5) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a, .leaflet-control-zoom a { background: var(--surface) !important; color: var(--text) !important; border-bottom: 1px solid var(--border) !important; width: 34px !important; height: 34px !important; line-height: 34px !important; font-size: 18px !important; }
.leaflet-bar a:hover { background: var(--surface-2) !important; color: var(--accent) !important; }
.leaflet-control-attribution { background: rgba(16,19,23,.75) !important; color: var(--text-faint) !important; font-size: 9px !important; padding: 2px 7px !important; border-radius: 6px 0 0 0; backdrop-filter: blur(6px); }
.leaflet-control-attribution a { color: var(--text-dim) !important; }
.leaflet-control-layers { background: var(--surface) !important; border: 1px solid var(--border-strong) !important; border-radius: 11px !important; box-shadow: 0 8px 26px rgba(0,0,0,.5) !important; color: var(--text); }
.leaflet-control-layers-toggle { background-color: var(--surface) !important; border-radius: 10px !important; }
.leaflet-control-layers-expanded { padding: 10px 14px !important; }
.leaflet-control-layers label { margin: 4px 0; font-size: 13px; cursor: pointer; }
.leaflet-control-layers-separator { border-top: 1px solid var(--border) !important; }
.leaflet-popup-close-button { color: var(--text-dim) !important; }
/* legenda mais discreta */
.tr069-map-leg { box-shadow: 0 8px 24px rgba(0,0,0,.45); backdrop-filter: blur(8px); background: rgba(20,23,28,.85); }

/* Item "Mapa da Rede" no menu lateral (igual aos demais) */
.nc-side-nav .nc-nav-map { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--text-dim); font-weight: 500; cursor: pointer; font-size: 13.5px; transition: .14s; }
.nc-side-nav .nc-nav-map:hover { background: var(--surface); color: var(--text); }
.nc-side-nav .nc-nav-map .ico { font-size: 16px; width: 20px; text-align: center; }

/* ============================================================
   NetCopilot — Tema "NOVA CARA" (overlay de design)
   Sobrescreve paleta + refinamentos. Sem mexer em HTML/JS.
   ============================================================ */
:root {
  --bg: #070809; --bg-2: #0c0e12;
  --surface: #14181e; --surface-2: #1a1f26; --surface-3: #232a33;
  --border: #20262e; --border-strong: #2d343d;
  --text: #f4f6f9; --text-dim: #98a0ab; --text-faint: #5c636e;
  --accent: #c9f64a; --accent-soft: rgba(201,246,74,.1); --accent-dim: rgba(201,246,74,.3);
  --good: #3ee07f; --good-soft: rgba(62,224,127,.13);
  --warn: #ffa057; --warn-soft: rgba(255,160,87,.13);
  --danger: #ff5d6c; --danger-soft: rgba(255,93,108,.13);
  --info: #54d6ff; --info-soft: rgba(84,214,255,.12);
}

/* brilho de fundo (depth premium) */
body {
  background-image:
    radial-gradient(900px 520px at -5% -10%, rgba(201,246,74,.06), transparent 60%),
    radial-gradient(720px 520px at 105% 0%, rgba(84,214,255,.05), transparent 55%);
  background-attachment: fixed;
}

/* Sidebar refinada */
.nc-side { padding: 18px 14px; }
.nc-side-nav .tab, .nc-side-nav .nc-nav-map { border-radius: 13px; padding: 11px 13px; font-weight: 500; }
.nc-side-nav .tab.active { position: relative; font-weight: 600; }
.nc-side-nav .tab.active::before { content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nc-side-foot { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 11px; margin-top: auto; }
.nc-side .brand-logo { box-shadow: 0 8px 24px var(--accent-dim); }

/* Cards / KPIs / tabelas arredondados */
.eq-stat, .kpi, .panel, .eq-table, .tcard, .cpe-alerts, .modal, .eq-table .cpe-table { border-radius: 18px !important; }
.eq-stat { background: var(--surface); border-color: var(--border); }
.eq-stat-val, .kpi-value { letter-spacing: -.02em; }

/* Botoes */
.btn-primary { background: linear-gradient(135deg, var(--accent), #a4d800) !important; color: #070809 !important; border-radius: 13px !important; box-shadow: 0 8px 22px var(--accent-dim); border: none !important; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary, .btn-map, .cpe-act { border-radius: 11px !important; }
.eq-search, .form-input, .chat-input, .search { border-radius: 13px !important; }
.filter-chip, .audit-chip, .activity-chip, .proto-tab { border-radius: 10px !important; }

/* topbar mais clean */
.nc-shell .topbar { background: transparent; border-bottom: 1px solid var(--border); }
.nc-burger { border-radius: 12px; }

/* NOVA CARA — brilho de fundo reforcado (visivel) */
body {
  background-image:
    radial-gradient(1100px 640px at -8% -14%, rgba(201,246,74,.11), transparent 58%),
    radial-gradient(900px 640px at 108% -4%, rgba(84,214,255,.09), transparent 55%) !important;
  background-attachment: fixed !important;
}
/* ============================================================
   NetCopilot — VISAO GERAL ("nova cara"). Tudo escopado em .vg
   pra nao vazar nos outros modulos. Usa as vars do theme.css.
   ============================================================ */
.vg { padding: 4px 2px 30px; }
.vg-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.vg-greet { font-weight: 800; font-size: 27px; letter-spacing: -.02em; line-height: 1.1; }
.vg-sub { font-weight: 500; color: var(--text-dim); font-size: 13.5px; margin-top: 4px; text-transform: capitalize; }
.vg-hd-r { display: flex; gap: 10px; align-items: center; }
.vg-search { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 11px 16px; width: 240px; color: var(--text); font-size: 13.5px; }
.vg-search::placeholder { color: var(--text-faint); }
.vg-icbtn { width: 42px; height: 42px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); font-size: 17px; cursor: pointer; }
.vg-icbtn:hover { color: var(--accent); border-color: var(--accent-dim); }

/* KPIs */
.vg-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.vg-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px 20px; position: relative; overflow: hidden; }
.vg-kpi::after { content: ""; position: absolute; inset: 0; border-radius: 18px; padding: 1px; background: linear-gradient(160deg, rgba(255,255,255,.06), transparent 40%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.vg-kc { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 19px; margin-bottom: 14px; }
.vg-kl { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.vg-kv { font-weight: 800; font-size: 32px; letter-spacing: -.03em; margin-top: 2px; line-height: 1.1; }
.vg-kv-u { font-size: 15px; color: var(--text-dim); margin-left: 4px; }
.vg-kd { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }

/* grid 3 cols */
.vg-g3 { display: grid; grid-template-columns: 1.1fr 1.1fr .9fr; gap: 16px; margin-bottom: 20px; }
.vg-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.vg-ch { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.vg-ct { font-weight: 700; font-size: 16px; }
.vg-lk { font-size: 12.5px; color: var(--accent); cursor: pointer; font-weight: 600; }

/* donut */
.vg-donut { position: relative; width: 120px; height: 120px; margin: 4px auto 14px; }
.vg-donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.vg-donut-n { font-weight: 800; font-size: 26px; }
.vg-donut-s { font-size: 10px; color: var(--text-dim); font-family: monospace; }
.vg-leg { display: flex; flex-direction: column; gap: 9px; }
.vg-li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.vg-sw { width: 10px; height: 10px; border-radius: 3px; }
.vg-li .vg-n { margin-left: auto; font-family: monospace; font-weight: 700; }

/* sinal optico */
.vg-sg { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; font-size: 12px; }
.vg-sg .vg-nm { width: 70px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vg-sg .vg-bar { flex: 1; height: 7px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.vg-sg .vg-bar i { display: block; height: 100%; border-radius: 5px; }
.vg-sg .vg-v { width: 38px; text-align: right; font-family: monospace; font-weight: 600; }

/* copiloto sugere */
.vg-ai { background: linear-gradient(165deg, var(--accent-soft), var(--surface)); border: 1px solid var(--accent-dim); }
.vg-ai-ok { color: var(--text-dim); font-size: 13px; padding: 6px 0; }
.vg-ai-row { display: flex; gap: 11px; padding: 11px 0; border-top: 1px dashed var(--border); }
.vg-ai-row:first-of-type { border: none; }
.vg-ai-ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.vg-ai-t { font-weight: 600; font-size: 12.5px; }
.vg-ai-d { font-size: 11.5px; color: var(--text-dim); margin-bottom: 3px; }
.vg-fixb { margin-top: 6px; background: var(--accent); color: #070809; border: none; border-radius: 8px; padding: 6px 12px; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.vg-fixb.warn { background: var(--warn); }
.vg-fixb:hover { filter: brightness(1.06); }

/* tabela */
.vg-tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.vg-tb { display: flex; align-items: center; gap: 9px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.vg-chip { padding: 6px 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); font-size: 12px; cursor: pointer; }
.vg-chip.on { background: var(--accent-soft); border-color: var(--accent-dim); color: var(--accent); }
.vg-table { width: 100%; border-collapse: collapse; }
.vg-table th { text-align: left; font-family: monospace; font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); padding: 13px 20px; border-bottom: 1px solid var(--border); font-weight: 600; }
.vg-table td { padding: 14px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.vg-table tbody tr:last-child td { border: none; }
.vg-table tbody tr:hover { background: var(--surface-2); }
.vg-cli { display: flex; align-items: center; gap: 11px; }
.vg-ph { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-size: 15px; border: 1px solid var(--border-strong); flex-shrink: 0; }
.vg-cn { font-weight: 600; }
.vg-cs { font-family: monospace; font-size: 10.5px; color: var(--text-faint); }
.vg-mono { font-family: monospace; font-size: 12px; color: var(--text-dim); }
.vg-sig { display: flex; align-items: center; gap: 8px; }
.vg-sig .vg-b { width: 50px; height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.vg-sig .vg-b i { display: block; height: 100%; }
.vg-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.vg-st.on { background: var(--good-soft); color: var(--good); }
.vg-st.nd { background: var(--warn-soft); color: var(--warn); }
.vg-st.bad { background: var(--danger-soft); color: var(--danger); }
.vg-st .vg-d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vg-ra { display: flex; gap: 7px; justify-content: flex-end; }
.vg-ab { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-dim); cursor: pointer; font-size: 13px; }
.vg-ab:hover { background: var(--surface-3); color: var(--text); }
.vg-empty { padding: 30px 20px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* cards mobile */
.vg-cardsm { display: none; flex-direction: column; gap: 11px; padding: 14px; }
.vg-smc { background: var(--surface-2); border: 1px solid var(--border); border-radius: 15px; padding: 14px; }
.vg-smc-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.vg-smc-g { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; font-size: 12px; }
.vg-smc-k { color: var(--text-faint); font-size: 10px; text-transform: uppercase; font-family: monospace; }
.vg-smc-v { font-family: monospace; font-weight: 600; margin-top: 1px; }

/* responsivo */
@media (max-width: 1080px) {
  .vg-kpis { grid-template-columns: repeat(2, 1fr); }
  .vg-g3 { grid-template-columns: 1fr 1fr; }
  .vg-g3 .vg-ai { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .vg-greet { font-size: 22px; }
  .vg-search { display: none; }
  .vg-g3 { grid-template-columns: 1fr; }
  .vg-table { display: none; }
  .vg-cardsm { display: flex; }
}
/* ===== Form manual de Wi-Fi (SSID/senha/canal) no modal do CPE ===== */
.cpe-wifi-edit { margin: 4px 0 14px; }
.wifi-form { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.wifi-form-h { font-weight: 700; font-size: 13px; color: var(--accent); }
.wifi-f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-dim); }
.wifi-f > span { font-weight: 500; }
.wifi-f input { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 14px; width: 100%; }
.wifi-f input:focus { outline: none; border-color: var(--accent-dim); }
.wifi-pwd { position: relative; display: flex; }
.wifi-pwd input { padding-right: 42px; }
.wifi-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: none; cursor: pointer; font-size: 15px; padding: 6px; opacity: .7; }
.wifi-eye:hover { opacity: 1; }
.wifi-form-act { display: flex; gap: 9px; justify-content: flex-end; margin-top: 2px; }
.cpe-act.primary { background: var(--accent); color: #070809; border-color: var(--accent); font-weight: 700; }
.cpe-act.primary:hover { filter: brightness(1.06); }
.wifi-form-note { font-size: 11px; color: var(--text-faint); }
/* ===== Badge de tipo de CPE (ONU de fibra vs Roteador) ===== */
.cpe-type { display: inline-block; font-size: 9.5px; font-weight: 700; padding: 1px 7px;
  border-radius: 6px; vertical-align: middle; margin-left: 7px; letter-spacing: .02em;
  white-space: nowrap; }
.cpe-type.onu { background: var(--info-soft); color: var(--info); }
.cpe-type.router { background: var(--warn-soft); color: var(--warn); }
/* ===== Modal "Abrir chamado" (OS no IXC) ===== */
.os-scrim { position: fixed; inset: 0; background: rgba(4,5,7,.66); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center; padding: 38px 16px; overflow: auto; z-index: 200; }
.os-scrim.active { display: flex; }
.os-modal { width: 100%; max-width: 660px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
.os-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.os-t { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.os-s { color: var(--text-dim); font-size: 12.5px; margin-top: 3px; }
.os-s b { color: var(--text); }
.os-x { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-dim); font-size: 14px; cursor: pointer; flex-shrink: 0; }
.os-b { padding: 18px 22px; }
.os-ai { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-dim); padding: 1px 7px; border-radius: 6px; }
.os-pick { background: linear-gradient(160deg, var(--accent-soft), transparent); border: 1px solid var(--accent-dim); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.os-pick-h { font-size: 12px; color: var(--accent); font-weight: 700; margin-bottom: 11px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.os-frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .os-frow { grid-template-columns: 1fr; } }
.os-fld { display: block; font-size: 11px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.os-fld > span { text-transform: none; font-weight: 400; }
.os-sel { position: relative; display: block; margin-top: 5px; }
.os-sel::after { content: "▾"; position: absolute; right: 12px; top: 10px; color: var(--text-dim); pointer-events: none; }
.os-sel select, .os-ta { width: 100%; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 13.5px; font-family: inherit; }
.os-sel select { appearance: none; cursor: pointer; padding-right: 30px; }
.os-ta { margin-top: 5px; min-height: 92px; line-height: 1.5; resize: vertical; }
.os-fill { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
@media (max-width: 600px) { .os-fill { grid-template-columns: 1fr; } }
.os-field { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.os-field .osk { font-size: 10px; color: var(--text-faint); text-transform: uppercase; font-family: monospace; letter-spacing: .04em; }
.os-field .osv { font-size: 13px; font-weight: 600; margin-top: 1px; word-break: break-word; }
.os-loading { padding: 16px; text-align: center; color: var(--text-faint); font-size: 13px; }
.os-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 22px; border-top: 1px solid var(--border); background: var(--bg-2, var(--surface-2)); flex-wrap: wrap; }
.os-status { font-size: 12.5px; color: var(--text-dim); flex: 1; min-width: 160px; }
.os-status.ok { color: var(--good); font-weight: 600; }
.os-status.err { color: var(--danger); font-weight: 600; }
.os-status.warn { color: var(--warn); }
.os-actions { display: flex; gap: 10px; }

/* botoes-gatilho */
.ca-os { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-dim); border-radius: 8px; padding: 4px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ca-os:hover { background: var(--accent-dim); }
.diag-actions { margin-top: 12px; }
.diag-os { background: var(--accent); color: #070809; border: none; border-radius: 9px; padding: 9px 15px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.diag-os:hover { filter: brightness(1.06); }
/* ===== Combo com busca (dropdown digitável) — usado no modal de OS ===== */
.combo { position: relative; margin-top: 5px; }
.combo-inp { width: 100%; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 10px 12px; color: var(--text); font-size: 13.5px; font-family: inherit; }
.combo-inp:focus { outline: none; border-color: var(--accent-dim); }
.combo-inp::placeholder { color: var(--text-faint); }
.combo-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 11px; box-shadow: 0 16px 40px rgba(0,0,0,.5);
  max-height: 240px; overflow: auto; z-index: 10; display: none; padding: 5px; }
.combo.open .combo-pop { display: block; }
.combo-opt { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; display: flex; flex-direction: column; gap: 1px; }
.combo-opt:hover { background: var(--surface-2); }
.combo-lb { color: var(--text); }
.combo-sub { font-size: 10.5px; color: var(--text-faint); font-family: monospace; }
.combo-empty { padding: 10px; color: var(--text-faint); font-size: 12px; text-align: center; }

/* botao desabilitado visivelmente apagado (evita "cliquei e nao foi") */
.cpe-act:disabled, .cpe-act.primary:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.4); }
/* ===== Wallboard (modo TV) — overlay full-screen ===== */
.nc-nav-wall { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px;
  color: var(--text-dim); font-weight: 500; cursor: pointer; font-size: 13.5px; }
.nc-nav-wall:hover { background: var(--surface); color: var(--text); }
.nc-nav-wall .ico { font-size: 15px; width: 18px; text-align: center; }

.nc-wall { position: fixed; inset: 0; z-index: 300; background: var(--bg, #060708); display: none;
  flex-direction: column; padding: 20px; overflow: hidden;
  background-image: radial-gradient(1200px 700px at 50% -20%, rgba(201,246,74,.05), transparent 60%); }
.nc-wall.active { display: flex; }
.wb-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.wb-brand { display: flex; align-items: center; gap: 12px; }
.wb-bm { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), #a4d800); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.wb-bt { font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.wb-bs { font-family: monospace; font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .14em; }
.wb-clock { margin-left: auto; font-family: monospace; font-size: 24px; font-weight: 600; color: var(--info); }
.wb-live { font-size: 12px; font-weight: 700; color: var(--good); background: var(--good-soft); padding: 6px 13px; border-radius: 999px; display: flex; align-items: center; gap: 7px; }
.wb-live .d { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: wbp 1.3s infinite; }
@keyframes wbp { 50% { opacity: .3; } }
.wb-x { width: 40px; height: 40px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-dim); font-size: 16px; cursor: pointer; }
.wb-x:hover { color: var(--text); }
.wb-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.wb-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 20px; }
.wb-kl { font-size: 13px; color: var(--text-dim); }
.wb-kv { font-weight: 800; font-size: 44px; letter-spacing: -.03em; line-height: 1.05; margin-top: 4px; }
.wb-kv .u { font-size: 20px; color: var(--text-faint); margin-left: 3px; }
.wb-main { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 14px; flex: 1; min-height: 0; }
.wb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; overflow: auto; }
.wb-ct { font-weight: 700; font-size: 17px; margin-bottom: 16px; }
.wb-donut { position: relative; width: 190px; height: 190px; margin: 10px auto; }
.wb-dn { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.wb-dnv { font-weight: 800; font-size: 42px; }
.wb-dns { font-size: 12px; color: var(--text-dim); font-family: monospace; }
.wb-leg { display: flex; flex-direction: column; gap: 11px; margin-top: 12px; }
.wb-li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.wb-li .sw { width: 12px; height: 12px; border-radius: 3px; }
.wb-li .n { margin-left: auto; font-family: monospace; font-weight: 700; }
.wb-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.wb-row:last-child { border: none; }
.wb-row .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.wb-row .nm { font-weight: 600; }
.wb-row .meta { font-family: monospace; font-size: 12px; color: var(--text-faint); }
.wb-row .v { margin-left: auto; font-family: monospace; font-weight: 700; font-size: 12px; }
.wb-empty { color: var(--text-dim); font-size: 15px; padding: 20px 0; }
.wb-srow { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.wb-srow b { font-family: monospace; font-size: 18px; }
.wb-foot { font-family: monospace; font-size: 11px; color: var(--text-faint); margin-top: 14px; }
@media (max-width: 1000px) { .wb-kpis { grid-template-columns: repeat(2, 1fr); } .wb-main { grid-template-columns: 1fr; } }
/* ===== Ronda IA (overlay) ===== */
.nc-nav-ronda { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; color: var(--text-dim); font-weight: 500; cursor: pointer; font-size: 13.5px; }
.nc-nav-ronda:hover { background: var(--surface); color: var(--text); }
.nc-nav-ronda .ico { font-size: 15px; width: 18px; text-align: center; }
.rd-scrim { position: fixed; inset: 0; z-index: 200; background: rgba(4,5,7,.66); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding: 40px 18px; overflow: auto; }
.rd-scrim.active { display: flex; }
.rd-modal { width: 100%; max-width: 640px; background: linear-gradient(170deg, var(--accent-soft), var(--surface)); border: 1px solid var(--accent-dim); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
.rd-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.rd-bot { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.rd-t { font-weight: 800; font-size: 17px; }
.rd-s { font-family: monospace; font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.rd-rerun { background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-dim); border-radius: 9px; padding: 7px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.rd-rerun:hover { color: var(--accent); border-color: var(--accent-dim); }
.rd-x { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-dim); font-size: 14px; cursor: pointer; }
.rd-b { padding: 20px; }
.rd-loading { padding: 24px; text-align: center; color: var(--text-dim); font-size: 14px; }
.rd-brief { font-size: 14.5px; line-height: 1.65; color: var(--text); margin-bottom: 18px; }
.rd-stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-bottom: 18px; }
.rd-st { background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 12px; text-align: center; }
.rd-stv { font-weight: 800; font-size: 25px; }
.rd-stl { font-size: 11px; color: var(--text-dim); }
.rd-sec { font-family: monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); margin: 4px 0 12px; }
.rd-item { display: flex; gap: 11px; padding: 11px 0; border-top: 1px dashed var(--border); }
.rd-item:first-of-type { border: none; }
.rd-iic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.rd-it { font-weight: 600; font-size: 13px; }
.rd-id { font-size: 12px; color: var(--text-dim); margin: 3px 0 7px; }
.rd-go { background: var(--accent); color: #070809; border: none; border-radius: 8px; padding: 5px 11px; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.rd-ok { color: var(--text-dim); font-size: 14px; padding: 10px 0; }
/* ===== Incidentes em massa (overlay) ===== */
.nc-nav-incid { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; color: var(--text-dim); font-weight: 500; cursor: pointer; font-size: 13.5px; }
.nc-nav-incid:hover { background: var(--surface); color: var(--text); }
.nc-nav-incid .ico { font-size: 15px; width: 18px; text-align: center; }
.ic-scrim { position: fixed; inset: 0; z-index: 200; background: rgba(4,5,7,.66); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding: 40px 18px; overflow: auto; }
.ic-scrim.active { display: flex; }
.ic-modal { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
.ic-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.ic-bot { width: 40px; height: 40px; border-radius: 12px; background: var(--danger-soft); border: 1px solid rgba(255,93,108,.4); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.ic-t { font-weight: 800; font-size: 17px; }
.ic-s { font-family: monospace; font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.ic-rerun, .ic-x { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-dim); font-size: 14px; cursor: pointer; }
.ic-b { padding: 18px 20px; }
.ic-loading { padding: 24px; text-align: center; color: var(--text-dim); font-size: 14px; }
.ic-ok { color: var(--good); font-size: 15px; font-weight: 600; padding: 12px 0; }
.ic-okd { color: var(--text-dim); font-size: 12.5px; font-weight: 400; margin-top: 8px; line-height: 1.55; }
.ic-card { background: linear-gradient(160deg, var(--danger-soft), var(--surface-2)); border: 1px solid rgba(255,93,108,.4); border-radius: 15px; padding: 16px; margin-bottom: 14px; }
.ic-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.ic-card-t { font-family: var(--d, inherit); font-weight: 800; font-size: 16px; }
.ic-pulse { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--danger); background: var(--danger-soft); padding: 3px 9px; border-radius: 999px; display: flex; align-items: center; gap: 5px; }
.ic-pulse .d2 { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); animation: icp 1.2s infinite; }
@keyframes icp { 50% { opacity: .3; } }
.ic-card-d { color: var(--text-dim); font-size: 12.5px; line-height: 1.55; margin-bottom: 12px; }
.ic-card-d b { color: var(--text); }
.ic-os { background: var(--warn); color: #070809; border: none; border-radius: 8px; padding: 7px 13px; font-size: 12px; font-weight: 700; cursor: pointer; }
.ic-list { margin-top: 13px; border-top: 1px solid var(--border); padding-top: 10px; }
.ic-cpe { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 12.5px; }
.ic-cpe .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.ic-cpe .nm { font-family: monospace; }
.ic-cpe .tm { margin-left: auto; font-family: monospace; font-size: 11px; color: var(--danger); }
.ic-more { font-size: 11px; color: var(--text-faint); padding-top: 6px; }
/* ===== Score & churn (overlay) ===== */
.nc-nav-score { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; color: var(--text-dim); font-weight: 500; cursor: pointer; font-size: 13.5px; }
.nc-nav-score:hover { background: var(--surface); color: var(--text); }
.nc-nav-score .ico { font-size: 15px; width: 18px; text-align: center; }
.sc-scrim { position: fixed; inset: 0; z-index: 200; background: rgba(4,5,7,.66); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding: 40px 18px; overflow: auto; }
.sc-scrim.active { display: flex; }
.sc-modal { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
.sc-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.sc-bot { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.sc-t { font-weight: 800; font-size: 17px; }
.sc-s { font-family: monospace; font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.sc-rerun, .sc-x { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-dim); font-size: 14px; cursor: pointer; }
.sc-b { padding: 18px 20px; }
.sc-loading { padding: 24px; text-align: center; color: var(--text-dim); font-size: 14px; }
.sc-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-bottom: 16px; }
.sc-kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 13px; text-align: center; }
.sc-kv { font-weight: 800; font-size: 26px; }
.sc-kl { font-size: 11px; color: var(--text-dim); }
.sc-sec { font-family: monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); margin: 4px 0 11px; }
.sc-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sc-row:last-child { border: none; }
.sc-ava { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--text-dim); font-size: 12px; flex-shrink: 0; }
.sc-info { flex: 1; min-width: 0; }
.sc-nm { font-weight: 600; font-size: 13.5px; }
.sc-rs { font-family: monospace; font-size: 10.5px; color: var(--text-faint); }
.sc-rk { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; flex-shrink: 0; }
.sc-rk.hi { background: var(--danger-soft); color: var(--danger); }
.sc-rk.md { background: var(--warn-soft); color: var(--warn); }
.sc-rk.lo { background: var(--good-soft); color: var(--good); }
.sc-score { display: flex; align-items: center; gap: 8px; width: 92px; }
.sc-bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.sc-bar i { display: block; height: 100%; }
.sc-sv { font-family: monospace; font-weight: 700; font-size: 13px; width: 22px; text-align: right; }
.sc-go { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-dim); cursor: pointer; font-size: 13px; flex-shrink: 0; }
.sc-go:hover { color: var(--text); }
/* ===== Previsão de fibra (overlay) ===== */
.nc-nav-prev { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; color: var(--text-dim); font-weight: 500; cursor: pointer; font-size: 13.5px; }
.nc-nav-prev:hover { background: var(--surface); color: var(--text); }
.nc-nav-prev .ico { font-size: 15px; width: 18px; text-align: center; }
.pv-scrim { position: fixed; inset: 0; z-index: 200; background: rgba(4,5,7,.66); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding: 40px 18px; overflow: auto; }
.pv-scrim.active { display: flex; }
.pv-modal { width: 100%; max-width: 600px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
.pv-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.pv-bot { width: 40px; height: 40px; border-radius: 12px; background: var(--warn-soft); border: 1px solid rgba(255,160,87,.35); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.pv-t { font-weight: 800; font-size: 17px; }
.pv-s { font-family: monospace; font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.pv-rerun, .pv-x { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-dim); font-size: 14px; cursor: pointer; }
.pv-b { padding: 18px 20px; }
.pv-loading { padding: 24px; text-align: center; color: var(--text-dim); font-size: 14px; }
.pv-coletando { text-align: center; padding: 22px 10px; }
.pv-cic { font-size: 38px; margin-bottom: 12px; }
.pv-ct2 { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.pv-cd { color: var(--text-dim); font-size: 13px; line-height: 1.6; max-width: 440px; margin: 0 auto; }
.pv-cd b { color: var(--text); }
.pv-sec { font-family: monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); margin: 2px 0 12px; }
.pv-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.pv-row:last-child { border: none; }
.pv-info { flex: 1; min-width: 0; }
.pv-nm { font-weight: 600; font-size: 13px; font-family: monospace; }
.pv-meta { font-family: monospace; font-size: 10.5px; color: var(--text-faint); }
.pv-eta { font-family: monospace; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 7px; flex-shrink: 0; }
.pv-eta.b { background: var(--danger-soft); color: var(--danger); }
.pv-eta.w { background: var(--warn-soft); color: var(--warn); }
.pv-go { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-dim); cursor: pointer; font-size: 13px; flex-shrink: 0; }
.pv-go:hover { color: var(--text); }

.rd-cli { color: var(--accent); font-weight: 700; }

.cpe-pend { display:inline-block; font-size:10px; font-weight:700; padding:2px 8px; border-radius:6px; background:var(--warn-soft); color:var(--warn); white-space:nowrap; vertical-align:middle; }

.wifi-chks{display:flex;gap:16px;flex-wrap:wrap;margin:2px 0}
.wifi-chk{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--text-dim);cursor:pointer}
.wifi-chk input{width:16px;height:16px;accent-color:var(--accent);cursor:pointer}

.diag-tools{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0 10px}
.diag-host{background:var(--surface-2);border:1px solid var(--border-strong);border-radius:9px;padding:8px 11px;color:var(--text);font-family:monospace;font-size:13px;flex:1;min-width:140px}
.diag-result{margin-top:4px}
.diag-run{font-size:12.5px;color:var(--text-dim);padding:8px 0}
.diag-ok{font-size:13px;font-weight:600;padding:8px 0}

.adv-tools{display:flex;flex-direction:column;gap:9px}
.adv-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.adv-lbl{font-size:12px;color:var(--text-dim);min-width:108px}
.adv-note{font-size:11px;color:var(--warn)}

/* ---- Itens de menu das novas ferramentas (Inventário/Fraude/Rogue/Topologia) ----
   Mesmo estilo dos demais itens do nc-side-nav (estava faltando, ficava sem estilo). */
.nc-side-nav .nc-nav-inv,
.nc-side-nav .nc-nav-fraude,
.nc-side-nav .nc-nav-rogue,
.nc-side-nav .nc-nav-topo {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 13px;
  color: var(--text-dim); font-weight: 500; cursor: pointer;
  font-size: 13.5px; transition: .14s;
}
.nc-side-nav .nc-nav-inv:hover,
.nc-side-nav .nc-nav-fraude:hover,
.nc-side-nav .nc-nav-rogue:hover,
.nc-side-nav .nc-nav-topo:hover {
  background: var(--surface); color: var(--text);
}
.nc-side-nav .nc-nav-inv .ico,
.nc-side-nav .nc-nav-fraude .ico,
.nc-side-nav .nc-nav-rogue .ico,
.nc-side-nav .nc-nav-topo .ico {
  font-size: 16px; width: 20px; text-align: center;
}

/* ---- Janelas de overlay roláveis (Inventário/Fraude/Topologia/Score/Previsão/
   Ronda/Incidentes): cabeçalho FIXO + corpo rola, altura capada na tela. Antes a
   janela inteira crescia e rolava junto com o fundo, escondendo título/KPIs. ---- */
.sc-modal, .pv-modal, .rd-modal, .ic-modal {
  display: flex !important;
  flex-direction: column;
  max-height: calc(100vh - 80px);
}
.sc-h, .pv-h, .rd-h, .ic-h { flex: 0 0 auto; }
.sc-b, .pv-b, .rd-b, .ic-b {
  overflow-y: auto;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}
/* barra de rolagem discreta no tema escuro */
.sc-b::-webkit-scrollbar, .pv-b::-webkit-scrollbar,
.rd-b::-webkit-scrollbar, .ic-b::-webkit-scrollbar { width: 9px; }
.sc-b::-webkit-scrollbar-thumb, .pv-b::-webkit-scrollbar-thumb,
.rd-b::-webkit-scrollbar-thumb, .ic-b::-webkit-scrollbar-thumb {
  background: var(--border-strong, #3a3f4a); border-radius: 6px;
}
