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

:root {
  --bg: #050B14;
  --surface: #0B1422;
  --surface-2: #111C2B;
  --border: #1c2a3d;
  --border-soft: #142032;
  --text: #f4f6f9;
  --text-muted: #8593a8;
  --accent: #FFC400;
  --accent-soft: #FFD54D;
  --accent-dark: #3d2a00;
  --danger: #FF4D5F;
  --success: #22C55E;
  --info: #3B82F6;
  --analytics: #8B5CF6;
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(255,196,0,0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ============ LOGIN ============ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  width: 640px; height: 640px;
  border: 1px solid rgba(255,196,0,0.08);
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.login-wrap::after {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border: 1px solid rgba(255,196,0,0.12);
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-ring 3.5s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { width: 60px; height: 60px; opacity: 0.9; }
  100% { width: 640px; height: 640px; opacity: 0; }
}

.login-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.75rem 2.5rem;
  width: 340px;
  position: relative;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-logo { display: block; width: 100%; max-width: 200px; margin: 0 auto 1.75rem; filter: invert(1) brightness(1.6); }
.login-sub { text-align: center; font-size: 12px; color: var(--text-muted); margin: -1.25rem 0 1.75rem; letter-spacing: 0.5px; }

.login-card input {
  width: 100%;
  background: #0f0f11;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,196,0,0.15);
}
.login-card button {
  width: 100%;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #1a1200;
  border: none;
  font-weight: 600;
  font-size: 14px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.login-card button:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,196,0,0.25); }
.login-card button:active { transform: translateY(0); }
.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 10px;
  text-align: center;
  background: rgba(255,92,92,0.08);
  border: 1px solid rgba(255,92,92,0.2);
  padding: 8px;
  border-radius: 8px;
}

/* ============ LAYOUT ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  backdrop-filter: blur(6px);
}
.brand-logo { height: 30px; filter: invert(1) brightness(1.6); }
.user-badge {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #1a1200;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.logout-link {
  font-size: 13px; color: var(--text-muted);
  transition: color .15s ease;
  display: flex; align-items: center; gap: 5px;
}
.logout-link:hover { color: var(--accent); }

.topbar { position: sticky; top: 0; z-index: 20; }

.navbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  position: fixed;
  top: 84px;
  left: 20px;
  bottom: 66px;
  width: 200px;
  padding: 10px;
  border-radius: 20px;
  font-size: 13px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05), 0 0 60px rgba(139,92,246,0.06);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 15;
}
.navbar a {
  padding: 10px 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 13px;
  transition: color .15s ease, background .15s ease, transform .15s ease;
  font-weight: 500;
  white-space: nowrap;
}
.navbar a i { font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; }
.navbar a:hover { color: var(--text); background: rgba(255,255,255,0.05); transform: translateX(2px); }
.navbar a.active {
  color: #1a1200;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  box-shadow: 0 4px 14px rgba(255,196,0,0.3);
}
.navbar a.active i { color: #1a1200; }

.content { padding: 0 1.75rem 1.75rem; padding-left: calc(200px + 40px + 1.75rem); max-width: 1440px; margin: 0 auto; }

/* ============ CARDS ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card:hover { border-color: var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.metric-label { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; font-weight: 500; }
.metric-value { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -0.5px; }
.metric-value.accent { color: var(--accent); }
.metric-value.danger { color: var(--danger); }
.metric-value.success { color: var(--success); }
.metric-value.info { color: var(--info); }
.metric-value.purple { color: var(--analytics); }

/* ============ BOTOES ============ */
.btn {
  border: none;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-primary { background: linear-gradient(180deg, var(--accent-soft), var(--accent)); color: #1a1200; }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(255,196,0,0.22); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }

/* ============ TABELAS ============ */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--text-muted); font-weight: 500; padding: 10px 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 12px 8px; border-top: 1px solid var(--border-soft); }
tr.row-hover { transition: background .15s ease; }
tr.row-hover:hover { background: var(--surface-2); }

.badge { font-size: 11px; padding: 4px 11px; border-radius: 20px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.badge-online { background: rgba(34,197,94,0.12); color: var(--success); }
.badge-online::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px var(--success); }
.badge-offline { background: rgba(255,77,95,0.1); color: var(--danger); }
.badge-offline::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-title { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -0.3px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.form-grid input, .form-grid select {
  background: #0f0f11; border: 1px solid var(--border); color: var(--text);
  padding: 11px 13px; border-radius: 9px; font-size: 13px; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-grid input:focus, .form-grid select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,196,0,0.12);
}

/* ============ LISTA DE DISPOSITIVOS (estilo linha) ============ */
.device-row {
  display: grid;
  grid-template-columns: 130px 1.6fr 1fr 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 8px;
  border-top: 1px solid var(--border-soft);
  transition: background .15s ease;
}
.device-row:hover { background: var(--surface-2); }
.status-pill {
  font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap;
}
.status-pill.on { background: rgba(34,197,94,0.12); color: var(--success); box-shadow: 0 0 16px rgba(34,197,94,0.12); }
.status-pill.on::before { content:''; width:6px; height:6px; border-radius:50%; background: var(--success); box-shadow: 0 0 10px 2px var(--success); }
.status-pill.off { background: rgba(255,77,95,0.1); color: var(--danger); }
.status-pill.off::before { content:''; width:6px; height:6px; border-radius:50%; background: var(--danger); box-shadow: 0 0 6px 1px var(--danger); }
.status-pill.blocked { background: rgba(255,196,0,0.12); color: var(--accent); box-shadow: 0 0 16px rgba(255,196,0,0.12); }
.status-pill.blocked::before { content:''; width:6px; height:6px; border-radius:50%; background: var(--accent); box-shadow: 0 0 10px 2px var(--accent); }
.device-client-name { color: var(--accent); font-weight: 600; font-size: 14px; }
.device-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.device-col-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 3px; }
.device-col-value { font-size: 13px; margin: 0; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  transition: all .15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ============ MINI-PAINEL DE DISPOSITIVO ============ */
.sheet-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: 1.25rem; }
.sheet-close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  transition: all .15s ease;
}
.sheet-close:hover { color: var(--text); border-color: var(--border-strong, var(--border)); }

.signal-box {
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1rem;
}
.signal-box.bad { border-left-color: var(--danger); background: linear-gradient(90deg, rgba(255,92,92,0.06), transparent 60%); }
.signal-box.warn { border-left-color: var(--accent); background: linear-gradient(90deg, rgba(255,196,0,0.06), transparent 60%); }
.signal-box.good { border-left-color: var(--success); }

.section-title { font-size: 14px; font-weight: 700; margin: 0 0 14px; letter-spacing: -0.2px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; }
.info-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 4px; }
.info-value { font-size: 14px; font-weight: 500; margin: 0; }

/* ============ FUNDO IMERSIVO (partículas + varredura radar) ============ */
#bg-particles {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}
body::before {
  content: '';
  position: fixed; inset: -20%;
  z-index: 0; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(255,196,0,0.05) 8deg, transparent 40deg);
  animation: radar-sweep 8s linear infinite;
}
@keyframes radar-sweep { to { transform: rotate(360deg); } }
.topbar, .navbar, .content, .login-wrap { position: relative; z-index: 1; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 12px;
  flex: 1; max-width: 340px;
  margin: 0 1rem;
}
.search-box i { color: var(--text-muted); font-size: 15px; }
.search-box input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 13px; width: 100%;
  font-family: inherit;
}
.search-box input::placeholder { color: var(--text-muted); }
@media (max-width: 760px) {
  .search-box { margin: 0; max-width: none; }
  .topbar { flex-wrap: wrap; gap: 10px; }
}

/* ============ GLASSMORPHISM ============ */
body {
  background: #030507;
  position: relative;
}
body::after {
  content: '';
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 500px at 15% 5%, rgba(255,196,0,0.07), transparent 60%),
    radial-gradient(600px 500px at 88% 25%, rgba(59,130,246,0.05), transparent 55%),
    radial-gradient(650px 550px at 30% 90%, rgba(139,92,246,0.045), transparent 60%);
  animation: derivar-blobs 26s ease-in-out infinite;
  will-change: transform;
}
@keyframes derivar-blobs {
  0%   { transform: translate(0%, 0%); }
  33%  { transform: translate(2%, 3%); }
  66%  { transform: translate(-2%, -2%); }
  100% { transform: translate(0%, 0%); }
}
.card, .stat-card, .modal-panel, .login-card, .signal-box {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 24px rgba(0,0,0,0.3);
}
.card:hover, .stat-card:hover { border-color: rgba(255,255,255,0.14); }
.topbar {
  background: rgba(3,5,7,0.45);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.modal-panel { background: rgba(10,12,16,0.55); }
.search-box, .form-grid input, .form-grid select, .login-card input {
  background: rgba(255,255,255,0.03) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

/* ============ RESPONSIVO (CELULAR) ============ */
@media (max-width: 760px) {
  .content { padding: 1rem; padding-left: 1rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .navbar {
    position: static; flex-direction: row; width: auto; max-width: calc(100% - 2rem);
    top: auto; left: auto; bottom: auto; margin: 10px auto 16px;
    gap: 0.15rem; padding: 0.4rem 0.75rem; overflow-x: auto;
  }
  .navbar a { padding: 8px 10px; font-size: 12.5px; white-space: nowrap; }
  .navbar a i { margin-right: 4px; }
  .topbar { padding: 0.7rem 1rem; position: static; }
  .brand-logo { height: 24px; }
  .logout-link span, .logout-link { font-size: 0; }
  .logout-link i { font-size: 18px; margin-right: 0; }
  #radar-ticker { left: 10px; }

  .device-row {
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding: 14px 4px;
  }
  .device-row .status-pill { margin-bottom: 6px; }
  .device-row .icon-btn { display: none; }
  .device-row > div[style*="display:flex"] { flex-wrap: wrap; }

  .info-grid { grid-template-columns: 1fr; gap: 10px; }
  .form-grid { grid-template-columns: 1fr !important; }

  .modal-overlay { padding: 0; align-items: stretch; }
  .modal-panel {
    max-width: 100%; width: 100%;
    max-height: 100vh; height: 100vh;
    border-radius: 0;
  }
  .page-title { font-size: 16px; }
  .sheet-header { flex-wrap: wrap; gap: 10px; }
}

/* ============ ÍCONES (Tabler via CDN) ============ */
.ti { font-size: 16px; vertical-align: -2px; margin-right: 6px; }

/* ============ NEON / GLOW ============ */
.glow-accent { box-shadow: 0 0 0 1px rgba(255,196,0,0.25), 0 0 24px rgba(255,196,0,0.12); }
.glow-success { box-shadow: 0 0 0 1px rgba(34,197,94,0.3), 0 0 24px rgba(34,197,94,0.15); }
.glow-danger { box-shadow: 0 0 0 1px rgba(255,77,95,0.3), 0 0 24px rgba(255,77,95,0.15); }
.glow-info { box-shadow: 0 0 0 1px rgba(59,130,246,0.3), 0 0 24px rgba(59,130,246,0.15); }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50% { box-shadow: 0 0 0 4px transparent; opacity: 0.7; }
}
.status-pill.on::before { animation: pulse-dot 2s ease-in-out infinite; }

.stat-card {
  display: block;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-soft);
  border-radius: 20px 20px 20px 8px;
  padding: 1.1rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-radius .2s ease;
}
.stat-card:hover { transform: translateY(-3px); border-radius: 20px 20px 8px 20px; }
.stat-card .stat-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px; font-size: 17px;
}
.stat-icon.i-accent { background: rgba(255,196,0,0.12); color: var(--accent); }
.stat-icon.i-success { background: rgba(34,197,94,0.12); color: var(--success); }
.stat-icon.i-danger { background: rgba(255,77,95,0.12); color: var(--danger); }
.stat-icon.i-info { background: rgba(59,130,246,0.12); color: var(--info); }

/* ============ MODAL (mini-painel em pop-up) ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(2,6,12,0.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%; max-width: 760px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,196,0,0.08);
  transform: translateY(16px) scale(0.98);
  transition: transform .25s cubic-bezier(.2,.9,.3,1.2);
  padding: 1.5rem;
}
.modal-overlay.open .modal-panel { transform: translateY(0) scale(1); }
.modal-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 4rem 0; color: var(--text-muted); font-size: 13px; gap: 10px;
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-strong, var(--border));
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-pill i.ti-loader-2 { animation: girar-loader 0.9s linear infinite; }
@keyframes girar-loader { to { transform: rotate(360deg); } }

.rd-row:hover { background: var(--surface-2); }

/* ============ TICKER DE EVENTOS (barra flutuante) ============ */
#radar-ticker {
  position: fixed;
  left: 240px; right: 20px; bottom: 16px;
  height: 40px;
  z-index: 50;
  background: rgba(10,14,20,0.55);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#radar-ticker.radar-ticker-oculto { transform: translateY(56px); }
#radar-ticker.radar-ticker-flash { box-shadow: 0 0 0 1px rgba(255,196,0,0.5), 0 12px 34px rgba(255,196,0,0.15); }

.radar-ticker-track { flex: 1; overflow: hidden; white-space: nowrap; height: 100%; display: flex; align-items: center; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.radar-ticker-grupo { display: inline-flex; align-items: center; animation: radar-ticker-scroll 40s linear infinite; padding-right: 40px; }
.radar-ticker-track:hover .radar-ticker-grupo { animation-play-state: paused; }
@keyframes radar-ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }

.radar-ticker-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); padding: 0 14px; }
.radar-ticker-item i { font-size: 14px; }
.radar-ticker-item span:nth-child(2) { color: var(--text); }
.radar-ticker-hora { color: var(--text-muted) !important; font-size: 10.5px; opacity: 0.7; }
.radar-ticker-dot { color: var(--border); font-size: 10px; }

#radar-ticker-toggle {
  flex-shrink: 0; width: 36px; height: 100%; background: transparent; border: none; border-left: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
#radar-ticker-toggle:hover { color: var(--accent); }

@media (max-width: 760px) {
  #radar-ticker { left: 10px; right: 10px; height: 36px; }
}

.radar-avatar { transition: transform 0.2s ease, box-shadow 0.2s ease; border-radius: 8px; }
.radar-avatar:hover { transform: scale(1.15); box-shadow: 0 0 10px rgba(255,255,255,0.15); }

/* =====================================================================
   DESIGN RADAR — escuro, com a estrutura de UI da referência "Crextio"
   (pílulas, números grandes e finos, cartões macios, destaque em amarelo)
   Esta camada define o padrão visual de todas as telas.
   ===================================================================== */
:root {
  --bg: #0B0B0D;
  --surface: rgba(30,30,34,0.72);
  --surface-2: rgba(42,42,47,0.92);
  --border: rgba(255,255,255,0.08);
  --border-soft: rgba(255,255,255,0.05);
  --text: #F2F1EE;
  --text-muted: #8E8A82;
  --accent: #FFD84D;
  --accent-soft: #FFE58A;
  --accent-dark: #161616;
  --danger: #FF5A67;
  --success: #22C55E;
  --info: #60A5FA;
  --analytics: #A78BFA;
  --radius: 26px;
  --claro: #F2F1EE;
  --escuro-destaque: #0A0A0C;
}

body {
  background:
    radial-gradient(900px 620px at 100% -5%, rgba(255,200,40,0.11), transparent 62%),
    radial-gradient(760px 640px at 102% 105%, rgba(255,200,40,0.09), transparent 60%),
    radial-gradient(680px 520px at -5% 105%, rgba(255,200,40,0.05), transparent 60%),
    linear-gradient(180deg, #0D0D0F 0%, #121215 100%) !important;
  background-attachment: fixed !important;
  color: var(--text);
}
body::before, body::after, #bg-particles { display: none !important; }

/* ---------- Barra do topo ---------- */
.topbar {
  position: relative !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  padding: 18px 28px 4px !important;
}
.topbar > a:first-child {
  display: inline-flex; align-items: center;
  padding: 8px 20px;
  border: 1.5px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
}
.brand-logo { filter: invert(1) brightness(1.6) !important; height: 22px !important; }
.search-box {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
}
.search-box input { color: var(--text) !important; }
.user-badge {
  background: rgba(255,255,255,0.06) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important;
}
.logout-link { color: var(--text-muted) !important; }
.logout-link:hover { color: var(--text) !important; }

/* ---------- Menu em pílula (item ativo em amarelo) ---------- */
.navbar {
  position: static !important;
  flex-direction: row !important;
  width: fit-content !important;
  max-width: calc(100% - 3rem) !important;
  top: auto !important; left: auto !important; bottom: auto !important;
  margin: 10px auto 26px !important;
  padding: 5px !important;
  gap: 2px !important;
  background: rgba(30,30,34,0.8) !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
  border-radius: 999px !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35) !important;
  backdrop-filter: blur(14px) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}
.navbar::-webkit-scrollbar { height: 0; }
.navbar a {
  padding: 8px 15px !important;
  border-radius: 999px !important;
  color: #B5B0A7 !important;
  font-size: 12.5px !important;
  gap: 6px !important;
  transform: none !important;
}
.navbar a i { font-size: 14px !important; width: auto !important; color: inherit !important; }
.navbar a:hover { background: rgba(255,255,255,0.06) !important; color: var(--text) !important; }
.navbar a.active {
  background: var(--accent) !important;
  color: #161616 !important;
  box-shadow: 0 6px 18px rgba(255,216,77,0.25) !important;
}
.navbar a.active i { color: #161616 !important; }

.content {
  padding-left: 1.75rem !important;
  margin-top: 0 !important;
  max-width: 1320px;
  padding-bottom: 80px !important;
}

/* ---------- Cartões ---------- */
.card, .stat-card, .signal-box {
  background: linear-gradient(160deg, rgba(36,36,40,0.78), rgba(24,24,27,0.78)) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
}
.card:hover, .stat-card:hover { border-color: rgba(255,255,255,0.10) !important; }
.stat-card:hover { border-radius: var(--radius) !important; transform: translateY(-2px); }
.glow-success, .glow-info { box-shadow: 0 12px 32px rgba(0,0,0,0.35) !important; }
.glow-danger { border-color: rgba(255,90,103,0.28) !important; box-shadow: 0 12px 32px rgba(255,90,103,0.08) !important; }
.glow-accent {
  background: linear-gradient(135deg, rgba(255,216,77,0.16), rgba(30,30,34,0.78) 70%) !important;
  border-color: rgba(255,216,77,0.25) !important;
}

/* Cartão de destaque em contraste (mais escuro, com borda amarela) */
.card:has(#rede3d-container) {
  background: var(--escuro-destaque) !important;
  border-color: rgba(255,216,77,0.18) !important;
  box-shadow: 0 18px 44px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,216,77,0.05) !important;
}
.card:has(#rede3d-container) > div:last-child { border-top-color: rgba(255,255,255,0.06) !important; }

/* ---------- Tipografia e números grandes ---------- */
.page-title { font-size: 28px !important; font-weight: 500 !important; letter-spacing: -0.8px !important; }
.section-title { font-weight: 600 !important; }
.metric-label { color: var(--text-muted) !important; }
.metric-value { font-size: 40px !important; font-weight: 300 !important; letter-spacing: -1.5px !important; color: var(--text) !important; }
.metric-value.success { color: var(--success) !important; }
.metric-value.danger { color: var(--danger) !important; }
.metric-value.accent { color: var(--accent) !important; }
.stat-icon { border-radius: 50% !important; border: 1px solid var(--border-soft); }

/* ---------- Botões em pílula ---------- */
.btn { border-radius: 999px !important; }
.btn-primary {
  background: var(--accent) !important;
  color: #161616 !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(255,216,77,0.18) !important;
}
.btn-primary i { color: #161616 !important; }
.btn-primary:hover { background: var(--accent-soft) !important; filter: none !important; }
.btn-outline { background: rgba(255,255,255,0.04) !important; }
.btn-outline:hover { background: rgba(255,255,255,0.08) !important; }

/* ---------- Campos ---------- */
.form-grid input, .form-grid select, .form-grid textarea, .login-card input {
  background: rgba(255,255,255,0.04) !important;
  border-color: var(--border) !important;
  border-radius: 14px !important;
}

/* ---------- Listas e status ---------- */
.device-row:hover, .row-hover:hover { background: rgba(255,255,255,0.03) !important; }
.status-pill.blocked { color: var(--accent) !important; background: rgba(255,216,77,0.13) !important; }
.status-pill.blocked::before { background: var(--accent) !important; }

/* ---------- Janela do cliente e Command Bar ---------- */
.modal-overlay { background: rgba(0,0,0,0.55) !important; backdrop-filter: blur(6px); }
.modal-panel {
  background: rgba(20,20,23,0.97) !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
  box-shadow: 0 30px 70px rgba(0,0,0,0.6) !important;
  border-radius: 28px !important;
}

/* ---------- Barra de eventos ---------- */
#radar-ticker {
  left: 20px !important;
  background: rgba(22,22,25,0.85) !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
  border-radius: 999px !important;
}

/* ---------- Login ---------- */
.login-card {
  background: linear-gradient(160deg, rgba(36,36,40,0.85), rgba(22,22,25,0.85)) !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
  border-radius: 30px !important;
}
.login-card button { background: var(--accent) !important; color: #161616 !important; border-radius: 999px !important; }

/* ---------- Topo do Dashboard: saudação + barra dividida + números grandes ---------- */
.rd-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; flex-wrap: wrap; margin: 4px 0 26px; }
.rd-hero-esq { flex: 1; min-width: 300px; }
.rd-hero-titulo { font-size: 44px; font-weight: 400; letter-spacing: -1.8px; margin: 0 0 18px; line-height: 1.05; }
.rd-segmentos { display: flex; gap: 8px; align-items: flex-end; max-width: 620px; }
.rd-seg { min-width: 64px; }
.rd-seg-label { font-size: 12px; color: var(--text-muted); margin: 0 0 6px 2px; white-space: nowrap; }
.rd-seg-barra { height: 38px; border-radius: 999px; display: flex; align-items: center; padding: 0 14px; font-size: 12px; font-weight: 600; transition: transform .2s ease; }
.rd-seg-barra:hover { transform: translateY(-2px); }
.rd-seg-principal { background: var(--claro); color: #161616; }
.rd-seg-destaque { background: var(--accent); color: #161616; }
.rd-seg-listrado { background: repeating-linear-gradient(-45deg, rgba(255,255,255,0.12) 0 2px, transparent 2px 8px); color: var(--text); border: 1px solid var(--border); }
.rd-seg-contorno { border: 1.5px solid rgba(255,255,255,0.28); color: var(--text); }
.rd-hero-numeros { display: flex; gap: 34px; align-items: flex-end; }
.rd-numero { display: flex; flex-direction: column; align-items: flex-start; text-decoration: none; color: var(--text); }
.rd-numero-linha { display: flex; align-items: center; gap: 10px; }
.rd-numero-icone { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.05); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: #B5B0A7; font-size: 16px; }
.rd-numero-valor { font-size: 58px; font-weight: 300; letter-spacing: -2.5px; line-height: 1; }
.rd-numero-label { font-size: 12px; color: var(--text-muted); margin: 4px 0 0 44px; }
.rd-numero.ativo .rd-numero-valor { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 4px; text-underline-offset: 6px; }

@media (max-width: 760px) {
  .rd-hero-titulo { font-size: 32px; }
  .rd-numero-valor { font-size: 40px; }
  .rd-hero-numeros { gap: 18px; }
  .topbar { padding: 12px 14px 4px !important; }
}

/* =====================================================================
   EFEITOS AVANÇADOS (Guia de design: todo movimento tem função)
   ===================================================================== */

/* Troca de tela suave (navegadores recentes; nos outros, nada muda) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }

/* Entrada dos cartões — só esconde se o script carregou (classe rd-js no <html>) */
.rd-js .content .card, .rd-js .content .stat-card, .rd-js .content .rd-hero {
  opacity: 0;
  translate: 0 14px;
  transition: opacity .5s ease var(--rd-atraso, 0ms), translate .5s cubic-bezier(.2,.8,.2,1) var(--rd-atraso, 0ms),
              transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.rd-js .content .rd-visivel { opacity: 1; translate: 0 0; }

/* Brilho amarelo que segue o mouse dentro do cartão */
.card, .stat-card { position: relative; }
.card::after, .stat-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, -400px) var(--my, -400px), rgba(255,216,77,0.07), transparent 60%);
  opacity: 0; transition: opacity .3s ease;
}
.card:hover::after, .stat-card:hover::after { opacity: 1; }
.card:has(#rede3d-container)::after { display: none; }

/* Menu: pílula de destaque que desliza */
.navbar { position: relative !important; }
.navbar a { position: relative; z-index: 1; }
.navbar a:hover { background: transparent !important; }
.navbar a.active:hover { background: var(--accent) !important; }
.rd-nav-hover {
  position: absolute; top: 5px; bottom: 5px; left: 0; width: 0;
  border-radius: 999px; background: rgba(255,255,255,0.08);
  opacity: 0; pointer-events: none; z-index: 0;
  transition: transform .28s cubic-bezier(.3,.7,.2,1), width .28s cubic-bezier(.3,.7,.2,1), opacity .2s ease;
}

/* Botões respondem ao toque */
.btn { transition: transform .12s ease, background .2s ease, box-shadow .2s ease !important; }
.btn:active { transform: scale(0.96) !important; }

/* Clientes online "respiram" */
.status-pill.on::before { animation: rd-respirar 2.6s ease-out infinite; }
@keyframes rd-respirar {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* Mini-gráfico de sinal se desenha ao carregar */
[title^="Tendência de sinal"] svg path {
  stroke-dasharray: 300; stroke-dashoffset: 300;
  animation: rd-desenhar 1.4s ease forwards .4s;
}
@keyframes rd-desenhar { to { stroke-dashoffset: 0; } }

/* Janela do cliente: carregamento com brilho passando */
.modal-loading { position: relative; overflow: hidden; border-radius: 20px; }
.modal-loading::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.05) 50%, transparent 80%);
  animation: rd-brilho 1.2s linear infinite;
}
@keyframes rd-brilho { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* Avisos flutuantes */
#rd-avisos { position: fixed; top: 18px; right: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.rd-aviso {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 999px; font-size: 13px; color: var(--text);
  background: rgba(22,22,25,0.92); border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45); backdrop-filter: blur(12px);
  opacity: 0; translate: 16px 0; transition: opacity .3s ease, translate .3s cubic-bezier(.2,.8,.2,1);
}
.rd-aviso-on { opacity: 1; translate: 0 0; }
.rd-aviso-sucesso i { color: var(--success); }
.rd-aviso-erro i { color: var(--danger); }
.rd-aviso-info i { color: var(--accent); }

/* Quem prefere menos movimento no sistema: tudo parado */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rd-js .content .card, .rd-js .content .stat-card, .rd-js .content .rd-hero { opacity: 1; translate: 0 0; }
}

/* =====================================================================
   ACABAMENTO PREMIUM
   ===================================================================== */

/* Textura granulada bem sutil no fundo (tira o aspecto "chapado" do preto) */
body { position: relative; }
.rd-grao {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.topbar, .navbar, .content { position: relative; z-index: 1; }

/* Borda de "vidro líquido": clara em cima, sumindo, com toque amarelo no canto */
.card, .stat-card { border-color: transparent !important; }
.card::before, .stat-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(150deg, rgba(255,255,255,0.16), rgba(255,255,255,0.03) 38%, rgba(255,255,255,0.02) 70%, rgba(255,216,77,0.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.card:has(#rede3d-container)::before {
  background: linear-gradient(150deg, rgba(255,216,77,0.35), rgba(255,216,77,0.04) 40%, rgba(255,255,255,0.03) 75%, rgba(255,216,77,0.2));
}
.glow-danger::before { background: linear-gradient(150deg, rgba(255,90,103,0.45), rgba(255,90,103,0.05) 45%, rgba(255,90,103,0.2)) !important; }

/* Títulos de tela com leve degradê */
.page-title {
  background: linear-gradient(90deg, #F2F1EE 30%, #A9A49A);
  -webkit-background-clip: text; background-clip: text; color: transparent !important;
}
.page-title i { color: var(--accent); -webkit-text-fill-color: var(--accent); }

/* Ícone dos títulos de seção dentro de uma bolinha */
.section-title { display: flex; align-items: center; gap: 9px; }
.section-title > i {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,216,77,0.1); color: var(--accent); font-size: 15px;
  border: 1px solid rgba(255,216,77,0.18);
}

/* Linhas das listas: cantos arredondados e leve elevação ao passar o mouse */
.device-row { border-radius: 16px; transition: background .2s ease, translate .2s ease; }
.device-row:hover { translate: 3px 0; }

/* Ícones dos resumos com anel de brilho */
.stat-icon { box-shadow: 0 0 0 4px rgba(255,255,255,0.02), 0 6px 16px rgba(0,0,0,0.3); }

/* Foco em amarelo (teclado e campos) */
input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: rgba(255,216,77,0.55) !important;
  box-shadow: 0 0 0 3px rgba(255,216,77,0.12) !important;
}
a:focus-visible, button:focus-visible { outline: 2px solid rgba(255,216,77,0.7); outline-offset: 2px; }

/* Barras de rolagem finas e escuras */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,216,77,0.4); }
::-webkit-scrollbar-track { background: transparent; }

/* Seleção de texto em amarelo */
::selection { background: rgba(255,216,77,0.35); color: #fff; }

/* Relógio na barra do topo */
.rd-relogio {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; color: #B5B0A7;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.rd-relogio .rd-ponto-vivo { width: 6px; height: 6px; border-radius: 50%; background: var(--success); animation: rd-respirar 2.6s ease-out infinite; }
@media (max-width: 760px) { .rd-relogio { display: none; } }


/* =====================================================================
   DUAS REDES: Rede Híbrida (parceiro SS Telecom, azul) e Radar Fibra (rede própria, amarelo)
   ===================================================================== */
:root { --rede-parceiro: #3B82F6; --rede-parceiro-claro: #8AB4FF; }

.rd-rede {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 600; margin: 0 0 16px;
}
.rd-hero .rd-rede { margin: -8px 0 18px; }
.rd-rede-hibrida { color: var(--rede-parceiro-claro); background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3); }
.rd-rede-canaa { color: var(--accent); background: rgba(255,216,77,0.1); border: 1px solid rgba(255,216,77,0.28); margin-top: 8px; }
.rd-voltar { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.rd-voltar:hover { color: var(--text); }

/* Bloco secundário do Vale do Canaã no Dashboard */
.rd-canaa-bloco {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 20px; margin-bottom: 16px; border-radius: 22px;
  background: linear-gradient(120deg, rgba(255,216,77,0.13), rgba(30,30,34,0.78) 55%);
  border: 1px solid rgba(255,216,77,0.25); color: var(--text); text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.rd-canaa-bloco:hover { transform: translateY(-2px); border-color: rgba(255,216,77,0.5); box-shadow: 0 12px 30px rgba(255,216,77,0.08); }
.rd-canaa-icone { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--accent); color: #161616; font-size: 20px; }
.rd-canaa-texto { flex: 1; min-width: 200px; }
.rd-canaa-titulo { font-size: 15px; font-weight: 600; margin: 0; }
.rd-canaa-sub { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); margin: 3px 0 0; }
.rd-canaa-ponto { width: 7px; height: 7px; border-radius: 50%; background: #8E8A82; flex-shrink: 0; }
.rd-canaa-numeros { display: flex; gap: 20px; flex-wrap: wrap; }
.rd-canaa-num { display: flex; flex-direction: column; font-size: 11px; color: var(--text-muted); }
.rd-canaa-num b { font-size: 24px; font-weight: 300; letter-spacing: -0.8px; color: var(--text); line-height: 1.1; }
.rd-canaa-abrir { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1.5px solid rgba(255,216,77,0.45); color: var(--accent); }

/* Árvore 3D da rede do parceiro com moldura azul */
.card:has(#rede3d-container[data-rede="hibrida"]) { border-color: rgba(59,130,246,0.25) !important; }
.card:has(#rede3d-container[data-rede="hibrida"])::before {
  background: linear-gradient(150deg, rgba(59,130,246,0.45), rgba(59,130,246,0.05) 40%, rgba(255,255,255,0.03) 75%, rgba(59,130,246,0.25));
}

/* Lista de caixas: cada CTO separada */
.rd-cto-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rd-cto-chip {
  display: flex; flex-direction: column; gap: 7px; text-align: left;
  padding: 12px 14px; border-radius: 18px; cursor: pointer; font-family: inherit; color: var(--text);
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.rd-cto-chip:hover { transform: translateY(-2px); background: rgba(255,255,255,0.05); }
.rd-cto-hibrida:hover { border-color: rgba(59,130,246,0.5); }
.rd-cto-canaa:hover { border-color: rgba(255,216,77,0.5); }
.rd-cto-chip.alerta { border-color: rgba(255,90,103,0.5); background: rgba(255,90,103,0.06); }
.rd-cto-chip.sem-cto { border-style: dashed; }
.rd-cto-nome { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; }
.rd-cto-hibrida .rd-cto-nome i { color: var(--rede-parceiro-claro); }
.rd-cto-canaa .rd-cto-nome i { color: var(--accent); }
.rd-cto-info { font-size: 11.5px; color: var(--text-muted); }
.rd-cto-dica { font-size: 11px; color: var(--accent); }
.rd-cto-portas { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; max-width: 176px; }
.rd-porta-ponto { display: block; height: 12px; border-radius: 4px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.08); }
.rd-porta-ponto.online { background: var(--success); border-color: transparent; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.rd-porta-ponto.offline { background: var(--danger); border-color: transparent; }
.rd-porta-ponto.blocked, .rd-porta-ponto.instavel { background: var(--accent); border-color: transparent; }

@media (max-width: 760px) {
  .rd-canaa-numeros { width: 100%; }
  .rd-canaa-abrir { margin-left: auto; }
}

/* Status "sem dado" (Vale do Canaã sem conexão com o MikroTik) */
.status-pill.neutro { color: var(--text-muted) !important; background: rgba(255,255,255,0.05) !important; }
.status-pill.neutro::before { background: #8E8A82 !important; box-shadow: none !important; animation: none !important; }
.rd-porta-ponto.desconhecido { background: #8593a8; border-color: transparent; opacity: 0.7; }

/* Quadro de caixas: área clicável + escolha de 8 ou 16 portas */
.rd-cto-abrir { display: flex; flex-direction: column; gap: 7px; text-align: left; background: none; border: none; padding: 0; margin: 0; color: inherit; font-family: inherit; cursor: pointer; width: 100%; }
.rd-cto-canaa { cursor: default; }
.rd-cto-cap { margin: 2px 0 0; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.rd-cto-cap label { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.rd-cto-cap select { background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-family: inherit; }

/* Troca de plano e ranking de consumo (Vale do Canaã) */
.rd-plano { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text-muted); font-size: 12px; }
.rd-plano select { background: transparent; border: none; color: var(--text); font-size: 11.5px; font-family: inherit; padding: 3px 6px; cursor: pointer; }
.rd-plano select option { background: #1E1E22; }
.rd-rank { display: grid; grid-template-columns: 26px minmax(120px, 1.2fr) 2fr auto; align-items: center; gap: 12px; padding: 7px 4px; border-top: 1px solid var(--border-soft); }
.rd-rank-pos { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; background: rgba(255,216,77,0.12); color: var(--accent); }
.rd-rank-nome { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-rank-barra { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.05); overflow: hidden; }
.rd-rank-barra i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #D4A405, var(--accent)); }
.rd-rank-valor { font-size: 12.5px; text-align: right; white-space: nowrap; }
.rd-rank-valor small { display: block; font-size: 10.5px; color: var(--text-muted); }
@media (max-width: 760px) { .rd-rank { grid-template-columns: 24px 1fr auto; } .rd-rank-barra { display: none; } }

/* =====================================================================
   MAPA DA REDE (substitui a árvore 3D)
   ===================================================================== */
.rm-mapa { width: 100%; height: 440px; background: #0A0A0C; }
@media (max-width: 760px) { .rm-mapa { height: 380px; } }

/* cartão escuro de destaque, como era o da árvore */
.card:has(.rm-mapa) { background: var(--escuro-destaque) !important; border-color: rgba(255,216,77,0.18) !important; box-shadow: 0 18px 44px rgba(0,0,0,0.5) !important; }
.card:has(.rm-mapa)::after { display: none; }
.card:has(.rm-mapa[data-rede="hibrida"]) { border-color: rgba(59,130,246,0.25) !important; }
.card:has(.rm-mapa[data-rede="hibrida"])::before { background: linear-gradient(150deg, rgba(59,130,246,0.45), rgba(59,130,246,0.05) 40%, rgba(255,255,255,0.03) 75%, rgba(59,130,246,0.25)); }
.card:has(.rm-mapa) > div:last-child { color: #9A968E !important; border-top-color: rgba(255,255,255,0.06) !important; }

/* Leaflet no tema escuro */
.rm-mapa .leaflet-control-zoom a, .rm-mapa .leaflet-control-layers { background: rgba(20,20,23,0.92); color: #F2F1EE; border-color: rgba(255,255,255,0.1); }
.rm-mapa .leaflet-control-layers { border-radius: 14px; }
.rm-mapa .leaflet-control-layers-expanded { padding: 8px 12px; font-size: 12px; }
.rm-mapa .leaflet-bar { border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; overflow: hidden; }
.rm-mapa .leaflet-control-attribution { background: rgba(10,10,12,0.7); color: #6F6A61; font-size: 10px; }
.rm-mapa .leaflet-control-attribution a { color: #8E8A82; }
.rm-mapa .leaflet-tooltip { background: rgba(14,14,17,0.95); color: #F2F1EE; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; font-size: 12px; padding: 7px 11px; box-shadow: 0 10px 24px rgba(0,0,0,0.5); }
.rm-mapa .leaflet-tooltip-top:before { border-top-color: rgba(14,14,17,0.95); }
.rm-mapa.rm-mirando, .rm-mapa.rm-mirando .leaflet-interactive { cursor: crosshair !important; }

/* clientes */
.rm-cliente { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(10,10,12,0.9); box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.rm-vivo { animation: rm-pulso 2.6s ease-out infinite; }
@keyframes rm-pulso { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.55), 0 2px 8px rgba(0,0,0,0.5); } 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0), 0 2px 8px rgba(0,0,0,0.5); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0), 0 2px 8px rgba(0,0,0,0.5); } }

/* caixas e POP */
.rm-cto, .rm-pop { position: relative; transition: transform .2s ease; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)); }
.rm-cto:hover, .rm-pop:hover { transform: translateY(-3px) scale(1.08); }
.rm-selo { position: absolute; top: -4px; right: -10px; min-width: 22px; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; text-align: center; background: rgba(14,14,17,0.95); color: #F2F1EE; border: 1px solid rgba(255,255,255,0.15); }
.rm-aprox { opacity: 0.55; }
.rm-alarme::after { content: ''; position: absolute; left: 50%; top: 58%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid #FF5A67; animation: rm-alarme 1.3s ease-out infinite; pointer-events: none; }
@keyframes rm-alarme { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
.rm-pop { filter: drop-shadow(0 0 10px rgba(255,216,77,0.45)); }

/* linhas: tracejado andando = dados passando */
.rm-fluxo { animation: rm-fluxo 1.2s linear infinite; }
@keyframes rm-fluxo { to { stroke-dashoffset: -26; } }

/* painel de ajustes e legenda */
.rm-painel { display: flex; flex-direction: column; gap: 6px; max-width: 250px; }
.rm-btn { background: rgba(14,14,17,0.92); color: #F2F1EE; border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; padding: 6px 12px; font-size: 11.5px; cursor: pointer; font-family: inherit; text-align: left; }
.rm-btn:hover { border-color: rgba(255,216,77,0.5); }
.rm-btn.ativo { background: #FFD84D; color: #161616; border-color: #FFD84D; font-weight: 600; }
.rm-btn-alerta { color: #FF5A67; border-color: rgba(255,90,103,0.5); }
.rm-faltando { background: rgba(14,14,17,0.95); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 10px; max-height: 260px; overflow-y: auto; }
.rm-faltando p { font-size: 11px; color: #A9A49A; margin: 0 0 8px; line-height: 1.4; }
.rm-item { display: block; width: 100%; text-align: left; background: rgba(255,255,255,0.04); color: #F2F1EE; border: 1px solid transparent; border-radius: 10px; padding: 6px 9px; margin-bottom: 4px; font-size: 11.5px; cursor: pointer; font-family: inherit; }
.rm-item.ativo { border-color: #FFD84D; background: rgba(255,216,77,0.12); }
.rm-legenda { display: flex; flex-wrap: wrap; gap: 10px; max-width: 420px; background: rgba(14,14,17,0.85); color: #8E8A82; font-size: 10.5px; padding: 6px 12px; border-radius: 999px; }
.rm-legenda span { display: inline-flex; align-items: center; gap: 5px; }
.rm-legenda i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.rm-legenda i.rm-q { border-radius: 2px; }

/* Mapa escuro sem chave: OpenStreetMap escurecido */
.rm-tiles-escuro { filter: invert(100%) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.55); }
/* Ícones com a foto do modelo 3D */
.rm-cto-foto img, .rm-pop-foto img { display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.6)); }
.rm-selo { display: inline-flex; align-items: center; gap: 4px; }
.rm-selo i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.rm-cto-foto .rm-selo { top: 0; right: -8px; }
/* Colar coordenadas no painel de ajuste */
.rm-coord { display: none; gap: 5px; margin: 0 0 8px; }
.rm-coord input { flex: 1; min-width: 0; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); color: #F2F1EE; border-radius: 10px; padding: 6px 8px; font-size: 11.5px; font-family: inherit; }
.rm-coord button { background: #FFD84D; color: #161616; border: none; border-radius: 10px; padding: 6px 10px; font-size: 11.5px; font-weight: 600; cursor: pointer; font-family: inherit; }

/* Botão HUB (volta pro painel) ao lado do Sair */
.hub-link { margin-right: 8px; color: var(--accent) !important; border-color: rgba(255,216,77,0.35) !important; }
.hub-link:hover { background: rgba(255,216,77,0.10) !important; }
