/* ============================================================
   GESTÃO EVENTOS - Tema Dark Premium (CSS Centralizado)
   ============================================================ */

/* --- Layout Base --- */
body {
    background: #020617 !important;
    color: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-text-size-adjust: 100% !important;
    overflow-x: hidden;
}

/* --- Títulos de Página --- */
.page-header-title,
.dash-header-title {
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #f8fafc 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Sidebar --- */
.sidebar {
    height: 100vh;
    background-color: #0f172a;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
}
.sidebar-brand {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo-box { display: flex; align-items: center; gap: 8px; }
.logo-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sidebar-title {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.03em;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}
.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sidebar a {
    color: #94a3b8;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    gap: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar a:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #f8fafc;
    padding-left: 20px;
}
.sidebar a:hover i, .sidebar a:hover svg { color: #38bdf8; transform: scale(1.05); }
.sidebar a.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.08) 0%, rgba(56, 189, 248, 0.02) 100%);
    color: #38bdf8;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #38bdf8;
    border-radius: 0 8px 8px 0;
}
.sidebar a.active i, .sidebar a.active svg { color: #38bdf8; }
.sidebar a i, .sidebar a svg { width: 18px !important; height: 18px !important; color: #94a3b8; transition: all 0.2s ease; flex-shrink: 0; }
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}
.user-profile-box {
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(2, 6, 23, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}
.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.15));
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700; color: #38bdf8; letter-spacing: 0.05em; flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 0.85rem; font-weight: 600; color: #f1f5f9; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; margin: 0; }
.user-role { font-size: 0.7rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin: 0; }
.sidebar a.logout-link { color: #f87171; padding: 10px 12px; border-radius: 6px; }
.user-list-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    transition: transform 0.2s ease;
}
.user-list-avatar:hover {
    transform: scale(1.08);
}
.user-avatar-admin {
    background: rgba(168, 85, 247, 0.12) !important;
    border: 1px solid rgba(168, 85, 247, 0.25) !important;
    color: #c084fc !important;
}
.user-avatar-user {
    background: rgba(56, 189, 248, 0.1) !important;
    border: 1px solid rgba(56, 189, 248, 0.22) !important;
    color: #7dd3fc !important;
}
.sidebar a.logout-link i, .sidebar a.logout-link svg { color: #f87171; }
.sidebar a.logout-link:hover { background-color: rgba(239, 68, 68, 0.08); color: #f87171; padding-left: 16px; }

.content-wrapper {
    display: flex;
    flex-direction: column;
    padding-bottom: 0 !important;
}

/* --- Mobile Navbar --- */
.mobile-navbar { display: none !important; background-color: #0f172a; border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding: 1rem 1.5rem; }

/* --- Sidebar Submenu --- */
.sidebar [data-bs-toggle="collapse"] .submenu-arrow { transition: transform 0.2s ease; margin-left: auto; }
.sidebar [data-bs-toggle="collapse"][aria-expanded="true"] .submenu-arrow { transform: rotate(180deg); }
.submenu-arrow { transition: transform 0.25s ease; }
.collapsed .submenu-arrow { transform: rotate(-90deg); }
.submenu-box a { font-size: 0.85rem; background: transparent !important; box-shadow: none !important; }
.submenu-box a.active { color: #38bdf8 !important; font-weight: 600; }

/* --- Cards Padrão Premium --- */
.card-premium {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}
.card-premium:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5); }
.card-premium-header { background: rgba(30, 41, 59, 0.5) !important; border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important; padding: 1.2rem 1.5rem; }
.card-premium-title { font-size: 1rem; font-weight: 700; letter-spacing: 0.02em; color: #e2e8f0; }
.card-icon-bg { position: absolute; right: 15px; bottom: 10px; opacity: 0.04; color: #fff; pointer-events: none; }
.card-accent-warning { box-shadow: inset 4px 0 0 #f59e0b !important; }
.card-accent-primary { box-shadow: inset 4px 0 0 #0d6efd !important; }
.card-accent-warning:hover { box-shadow: inset 4px 0 0 #f59e0b, 0 12px 24px rgba(0, 0, 0, 0.5) !important; }
.card-accent-primary:hover { box-shadow: inset 4px 0 0 #0d6efd, 0 12px 24px rgba(0, 0, 0, 0.5) !important; }

/* --- Labels/Métricas --- */
.metric-label { color: #94a3b8; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Métricas PPPoE --- */
.metric-card { position: relative; overflow: hidden; }
.metric-card::before { content: ''; position: absolute; top: -50px; right: -50px; width: 140px; height: 140px; background: radial-gradient(circle, rgba(56,189,248,.15), transparent 70%); }
.metric-title { color: #94a3b8; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metric-value { font-size: 2rem; font-weight: 800; color: #f8fafc; line-height: 1; margin-top: .4rem; }
.metric-icon { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }

/* --- Formulários --- */
.form-control-premium {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #ffffff !important;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.form-control-premium::placeholder { color: #64748b !important; }
.form-control-premium:focus { border-color: #4f46e5 !important; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25) !important; background-color: #0f172a !important; }
.form-label-premium { color: #94a3b8; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.input-group-text {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #94a3b8 !important;
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.9rem !important;
}
.input-group .form-control-premium,
.input-group .form-select {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* --- Tabela Premium --- */
.table-premium { color: #cbd5e1 !important; margin-bottom: 0; }
.table-premium thead th {
    background-color: rgba(30, 41, 59, 0.8) !important;
    color: #94a3b8 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.table-premium tbody tr { border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important; transition: background-color 0.2s ease; }
.table-premium tbody tr:hover { background-color: rgba(255, 255, 255, 0.02) !important; }
.table-premium tbody td { padding: 1rem 1.5rem !important; background: transparent !important; }

/* --- Botões --- */
.btn-premium-submit {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border: none; color: #ffffff; font-weight: 600; border-radius: 10px;
    padding: 0.65rem 1.5rem; transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
.btn-premium-submit:hover { background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%); box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4); transform: translateY(-1px); }

.btn-premium-danger {
    background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171; border-radius: 8px; font-weight: 500; font-size: 0.85rem;
    padding: 0.4rem 0.8rem; transition: all 0.2s ease;
}
.btn-premium-danger:hover { background: #ef4444; color: #ffffff; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }

.btn-premium-action {
    background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.15);
    color: #38bdf8; transition: all 0.2s ease; font-size: 0.8rem; font-weight: 600;
    border-radius: 8px; display: inline-flex; align-items: center; gap: 6px;
}
.btn-premium-action:hover { background: #38bdf8; color: #0f172a; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25); }

.btn-premium-edit {
    background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.2);
    color: #38bdf8; padding: 4px 14px; border-radius: 8px; font-size: 0.78rem;
    font-weight: 500; transition: all 0.2s;
}
.btn-premium-edit:hover { background: rgba(56, 189, 248, 0.2); border-color: rgba(56, 189, 248, 0.4); color: #7dd3fc; }

/* --- Badges --- */
.comunidade-badge { background: rgba(255, 255, 255, 0.05); color: #cbd5e1; padding: 0.2rem 0.5rem; border-radius: 6px; font-family: monospace; }
.badge-wifi-2g { font-size: 0.75rem; padding: 5px 10px; border-radius: 6px; font-family: monospace; background: rgba(245, 158, 11, 0.08) !important; color: #f59e0b !important; border: 1px solid rgba(245, 158, 11, 0.15) !important; }
.badge-wifi-5g { font-size: 0.75rem; padding: 5px 10px; border-radius: 6px; font-family: monospace; background: rgba(6, 182, 212, 0.08) !important; color: #06b6d4 !important; border: 1px solid rgba(6, 182, 212, 0.15) !important; }
.badge-status-online { font-size: 0.75rem; padding: 5px 12px; border-radius: 20px; font-weight: 700; letter-spacing: 0.03em; background: rgba(16, 185, 129, 0.1) !important; color: #10b981 !important; border: 1px solid rgba(16, 185, 129, 0.2) !important; display: inline-flex; align-items: center; gap: 6px; }
.badge-status-offline { font-size: 0.75rem; padding: 5px 12px; border-radius: 20px; font-weight: 700; letter-spacing: 0.03em; background: rgba(239, 68, 68, 0.1) !important; color: #ef4444 !important; border: 1px solid rgba(239, 68, 68, 0.2) !important; display: inline-flex; align-items: center; gap: 6px; }
.badge-cell-normal { font-size: 0.75rem; padding: 5px 12px; border-radius: 20px; font-weight: 700; background: rgba(16, 185, 129, 0.08) !important; color: #10b981 !important; border: 1px solid rgba(16, 185, 129, 0.15) !important; }
.badge-cell-warning { font-size: 0.75rem; padding: 5px 12px; border-radius: 20px; font-weight: 700; background: rgba(245, 158, 11, 0.08) !important; color: #f59e0b !important; border: 1px solid rgba(245, 158, 11, 0.15) !important; }
.badge-cell-critico { font-size: 0.75rem; padding: 5px 12px; border-radius: 20px; font-weight: 700; background: rgba(239, 68, 68, 0.08) !important; color: #ef4444 !important; border: 1px solid rgba(239, 68, 68, 0.2) !important; animation: criticalPulse 2s infinite; }
.badge-uptime { font-family: monospace; font-size: 0.74rem; padding: 5px 10px; border-radius: 8px; background: rgba(56,189,248,0.08); color: #38bdf8; border: 1px solid rgba(56,189,248,0.15); }
.badge-users { background: rgba(56,189,248,0.08); color: #38bdf8; border: 1px solid rgba(56,189,248,0.15); font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .4rem .8rem; }

/* --- Indicadores Live --- */
.pulse-live { display: inline-block; width: 6px; height: 6px; background-color: #10b981; border-radius: 50%; margin-right: 6px; animation: livePulse 2s infinite; }
.dot-pulse { width: 6px; height: 6px; border-radius: 50%; }
.badge-status-online .dot-pulse { background-color: #10b981; animation: statusGreenPulse 2s infinite; }
.badge-status-offline .dot-pulse { background-color: #ef4444; }

/* --- Seção/Divisores --- */
.section-divider, .divider-section { border-top: 1px solid rgba(255, 255, 255, 0.05); }

/* --- Utilitários --- */
.font-mono { font-family: monospace; }
.font-mono-noc { font-family: monospace; font-size: 0.78rem; color: #94a3b8; }

/* --- Progress Bar --- */
.progress-dark { background-color: rgba(255, 255, 255, 0.03) !important; border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 20px; height: 16px; }

/* --- Input Busca NOC (PPPoE) --- */
.input-busca-noc {
    background-color: rgba(2, 6, 23, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f8fafc !important; font-size: 0.85rem; padding: 0.45rem 0.9rem;
    border-radius: 8px; transition: all 0.2s ease;
}
.input-busca-noc:focus { border-color: #38bdf8 !important; box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15) !important; }
.input-busca-noc::placeholder { color: #475569; }

/* --- Timeline NOC (PPPoE) --- */
.timeline-noc { position: relative; padding-left: 28px; }
.timeline-noc::before { content: ''; position: absolute; left: 14px; top: 4px; bottom: 4px; width: 2px; background: rgba(255, 255, 255, 0.06); }
.timeline-item-noc { position: relative; padding-bottom: 1.2rem; }
.timeline-item-noc:last-child { padding-bottom: 0; }
.timeline-icon-noc { position: absolute; left: -19px; top: 6px; width: 10px; height: 10px; border-radius: 50%; z-index: 2; }
.bg-noc-down { background-color: #ef4444; box-shadow: 0 0 10px #ef4444; }
.bg-noc-up { background-color: #10b981; box-shadow: 0 0 10px #10b981; }
.empty-state { padding: 4rem 2rem; text-align: center; color: #94a3b8; }
.empty-state i { opacity: .4; margin-bottom: 12px; }

/* --- Diagnóstico (Avançado) --- */
.diagnostic-card { background: rgba(15,23,42,0.35) !important; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.04) !important; border-radius: 18px; height: 100%; transition: border-color 0.25s ease; }
.diagnostic-card:hover { border-color: rgba(56,189,248,0.12) !important; }
.diag-header { padding: 1.3rem 1.5rem 0.5rem 1.5rem; display: flex; align-items: center; gap: 12px; }
.diag-header-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.diag-title { font-size: 0.9rem; font-weight: 700; color: #f1f5f9; margin: 0; }
.diag-sub { font-size: 0.7rem; color: #94a3b8; margin: 0; }
.diag-body { padding: 1rem 1.5rem 1.5rem 1.5rem; }
.diag-input { background: #1e293b !important; border: 1px solid rgba(255,255,255,0.06) !important; color: #f1f5f9 !important; border-radius: 8px; padding: 0.55rem 0.9rem; font-size: 0.82rem; font-family: monospace; }
.diag-input::placeholder { color: #475569 !important; }
.diag-input:focus { border-color: #3b82f6 !important; box-shadow: 0 0 0 3px rgba(59,130,246,0.12) !important; }
.diag-btn { border: none; font-weight: 600; font-size: 0.78rem; padding: 0.5rem 1.2rem; border-radius: 8px; transition: all 0.2s ease; }
.diag-btn-ping { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.15); }
.diag-btn-ping:hover { background: #10b981; color: #fff; }
.diag-btn-trace { background: rgba(99,102,241,0.12); color: #818cf8; border: 1px solid rgba(99,102,241,0.15); }
.diag-btn-trace:hover { background: #6366f1; color: #fff; }
.diag-output { background: rgba(2,6,23,0.6); border: 1px solid rgba(255,255,255,0.04); border-radius: 10px; padding: 1rem; font-family: monospace; font-size: 0.78rem; color: #94a3b8; white-space: pre-wrap; max-height: 200px; overflow-y: auto; margin-top: 0.8rem; }
.pico-card { background: rgba(15,23,42,0.2); border-radius: 12px; padding: 0.8rem 1rem; display: flex; align-items: center; justify-content: space-between; border: 1px solid rgba(255,255,255,0.03); }
.pico-nome { font-size: 0.82rem; font-weight: 600; color: #e2e8f0; }
.pico-valor { font-family: monospace; font-size: 0.85rem; font-weight: 700; color: #f59e0b; }

/* Mapa de equipamentos */
.equipment-map-wrap {
  position: relative;
}
.equipment-map {
  width: 100%;
  height: min(72vh, 720px);
  min-height: 460px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: #0f172a;
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
}
.map-loading-state {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.map-loading-state.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.map-loading-box {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 32px rgba(0,0,0,0.35);
  font-size: 0.88rem;
}
.map-loading-box span:last-child {
  color: #94a3b8;
  font-size: 0.78rem;
}
.map-loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.3);
  border-top-color: #38bdf8;
  animation: map-spin 0.8s linear infinite;
}
.map-loading-error {
  color: #fca5a5;
}
@keyframes map-spin {
  to { transform: rotate(360deg); }
}
.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.map-save-status {
  color: #94a3b8;
  font-size: 0.8rem;
  max-width: 300px;
}
.map-save-status-ok { color: #10b981; }
.map-save-status-erro { color: #ef4444; }
.map-legend {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: #94a3b8;
  font-size: 0.82rem;
}
.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.map-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
.map-dot-online { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,0.16); }
.map-dot-offline { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,0.16); }
.map-marker-wrap { background: transparent; border: 0; }

/* ===== Marcador: AP (Access Point) — ícone WiFi compacto ===== */
.map-marker-ap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  position: relative;
}
.map-marker-ap.status-online { background: #10b981; }
.map-marker-ap.status-offline { background: #ef4444; }
.map-marker-ap svg { width: 16px; height: 16px; color: #fff; }

/* ===== Marcador: CCR / MikroTik Core — hexágono grande destaque ===== */
.map-marker-ccr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  border: none;
  position: relative;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.45));
}
.map-marker-ccr.status-online { background: linear-gradient(135deg, #059669, #10b981); }
.map-marker-ccr.status-offline { background: linear-gradient(135deg, #dc2626, #ef4444); }
.map-marker-ccr svg { width: 20px; height: 20px; color: #fff; }
.map-marker-ccr::after {
  content: '';
  position: absolute;
  inset: 2px;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: rgba(255,255,255,0.1);
  pointer-events: none;
}

/* ===== Marcador: Bridge — losango / diamante ===== */
.map-marker-bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  transform: rotate(45deg);
  border-radius: 6px;
  border: 2.5px solid #ffffff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  position: relative;
}
.map-marker-bridge.status-online { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.map-marker-bridge.status-offline { background: linear-gradient(135deg, #dc2626, #f87171); }
.map-marker-bridge svg {
  width: 16px;
  height: 16px;
  color: #fff;
  transform: rotate(-45deg);
}

/* ===== Onda radar pulsante — AP online ===== */
.map-marker-ap.status-online::before,
.map-marker-ap.status-online::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 100%; height: 100%;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  border: 2px solid rgba(16, 185, 129, 0.6);
  pointer-events: none;
  animation: radarPulseAp 2.5s ease-out infinite;
}
.map-marker-ap.status-online::after {
  animation-delay: 1.25s;
}
@keyframes radarPulseAp {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; border-color: rgba(16, 185, 129, 0.6); }
  100% { transform: translate(-50%, -50%) scale(2.8); opacity: 0; border-color: rgba(16, 185, 129, 0); }
}

/* ===== Onda radar pulsante — CCR online (maior, por cima do hexágono) ===== */
.map-marker-ccr.status-online {
  overflow: visible;
}
.marker-ccr-pulse-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 44px; height: 44px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  border: 2.5px solid rgba(16, 185, 129, 0.6);
  pointer-events: none;
  animation: radarPulseCcr 2.5s ease-out infinite;
  z-index: -1;
}
.marker-ccr-pulse-ring:nth-child(3) {
  animation-delay: 1.25s;
}
@keyframes radarPulseCcr {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; border-color: rgba(16, 185, 129, 0.65); }
  100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; border-color: rgba(16, 185, 129, 0); }
}

/* ===== Onda radar pulsante — Bridge online ===== */
.map-marker-bridge.status-online::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 100%; height: 100%;
  border-radius: 6px;
  transform: translate(-50%, -50%) scale(1);
  border: 2px solid rgba(20, 184, 166, 0.6);
  pointer-events: none;
  animation: radarPulseBridge 2.5s ease-out infinite;
}
@keyframes radarPulseBridge {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; border-color: rgba(20, 184, 166, 0.6); }
  100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; border-color: rgba(20, 184, 166, 0); }
}
.map-popup {
  min-width: 180px;
  color: #0f172a;
}
.map-popup-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.map-popup-meta {
  font-family: monospace;
  color: #475569;
  font-size: 0.78rem;
  margin-bottom: 8px;
}
.map-popup-desc {
  color: #475569;
  font-size: 0.78rem;
  margin-top: 8px;
  line-height: 1.35;
}
.map-popup-remove {
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.08);
  color: #dc2626;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 8px;
}
.map-popup-remove:hover {
  background: #dc2626;
  color: #ffffff;
}
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(15,23,42,0.22);
}
.leaflet-control-attribution {
  font-size: 10px;
}

@media (max-width: 767.98px) {
  .equipment-map {
    min-height: 420px;
    height: 68vh;
  }
}

/* --- Integrações (Telegram) --- */
.card-telegram { background: rgba(15,23,42,0.35) !important; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.04) !important; border-radius: 20px; transition: border-color 0.25s ease; height: 100%; }
.card-telegram:hover { border-color: rgba(56,189,248,0.12) !important; box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
.card-telegram-header { padding: 1.5rem 1.5rem 0.5rem 1.5rem; display: flex; align-items: center; gap: 14px; }
.card-telegram-icon { width: 42px; height: 42px; background: linear-gradient(135deg, rgba(0,136,204,0.15), rgba(0,136,204,0.05)); border: 1px solid rgba(0,136,204,0.2); border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-telegram-title { font-size: 0.95rem; font-weight: 700; color: #f1f5f9; margin: 0; }
.card-telegram-sub { font-size: 0.7rem; color: #94a3b8; font-weight: 500; margin: 0; }
.card-telegram-body { padding: 1.25rem 1.5rem 1.5rem 1.5rem; }
.tg-input { background: rgba(15,23,42,0.6) !important; border: 1px solid rgba(255,255,255,0.06) !important; color: #f1f5f9 !important; border-radius: 10px; padding: 0.7rem 1rem; font-size: 0.85rem; transition: all 0.2s ease; }
.tg-input::placeholder { color: #475569 !important; }
.tg-input:focus { border-color: #3b82f6 !important; box-shadow: 0 0 0 3px rgba(59,130,246,0.15) !important; background: rgba(15,23,42,0.8) !important; }
.tg-label { color: #94a3b8; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.tg-btn-save { background: linear-gradient(135deg, #2563eb, #4f46e5); border: none; color: #fff; font-weight: 600; font-size: 0.85rem; padding: 0.7rem 1.5rem; border-radius: 10px; transition: all 0.2s ease; }
.tg-btn-save:hover { background: linear-gradient(135deg, #3b82f6, #6366f1); box-shadow: 0 4px 16px rgba(59,130,246,0.3); transform: translateY(-1px); color: #fff; }
.tg-btn-test { background: rgba(0,136,204,0.1); border: 1px solid rgba(0,136,204,0.2); color: #38bdf8; font-weight: 600; font-size: 0.85rem; padding: 0.7rem 1.5rem; border-radius: 10px; transition: all 0.2s ease; }
.tg-btn-test:hover { background: #0088cc; color: #fff; border-color: #0088cc; box-shadow: 0 4px 16px rgba(0,136,204,0.3); transform: translateY(-1px); }

/* --- Sobrescritas de Contraste para Cores Mutadas --- */
.text-muted, .text-secondary {
    color: #94a3b8 !important;
}

/* --- Login --- */
.login-wrapper { min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; }
.login-card {
    background: rgba(15, 23, 42, 0.65); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7); padding: 5px; position: relative; width: 100%;
}
.login-card::before { content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(to right, transparent, rgba(56, 189, 248, 0.4), rgba(167, 139, 250, 0.4), transparent); }
.login-header { padding: 2rem 1.5rem 1rem 1.5rem; }
.login-title { font-weight: 800; font-size: 1.8rem; letter-spacing: -0.04em; background: linear-gradient(135deg, #f8fafc 30%, #94a3b8 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.brand-highlight { background: linear-gradient(to right, #38bdf8, #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-subtitle { color: #94a3b8; font-size: 0.85rem; margin-top: 0.5rem; font-weight: 400; }
.login-logo { width: 94px; height: 94px; object-fit: contain; }
.btn-custom { background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%); border: none; color: #ffffff; padding: 0.85rem; font-weight: 600; border-radius: 12px; font-size: 0.95rem; letter-spacing: 0.02em; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); }
.btn-custom:hover { background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5); transform: translateY(-2px); color: #ffffff; }
.btn-custom:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2); }

/* --- Login Form --- */
.login-card .form-control {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #ffffff !important;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.login-card .form-control::placeholder { color: #64748b !important; }
.login-card .form-control:focus { border-color: #4f46e5 !important; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25) !important; background-color: #0f172a !important; color: #ffffff !important; }
.login-card .form-label { color: #94a3b8; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Animações --- */
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
@keyframes statusGreenPulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); } 70% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
@keyframes criticalPulse { 0% { border-color: rgba(239, 68, 68, 0.2); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.1); } 70% { border-color: rgba(239, 68, 68, 0.5); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } 100% { border-color: rgba(239, 68, 68, 0.2); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Modal Mobile --- */
@media (max-width: 767.98px) {
  .modal-dialog { margin: 0.5rem; }
  .modal-dialog-centered { min-height: calc(100% - 1rem); }
  .modal-xl { max-width: 100%; }
  .modal-content { border-radius: 12px !important; }
  .modal-body { padding: 1rem !important; }
}
@media (max-width: 480px) {
  .modal-dialog { margin: 0.25rem; }
  .modal-body { padding: 0.75rem !important; max-height: 80vh; overflow-y: auto; }
}

/* --- Sidebar Overlay (mobile) --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 2900;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* --- Responsividade --- */
@media (max-width: 767.98px) {
  .mobile-navbar { display: flex !important; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 2000; }
  .sidebar { position: fixed; top: 0; left: 0; width: 280px; height: 100vh; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(.4,0,.2,1); will-change: transform; }
  .sidebar.show { transform: translateX(0); }
  .content-wrapper { padding: 0.75rem !important; }

  .btn-custom:hover { background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%); box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); transform: none; }

  .page-header-title { font-size: 1.15rem !important; }

  .metric-card::before { width: 100px; height: 100px; top: -30px; right: -30px; }
  .metric-value { font-size: 1.5rem; }
  .metric-icon { width: 44px; height: 44px; border-radius: 12px; }
  .metric-icon i, .metric-icon svg { width: 20px !important; height: 20px !important; }

  .table-premium thead th { padding: 0.6rem 0.75rem; font-size: 0.65rem; }
  .table-premium tbody td { padding: 0.5rem 0.75rem !important; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .content-wrapper { padding: 0.5rem !important; }
  .btn-premium-submit, .btn-premium-danger, .btn-premium-action { padding: 0.75rem 1rem; }
  .form-control-premium { font-size: 1rem; }
  .metric-label { font-size: 0.85rem; }
  .badge-status-online, .badge-status-offline { padding: 6px 14px; }
  .sidebar-nav a, .sidebar a { padding: 14px 20px; font-size: 0.95rem; }

   .page-header-title { font-size: 1rem !important; }
   .text-muted.small { font-size: 0.7rem !important; }
}

/* --- Estilos Adicionais para Inputs e Ajuda Telegram (NOC Dark) --- */
.pppoe-desc-input {
    background: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: #cbd5e1 !important;
}
.pppoe-desc-input::placeholder {
    color: #64748b !important;
}
.pppoe-desc-input:focus {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
}
.card-telegram-help {
    background: rgba(15, 23, 42, 0.2) !important;
}
.card-telegram-help-list {
    color: #94a3b8;
    font-size: 0.8rem;
    padding-left: 1.2rem;
    margin: 0;
    line-height: 1.8;
}
.card-telegram-help-strong {
    color: #f1f5f9;
}

/* ============================================================
   TEMA LIGHT MODE (Layout Branco Premium)
   ============================================================ */

/* Base Styles */
html.light-mode {
    background-color: #f8fafc !important;
}
html.light-mode body {
    background: #f8fafc !important;
    color: #1e293b !important;
}

/* Page headers */
html.light-mode .page-header-title,
html.light-mode .dash-header-title {
    background: linear-gradient(135deg, #0f172a 30%, #475569 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Global Top Bar Title & Subtitle */
html.light-mode .global-top-bar h1 {
    color: #0f172a !important;
}
html.light-mode .global-top-bar p {
    color: #64748b !important;
}

/* Content wrapper background */
html.light-mode .content-wrapper {
    background: radial-gradient(circle at top right, #f8fafc 0%, #f1f5f9 60%) !important;
}

/* Top bar actions (Moon, Bell, User) */
html.light-mode .btn-topbar-action {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}
html.light-mode .btn-topbar-action:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
html.light-mode .btn-topbar-action .fw-semibold {
    color: #334155 !important;
}

/* Notification & Profile Dropdown menus */
html.light-mode .dropdown-menu-premium {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -4px rgba(0,0,0,0.05) !important;
}
html.light-mode .dropdown-menu-premium .dropdown-item {
    color: #334155 !important;
}
html.light-mode .dropdown-menu-premium .dropdown-item:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}
html.light-mode .dropdown-menu-premium .border-bottom {
    border-bottom-color: #f1f5f9 !important;
}
html.light-mode .dropdown-menu-premium .fw-bold,
html.light-mode .dropdown-menu-premium .text-white {
    color: #0f172a !important;
}
html.light-mode .dropdown-menu-premium .text-muted {
    color: #64748b !important;
}

/* Cards Premium */
html.light-mode .card-premium {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
}
html.light-mode .card-premium:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
}
html.light-mode .card-premium-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html.light-mode .card-premium-title {
    color: #0f172a !important;
}

/* Metric cards labels and values */
html.light-mode .metric-title {
    color: #64748b !important;
}
html.light-mode .metric-value {
    color: #0f172a !important;
}
html.light-mode .metric-label {
    color: #64748b !important;
}
html.light-mode .text-muted,
html.light-mode .text-secondary {
    color: #64748b !important;
}
html.light-mode .font-mono-noc {
    color: #475569 !important;
}

/* Form inputs & inputs group text */
html.light-mode .form-control-premium {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .form-control-premium::placeholder {
    color: #94a3b8 !important;
}
html.light-mode .form-control-premium:focus {
    background-color: #ffffff !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}
html.light-mode .form-label-premium {
    color: #475569 !important;
}
html.light-mode .input-group-text {
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}

/* NOC Search inputs */
html.light-mode .input-busca-noc {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .input-busca-noc:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15) !important;
}
html.light-mode .input-busca-noc::placeholder {
    color: #94a3b8 !important;
}

/* Tables */
html.light-mode .table-premium {
    color: #334155 !important;
}
html.light-mode .table-premium thead th {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html.light-mode .table-premium tbody tr {
    border-bottom: 1px solid #f1f5f9 !important;
}
html.light-mode .table-premium tbody tr:hover {
    background-color: #f8fafc !important;
}

/* Sidebar overrides */
html.light-mode .sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.02) !important;
}
html.light-mode .sidebar-brand {
    border-bottom: 1px solid #f1f5f9 !important;
}
html.light-mode .sidebar-title {
    background: linear-gradient(to right, #0f172a, #334155) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
html.light-mode .sidebar a {
    color: #475569 !important;
}
html.light-mode .sidebar a:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}
html.light-mode .sidebar a.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.1) 0%, rgba(56, 189, 248, 0.02) 100%) !important;
    color: #0284c7 !important;
    box-shadow: inset 3px 0 0 #0284c7 !important;
}
html.light-mode .sidebar a i,
html.light-mode .sidebar a svg {
    color: #64748b !important;
}
html.light-mode .sidebar a.active i,
html.light-mode .sidebar a.active svg {
    color: #0284c7 !important;
}
html.light-mode .sidebar-footer {
    border-top: 1px solid #f1f5f9 !important;
    background: #f8fafc !important;
}
html.light-mode .user-profile-box {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}
html.light-mode .user-name {
    color: #0f172a !important;
}
html.light-mode .user-role {
    color: #64748b !important;
}
html.light-mode .sidebar a.logout-link {
    color: #ef4444 !important;
}
html.light-mode .sidebar a.logout-link:hover {
    background-color: #fee2e2 !important;
    color: #ef4444 !important;
}
html.light-mode .sidebar a.logout-link i,
html.light-mode .sidebar a.logout-link svg {
    color: #ef4444 !important;
}

/* Footer & Modals */
html.light-mode footer {
    background: #ffffff !important;
    border-top: none !important;
}
html.light-mode footer p {
    color: #64748b !important;
}
html.light-mode .modal-content {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}
html.light-mode #modalSucessoTitulo {
    color: #0f172a !important;
}
html.light-mode #modalSucessoMsg {
    color: #64748b !important;
}

/* PWA Mobile bar */
html.light-mode .mobile-navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html.light-mode .mobile-navbar .sidebar-title {
    background: linear-gradient(to right, #0f172a, #334155) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
html.light-mode .mobile-navbar button {
    color: #0f172a !important;
}

/* Map specific overrides */
html.light-mode .equipment-map {
    border-color: #cbd5e1 !important;
    background: #e2e8f0 !important;
}
html.light-mode .map-loading-box {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .map-legend {
    color: #475569 !important;
}
html.light-mode .map-save-status {
    color: #64748b !important;
}

/* Timeline */
html.light-mode .timeline-noc::before {
    background: rgba(15, 23, 42, 0.08) !important;
}

/* Pico card */
html.light-mode .pico-card {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}
html.light-mode .pico-nome {
    color: #334155 !important;
}
html.light-mode .pico-valor {
    color: #b45309 !important;
}

/* Diagnostic (Avançado) page light mode cards */
html.light-mode .diagnostic-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}
html.light-mode .diag-title {
    color: #0f172a !important;
}
html.light-mode .diag-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .diag-input::placeholder {
    color: #94a3b8 !important;
}
html.light-mode .diag-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12) !important;
}
html.light-mode .diag-output {
    background: #0f172a !important;
    border-color: #cbd5e1 !important;
    color: #e2e8f0 !important;
}
html.light-mode .progress-dark {
    background-color: #e2e8f0 !important;
    border: 1px solid #cbd5e1 !important;
}
html.light-mode .diag-btn-ping {
    background: rgba(16,185,129,0.08);
}
html.light-mode .diag-btn-trace {
    background: rgba(99,102,241,0.08);
}

/* Telegram integration card */
html.light-mode .card-telegram {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}
html.light-mode .card-telegram-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html.light-mode .card-telegram-title {
    color: #0f172a !important;
}
html.light-mode .card-telegram-sub {
    color: #64748b !important;
}
html.light-mode .tg-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .tg-input:focus {
    background: #ffffff !important;
    border-color: #3b82f6 !important;
}
html.light-mode .tg-label {
    color: #475569 !important;
}
html.light-mode .tg-btn-test {
    background: rgba(0, 136, 204, 0.06);
}

/* User avatar styles in light mode */
html.light-mode .user-avatar-admin {
    background: rgba(168, 85, 247, 0.08) !important;
    color: #8b5cf6 !important;
    border-color: rgba(168, 85, 247, 0.2) !important;
}
html.light-mode .user-avatar-user {
    background: rgba(56, 189, 248, 0.08) !important;
    color: #0284c7 !important;
    border-color: rgba(56, 189, 248, 0.2) !important;
}
html.light-mode .badge-status-unmapped {
    background: rgba(14, 165, 233, 0.08) !important;
    color: #0284c7 !important;
    border: 1px solid rgba(14, 165, 233, 0.18) !important;
}
html.light-mode .badge-status-unmapped .dot-pulse {
    background-color: #0284c7 !important;
}

/* Leaflet control style corrections */
html.light-mode .leaflet-control-zoom-in,
html.light-mode .leaflet-control-zoom-out {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-bottom-color: #e2e8f0 !important;
}
html.light-mode .leaflet-popup-content-wrapper {
    background: #ffffff !important;
    color: #0f172a !important;
}
html.light-mode .leaflet-popup-tip {
    background: #ffffff !important;
}
html.light-mode .map-popup-title {
    color: #0f172a !important;
}
html.light-mode .map-popup-meta {
    color: #64748b !important;
}
html.light-mode .map-popup-desc {
    color: #334155 !important;
    border-top: 1px solid #f1f5f9 !important;
}
html.light-mode .map-popup-remove {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #ef4444 !important;
}
html.light-mode .map-popup-remove:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
}
html.light-mode .dropdown-menu-dark.dropdown-menu-premium {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}
html.light-mode .custom-select-premium .btn.form-control-premium {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}
html.light-mode .custom-select-premium .selected-text.text-white {
    color: #0f172a !important;
}
html.light-mode .dropdown-item-premium {
    color: #475569 !important;
}
html.light-mode .dropdown-item-premium:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}
html.light-mode .dropdown-item-premium .text-white {
    color: #0f172a !important;
}
html.light-mode .form-control-premium-search {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .form-control-premium-search:focus {
    background-color: #ffffff !important;
    border-color: #6366f1 !important;
}
html.light-mode .dropdown-list-container::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
}
html.light-mode .dropdown-list-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

/* Light mode overrides for additional inputs and integration help */
html.light-mode .diag-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .diag-input::placeholder {
    color: #94a3b8 !important;
}
html.light-mode .pppoe-desc-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .pppoe-desc-input::placeholder {
    color: #94a3b8 !important;
}
html.light-mode .card-telegram-help {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
html.light-mode .card-telegram-help-list {
    color: #475569 !important;
}
html.light-mode .card-telegram-help-strong {
    color: #0f172a !important;
}

/* --- Leaflet Control Adjustments (Dark/Light Modes) --- */
/* Zoom and Bar controls - Dark Mode */
.leaflet-bar {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    border-radius: 8px !important;
    overflow: hidden;
}
.leaflet-bar a {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    transition: all 0.2s ease;
}
.leaflet-bar a:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
}
.leaflet-bar a.leaflet-disabled {
    background-color: #020617 !important;
    color: #475569 !important;
}

/* Zoom and Bar controls - Light Mode */
html.light-mode .leaflet-bar {
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.08) !important;
    border-radius: 8px !important;
    overflow: hidden;
}
html.light-mode .leaflet-bar a {
    background-color: #ffffff !important;
    color: #334155 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html.light-mode .leaflet-bar a:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}
html.light-mode .leaflet-bar a.leaflet-disabled {
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
}

/* Layers switcher control - Dark Mode (Default) */
.leaflet-control-layers {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.25s ease;
}
.leaflet-control-layers-toggle {
    background-color: #0f172a !important;
    border-radius: 8px !important;
}
.leaflet-control-layers-expanded {
    padding: 10px 14px !important;
}
.leaflet-control-layers-list {
    font-size: 0.82rem;
    font-weight: 500;
}
.leaflet-control-layers label {
    margin-bottom: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
}
.leaflet-control-layers label:last-child {
    margin-bottom: 0;
}
.leaflet-control-layers input[type="radio"] {
    cursor: pointer;
    accent-color: #3b82f6;
    margin: 0;
}

/* Layers switcher control - Light Mode */
html.light-mode .leaflet-control-layers {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08) !important;
}
html.light-mode .leaflet-control-layers-toggle {
    background-color: #ffffff !important;
}
html.light-mode .leaflet-control-layers label {
    color: #334155;
}
html.light-mode .leaflet-control-layers input[type="radio"] {
    accent-color: #2563eb;
}

@media (max-width: 767.98px) {
    .sidebar {
        overflow: hidden;
    }

    .sidebar-nav {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .content-wrapper {
        padding: 14px !important;
    }

    .global-top-bar {
        align-items: flex-start !important;
        flex-wrap: wrap;
        gap: 12px;
    }

    .topbar-left-info {
        min-width: 0;
        flex: 1 1 180px;
    }

    .dropdown-menu-premium {
        width: min(290px, calc(100vw - 28px)) !important;
        max-height: min(400px, calc(100dvh - 90px)) !important;
    }

    .card-premium-header,
    .d-flex.justify-content-between {
        flex-wrap: wrap;
    }

    .table-responsive:has(.responsive-card-table) {
        overflow: visible;
    }

    .responsive-card-table,
    .responsive-card-table tbody,
    .responsive-card-table tr,
    .responsive-card-table td {
        display: block;
        width: 100%;
    }

    .responsive-card-table {
        margin: 0;
        border: 0;
    }

    .responsive-card-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .responsive-card-table tbody {
        display: grid;
        gap: 10px;
    }

    .responsive-card-table tbody tr {
        padding: 7px 12px;
        background: rgba(15, 23, 42, 0.72);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
    }

    .responsive-card-table tbody td {
        display: grid;
        grid-template-columns: minmax(88px, 32%) minmax(0, 1fr);
        align-items: center;
        gap: 9px;
        min-height: 40px;
        max-width: none !important;
        padding: 8px 0 !important;
        overflow: visible !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
        border: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
        text-align: left !important;
    }

    .responsive-card-table tbody td:last-child {
        border-bottom: 0 !important;
    }

    .responsive-card-table tbody td[colspan] {
        display: block;
        min-height: 0;
        text-align: center !important;
    }

    .responsive-card-table tbody td[colspan]::before {
        display: none;
    }

    .responsive-card-table tbody td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .responsive-card-table td form,
    .responsive-card-table td .d-flex {
        flex-wrap: wrap;
        justify-content: flex-start !important;
        max-width: none !important;
    }

    .responsive-card-table td .btn {
        min-height: 38px;
    }

    .responsive-card-table input,
    .responsive-card-table select {
        width: 100%;
        min-width: 0 !important;
        max-width: none !important;
    }
}

html.light-mode .responsive-card-table tbody tr {
    background: #ffffff;
    border-color: #e2e8f0;
}

html.light-mode .responsive-card-table tbody td {
    border-bottom-color: #e2e8f0 !important;
}

@media (max-width: 480px) {
    .responsive-card-table tbody td {
        grid-template-columns: minmax(78px, 29%) minmax(0, 1fr);
    }

    .card-premium-header .btn,
    .card-premium-header input[type="text"] {
        width: 100%;
        max-width: none !important;
    }
}

body.dashboard-fullscreen {
    overflow: auto;
}

body.dashboard-fullscreen .sidebar,
body.dashboard-fullscreen .sidebar-overlay,
body.dashboard-fullscreen .mobile-navbar,
body.dashboard-fullscreen footer {
    display: none !important;
}

body.dashboard-fullscreen .container-fluid,
body.dashboard-fullscreen .container-fluid > .row {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

body.dashboard-fullscreen .content-wrapper {
    width: 100%;
    max-width: none;
    flex: 0 0 100%;
    padding: 12px !important;
}

body.dashboard-fullscreen .global-top-bar {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1090;
    margin: 0 !important;
    pointer-events: none;
}

body.dashboard-fullscreen .global-top-bar > .topbar-left-info,
body.dashboard-fullscreen .global-top-bar > .d-flex > :not(#fullscreenDashboardBtn) {
    display: none !important;
}

body.dashboard-fullscreen .global-top-bar > .d-flex {
    pointer-events: auto;
}

body.dashboard-fullscreen #fullscreenDashboardBtn {
    background: rgba(15, 23, 42, 0.9) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
}
