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

:root, [data-theme="dark"] {
  --bg-main: #0b0f17;
  --bg-sidebar: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.6);
  --bg-card-hover: rgba(51, 65, 85, 0.4);
  --border-color: rgba(51, 65, 85, 0.5);
  
  --brand-primary: #0ea5e9;
  --brand-accent: #10b981;
  --kpi-red-bg: rgba(239, 68, 68, 0.15);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
}

[data-theme="light"] {
  --bg-main: #f3f6f9;
  --bg-sidebar: rgba(255, 255, 255, 0.85);
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-color: rgba(203, 213, 225, 0.6);
  
  --brand-primary: #2563eb;
  --brand-accent: #10b981;
  --kpi-red-bg: #fef2f2;

  --text-main: #1e293b;
  --text-muted: #475569;
  --text-dim: #94a3b8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===================================================================== */
/* REMOÇÃO TOTAL DE BARRAS DE ROLAGEM HORIZONTAIS & SCROLL DARK MODERNO   */
/* ===================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 0px;
}

::-webkit-scrollbar:horizontal {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(51, 65, 85, 0.5);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.6);
}

::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
  width: 100%;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html::-webkit-scrollbar, body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  background-image: 
    radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(2, 132, 199, 0.03) 0px, transparent 100%);
  background-attachment: fixed;
}

/* Glassmorphism Card Utility */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.25s ease;
}

.glass-panel:hover {
  border-color: rgba(148, 163, 184, 0.35);
}

/* ===================================================================== */
/* LAYOUT COM SIDEBAR LATERAL ESQUERDA                                   */
/* ===================================================================== */
.dashboard-layout {
  display: flex;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden !important;
  background-color: var(--bg-main);
}

.sidebar {
  width: 275px;
  min-width: 275px;
  background: rgba(11, 15, 25, 0.98);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  z-index: 100;
  backdrop-filter: blur(20px);
}

.sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.sidebar-brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
}

.sidebar-nav-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav-container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.sidebar-nav-section {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  padding: 0 10px 6px 10px;
  text-transform: uppercase;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex-shrink: 0;
}

.sidebar-nav-item:hover {
  background: rgba(30, 41, 59, 0.7);
  color: #fff;
  transform: translateX(3px);
}

.sidebar-nav-item.active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.2), rgba(14, 165, 233, 0.04));
  color: #38bdf8;
  border-left: 3px solid var(--brand-primary);
  font-weight: 700;
}

.sidebar-nav-item.superadmin-btn {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.sidebar-nav-item.superadmin-btn:hover {
  background: rgba(168, 85, 247, 0.3);
  color: #fff;
}

.sidebar-counter-badge {
  display: none !important;
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.sidebar-counter-badge.warn {
  display: none !important;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(51, 65, 85, 0.4);
  background: rgba(15, 23, 42, 0.7);
}

/* ÁREA PRINCIPAL COM TOPBAR */
.main-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden !important;
  max-width: 100%;
  background-color: var(--bg-main);
  scrollbar-width: thin;
  scrollbar-color: rgba(51, 65, 85, 0.4) transparent;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.main-container {
  padding: 24px 28px 40px 28px;
  max-width: 1600px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--brand-primary-glow);
}

.olt-selector-wrapper select {
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.search-bar {
  display: flex;
  align-items: center;
  position: relative;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.96) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  border-radius: 10px;
  padding: 7px 16px;
  gap: 10px;
  width: 480px;
  min-width: 420px;
  max-width: 620px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 16px rgba(56, 189, 248, 0.15);
}

.search-bar:hover {
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4), 0 0 22px rgba(56, 189, 248, 0.28);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
}

.search-bar:focus-within {
  width: 540px;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), 0 0 26px rgba(56, 189, 248, 0.4);
  background: #0f172a;
}

.search-icon-svg {
  flex-shrink: 0;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.search-bar:focus-within .search-icon-svg {
  transform: scale(1.1);
  stroke: #00f2fe;
}

.search-bar input {
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 0.88rem;
  font-weight: 500;
  outline: none;
  width: 100%;
  min-width: 340px;
  padding: 2px 0;
}

.search-bar input::placeholder {
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 400;
  white-space: nowrap;
}

.search-kbd {
  flex-shrink: 0;
  font-size: 0.66rem;
  font-family: inherit;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  padding: 3px 7px;
  letter-spacing: 0.03em;
  user-select: none;
  pointer-events: none;
  transition: all 0.2s ease;
}

.search-bar:focus-within .search-kbd {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.15);
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.search-clear-btn:hover {
  color: #f87171;
}

.live-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 600;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--brand-primary), #6366f1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-tag {
  font-size: 0.65rem;
  color: var(--brand-primary);
  font-weight: 600;
}

.logout-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

/* ===================================================================== */
/* BOTÕES & FORMS                                                        */
/* ===================================================================== */
.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), #0284c7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover {
  opacity: 0.92;
  box-shadow: 0 0 12px var(--brand-primary-glow);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-small {
  background: #1e293b;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-small:hover {
  background: #334155;
  color: #fff;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  min-width: 0;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #0f172a;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 8px var(--brand-primary-glow);
}

/* ===================================================================== */
/* KPI CARDS (COLOR-CODED)                                               */
/* ===================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.kpi-card {
  padding: 20px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.blue::before { background: var(--kpi-blue); }
.kpi-card.green::before { background: var(--kpi-green); }
.kpi-card.graphite::before { background: var(--kpi-graphite); }
.kpi-card.orange::before { background: var(--kpi-orange); }

.kpi-card.blue { background: var(--kpi-blue-bg); border-color: rgba(2, 132, 199, 0.4); }
.kpi-card.green { background: var(--kpi-green-bg); border-color: rgba(16, 185, 129, 0.4); }
.kpi-card.graphite { background: var(--kpi-graphite-bg); border-color: rgba(100, 116, 139, 0.4); }
.kpi-card.orange { background: var(--kpi-orange-bg); border-color: rgba(245, 158, 11, 0.4); }

.kpi-card {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}
.kpi-card:hover {
  transform: translateY(-4px) scale(1.012);
}
.kpi-card.blue:hover {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.6), 0 0 24px rgba(14, 165, 233, 0.25);
}
.kpi-card.green:hover {
  border-color: rgba(52, 211, 153, 0.7);
  box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.6), 0 0 24px rgba(16, 185, 129, 0.25);
}
.kpi-card.graphite:hover {
  border-color: rgba(248, 113, 113, 0.7);
  box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.6), 0 0 24px rgba(239, 68, 68, 0.2);
}
.kpi-card.orange:hover {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.6), 0 0 24px rgba(245, 158, 11, 0.25);
}

.kpi-mini-meter {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin: 6px 0;
  display: flex;
}

.kpi-meter-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kpi-meter-fill.blue { background: linear-gradient(90deg, #0284c7, #38bdf8); box-shadow: 0 0 8px rgba(56, 189, 248, 0.5); }
.kpi-meter-fill.green { background: linear-gradient(90deg, #059669, #34d399); box-shadow: 0 0 8px rgba(52, 211, 153, 0.5); }
.kpi-meter-fill.yellow { background: #eab308; }
.kpi-meter-fill.red { background: #ef4444; }
.kpi-meter-fill.slate { background: #64748b; }
.kpi-meter-fill.amber { background: #f59e0b; }
.kpi-meter-fill.crimson { background: #dc2626; box-shadow: 0 0 8px rgba(220, 38, 38, 0.6); }

/* Animação suave para números quando sofrem atualização */
.number-updating {
  display: inline-block;
  animation: number-glow 0.4s ease-out;
}

@keyframes number-glow {
  0% { transform: scale(1.1); filter: brightness(1.5); }
  50% { transform: scale(1.04); filter: brightness(1.2); }
  100% { transform: scale(1); filter: brightness(1); }
}

.topbar-refresh-btn {
  background: transparent;
  border: none;
  color: #34d399;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  margin-left: 6px;
  border-radius: 4px;
  transition: transform 0.3s ease, color 0.2s ease;
}

.topbar-refresh-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(180deg);
}

.topbar-refresh-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

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

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.kpi-icon {
  opacity: 0.8;
}

.kpi-value-container {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.kpi-main-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.kpi-card.blue .kpi-main-value { color: #38bdf8; }
.kpi-card.green .kpi-main-value { color: #34d399; }
.kpi-card.graphite .kpi-main-value { color: #cbd5e1; }
.kpi-card.orange .kpi-main-value { color: #fbbf24; }

.kpi-sub-badge {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.kpi-sub-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
}

.sub-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.sub-tag.blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.sub-tag.green { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.sub-tag.orange { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.sub-tag.red { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.sub-tag.slate { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }

/* ===================================================================== */
/* DASHBOARD GRID & CARDS                                                */
/* ===================================================================== */
.dashboard-grid-2col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .dashboard-grid-2col { grid-template-columns: 1fr; }
}

.chart-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title-group h2 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.chart-controls {
  display: flex;
  gap: 4px;
  background: #1e293b;
  padding: 2px;
  border-radius: 6px;
}

.time-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.time-btn.active {
  background: var(--brand-primary);
  color: #fff;
}

.chart-canvas-container {
  width: 100%;
  height: 260px;
  position: relative;
}

.chart-canvas-container canvas {
  width: 100% !important;
  height: 260px !important;
  display: block;
}

.timeline-tooltip {
  position: absolute;
  top: 10px;
  right: 14px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.76rem;
  color: #fff;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(-4px);
  z-index: 20;
}

.timeline-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.outage-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.outage-alerts-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 290px;
  overflow-y: auto;
}

.outage-alert-card {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.outage-alert-card:hover {
  transform: translateY(-2px);
  border-color: rgba(239, 68, 68, 0.8);
}

.outage-alert-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: #f87171;
}

.outage-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.outage-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* Toolbar Dinâmica de Filtros para ONUs */
.onu-filter-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-top: 14px;
}

.onu-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.onu-pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.onu-pill-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateY(-1px);
}

.onu-pill-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.onu-pill-btn.green.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.onu-pill-btn.red.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.onu-pill-btn.amber.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
  animation: dot-pulse 1.8s infinite;
  display: inline-block;
}

@keyframes dot-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes ztp-border-pulse {
  0%, 100% { border-color: rgba(56, 189, 248, 0.3); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }
  50% { border-color: rgba(56, 189, 248, 0.85); box-shadow: 0 0 22px rgba(56, 189, 248, 0.45); }
}

.ztp-pulsing-card {
  animation: ztp-border-pulse 2.2s infinite ease-in-out !important;
}

/* ===================================================================== */
/* TABELAS DE DADOS                                                      */
/* ===================================================================== */
.data-table-wrapper,
.table-container {
  overflow-x: auto;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.data-table-wrapper::-webkit-scrollbar,
.table-container::-webkit-scrollbar {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table tr:hover td {
  background: rgba(30, 41, 59, 0.4);
}

.sn-code {
  font-family: 'Fira Code', monospace;
  color: #38bdf8;
  font-weight: 600;
}

/* ===================================================================== */
/* GRID DE OLTS & AUDIT FEED                                             */
/* ===================================================================== */
.bottom-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .bottom-grid { grid-template-columns: 1fr; }
}

.olt-cards-grid {
  display: block;
  width: 100%;
  margin-top: 8px;
}

.olt-list-table {
  width: 100%;
  border-collapse: collapse;
}

.olt-list-table tr.olt-row {
  transition: background 0.15s ease;
}

.olt-list-table tr.olt-row:hover td {
  background: rgba(56, 189, 248, 0.05);
}

.olt-list-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.olt-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.olt-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.olt-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vendor-logo {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--border-color);
}

.vendor-huawei { border-color: #ef4444; color: #f87171; }
.vendor-zte { border-color: #0ea5e9; color: #38bdf8; }
.vendor-fiberhome { border-color: #10b981; color: #34d399; }
.vendor-vsol { border-color: #f59e0b; color: #fbbf24; }
.vendor-intelbras { border-color: #22c55e; color: #4ade80; }
.vendor-nokia { border-color: #0284c7; color: #7dd3fc; }
.vendor-datacom { border-color: #6366f1; color: #a5b4fc; }
.vendor-bdcom { border-color: #ec4899; color: #f472b6; }
.vendor-cdata { border-color: #14b8a6; color: #5eead4; }
.vendor-parks { border-color: #8b5cf6; color: #c084fc; }

.olt-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.olt-ip {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.olt-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(51, 65, 85, 0.4);
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  text-align: center;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.stat-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.stat-val.temp-ok { color: #34d399; }

.olt-card-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.btn-olt-filter {
  width: 100%;
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
  font-weight: 700 !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-size: 0.78rem;
}

.btn-olt-filter:hover {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: #10b981 !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.olt-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 5px;
  align-items: center;
}

.olt-actions .btn-small {
  text-align: center;
  padding: 5px 6px;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-olt-delete {
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  padding: 5px 8px !important;
}

.btn-olt-delete:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #fff !important;
  border-color: #ef4444 !important;
}

.audit-feed-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.audit-logs-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 440px;
  overflow-y: auto;
}

.audit-list-table {
  width: 100%;
  border-collapse: collapse;
}

.audit-list-table tr.audit-row {
  transition: background 0.15s ease;
}

.audit-list-table tr.audit-row:hover td {
  background: rgba(56, 189, 248, 0.05);
}

.audit-list-table td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.audit-item {
  padding: 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.4);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audit-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.audit-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.audit-time {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.audit-text {
  font-size: 0.75rem;
  color: var(--text-main);
}

/* ===================================================================== */
/* TOPOLOGIA GIS & MAPA                                                  */
/* ===================================================================== */
.gis-view-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gis-grid-layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 16px;
  height: 600px;
}

@media (max-width: 1024px) {
  .gis-grid-layout { grid-template-columns: 1fr; height: auto; }
}

#gisMapContainer {
  width: 100%;
  height: 100%;
  min-height: 480px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: #020617;
  z-index: 10;
}

.gis-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.fiber-route-card {
  padding: 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.fiber-route-card:hover {
  border-color: #38bdf8;
  background: rgba(30, 41, 59, 0.7);
}

.fiber-route-card.cut {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
}

.fiber-route-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
}

.fiber-route-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===================================================================== */
/* MODAIS & OVERLAYS                                                     */
/* ===================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(15, 23, 42, 0.5);
}

.terminal-box {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 12px;
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  color: #38bdf8;
  height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.gauge-container {
  text-align: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.gauge-value {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 8px 0;
}

.gauge-optimal { color: #34d399; }

/* ===================================================================== */
/* TELA DE LOGIN                                                         */
/* ===================================================================== */
.login-view-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

.login-left-panel {
  flex: 1.2;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
  border-right: 1px solid var(--border-color);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (max-width: 900px) {
  .login-left-panel { display: none; }
}

.login-right-panel {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-form-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-header-group {
  text-align: center;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.login-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 36px;
}

.toggle-password-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}

.login-options-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.remember-me-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  cursor: pointer;
}

.forgot-link {
  color: var(--brand-primary);
  text-decoration: none;
}

.totp-input-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.totp-box {
  background: #020617;
  border: 1px solid var(--border-color);
  color: #38bdf8;
  font-family: 'Fira Code', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  padding: 10px 0;
  border-radius: 6px;
  outline: none;
}

.totp-box:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 10px var(--brand-primary-glow);
}

/* ===================================================================== */
/* REGRAS GLOBAIS DE RESPONSIVIDADE (MOBILE, TABLETS & DESKTOPS)         */
/* ===================================================================== */

/* Botões do Menu Mobile */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

.mobile-sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.mobile-sidebar-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 998;
}

.sidebar-backdrop.active {
  display: block;
}

/* Telas Médias / Tablets (<= 1024px) */
@media (max-width: 1024px) {
  .dashboard-grid-2col,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

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

/* Telas Tablets & Smartphones (<= 900px) */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    width: 280px;
    height: 100vh;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.85);
  }

  .sidebar.open {
    left: 0;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .mobile-sidebar-close {
    display: block;
  }

  .main-content-wrapper {
    width: 100vw;
  }

  .gis-layout-wrapper {
    flex-direction: column !important;
    height: auto !important;
  }

  .gis-map-container {
    height: 380px !important;
    width: 100% !important;
  }

  .gis-sidebar-feeders {
    width: 100% !important;
    height: 280px !important;
  }
}

/* ===================================================================== */
/* DESIGN RESPONSIVO UNIVERSAL (WEB & MOBILE 100%)                       */
/* ===================================================================== */

/* Telas Tablets & Smartphones Médios (<= 768px) */
@media (max-width: 768px) {
  /* 1. Topbar Mobile Ultra-Limpa */
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 14px;
    height: auto;
    position: sticky;
    top: 0;
  }

  .topbar-left {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .mobile-menu-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    cursor: pointer;
  }

  .olt-selector-wrapper {
    flex: 1;
    min-width: 0;
  }

  .olt-selector-wrapper select {
    width: 100%;
    font-size: 0.8rem;
    padding: 8px 10px;
    text-overflow: ellipsis;
  }

  .live-status-pill {
    padding: 4px 8px;
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .topbar-right {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .topbar-right .search-bar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 8px 12px;
  }

  .topbar-right .search-bar input {
    width: 100% !important;
    min-width: 0 !important;
    padding: 2px 0;
    font-size: 16px !important; /* Previne auto-zoom no Safari iOS */
  }

  .topbar-right .search-bar .search-kbd {
    display: none;
  }

  /* 2. Container e Layout */
  .main-content-wrapper {
    width: 100vw;
    overflow-x: hidden;
  }

  .main-container {
    padding: 14px 12px 60px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .card-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-title-group h2 {
    font-size: 1.15rem;
    line-height: 1.3;
  }

  .section-subtitle {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  /* Barra de Ações com Botões Flexíveis */
  .card-header-flex > div[style*="display: flex"] {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px !important;
  }

  .card-header-flex > div[style*="display: flex"] button {
    flex: 1 1 calc(50% - 6px);
    min-height: 40px;
    justify-content: center;
    text-align: center;
    font-size: 0.78rem;
    padding: 8px 12px;
  }

  /* 3. Grid de KPIs no Mobile */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .kpi-card {
    padding: 14px 12px;
    border-radius: 10px;
  }

  .kpi-title {
    font-size: 0.75rem;
  }

  .kpi-main-value {
    font-size: 1.8rem;
  }

  .kpi-sub-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .kpi-sub-breakdown {
    gap: 4px;
    margin-top: 8px;
  }

  .kpi-sub-item {
    font-size: 0.7rem;
  }

  /* 4. Tabelas Touch com Rolagem Suave */
  .data-table-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin-top: 12px;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  .data-table-wrapper::-webkit-scrollbar {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
  }

  .data-table th {
    padding: 8px 10px;
    font-size: 0.68rem;
  }

  .data-table td {
    padding: 10px;
    font-size: 0.75rem;
  }

  .data-table td .btn-small {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  /* 5. Modais Responsivos (Bottom-Sheet no Mobile) */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100vw !important;
    max-height: 90vh !important;
    border-radius: 16px 16px 0 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 14px 16px;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 0.95rem;
  }

  .modal-body {
    padding: 16px 14px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    gap: 12px !important;
  }

  .modal-footer {
    padding: 12px 14px;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
  }

  .modal-footer button {
    flex: 1;
    min-height: 42px;
    font-size: 0.85rem;
  }

  /* Grids internos de formulários colapsam para 1 coluna */
  #newPlanFormContainer > div[style*="grid-template-columns"],
  #newWgPeerContainer > div[style*="grid-template-columns"],
  #newTenantFormContainer > div[style*="grid-template-columns"],
  #mikrotikVpnModal .modal-body div[style*="grid-template-columns"],
  #wireguardModal .modal-body div[style*="grid-template-columns"],
  .modal-body div[style*="grid-template-columns"],
  .add-olt-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* 6. Inputs amigáveis para touch sem zoom indesejado no iOS */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 40px;
    box-sizing: border-box;
  }

  .olt-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* 7. Painel do Proprietário e SaaS */
  #tabContentOwner > div:last-child {
    grid-template-columns: 1fr !important;
  }
}

/* Telas Pequenas de Celular (<= 540px) */
@media (max-width: 540px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .card-header-flex > div[style*="display: flex"] button {
    flex: 1 1 100%;
  }

  .login-right-panel {
    padding: 16px;
  }

  .login-form-card {
    padding: 22px 16px;
  }

  .kpi-main-value {
    font-size: 2rem;
  }

  .sidebar-brand-title {
    font-size: 0.95rem;
  }

  /* Toasts no rodapé centralizado no celular */
  .zeus-toast {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    width: auto !important;
    justify-content: center;
    padding: 10px 14px;
    font-size: 0.8rem;
  }
}

/* TOAST NOTIFICATION */
.zeus-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border: 1px solid #10b981;
  color: #86efac;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 15px rgba(16,185,129,0.3);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 0.3s ease forwards;
}

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

/* ===================================================================== */
/* ESTILOS: MINHA ASSINATURA & PAGAMENTOS MERCADO PAGO                  */
/* ===================================================================== */

#pixQrCodeContainer img {
  max-width: 220px;
  height: auto;
  display: block;
  border-radius: 6px;
}

.invoice-badge-status {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.invoice-badge-status.approved {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.invoice-badge-status.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.invoice-badge-status.rejected, .invoice-badge-status.cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* =====================================================================
   PAINEL DADOS DA VPS - TELEMETRIA & HARDWARE REAL (KERNEL LINUX)
   ===================================================================== */
.vps-kpi-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.65));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.vps-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.vps-kpi-card.accent-cyan { border-top: 3px solid #06b6d4; }
.vps-kpi-card.accent-emerald { border-top: 3px solid #10b981; }
.vps-kpi-card.accent-purple { border-top: 3px solid #a855f7; }
.vps-kpi-card.accent-amber { border-top: 3px solid #f59e0b; }

.vps-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
  position: relative;
}

.vps-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

.vps-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

.vps-spec-row:last-child {
  border-bottom: none;
}

.vps-spec-label {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.vps-spec-val {
  font-weight: 600;
  color: #fff;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
}

.vps-live-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: vpsPulse 1.8s infinite;
}

@keyframes vpsPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@media (max-width: 900px) {
  .vps-grid-4 {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 600px) {
  .vps-grid-4 {
    grid-template-columns: 1fr !important;
  }
}

/* ===================================================================== */
/* PAGINAÇÃO DE ONUS & CLIENTES ATIVOS                                   */
/* ===================================================================== */
.onu-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.onu-pagination-info {
  font-size: 0.82rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.onu-pagination-info strong {
  color: #f1f5f9;
  font-weight: 600;
}

.onu-pagination-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.onu-page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.onu-page-btn:hover:not(:disabled):not(.active) {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  transform: translateY(-1px);
}

.onu-page-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(2, 132, 199, 0.25));
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  cursor: default;
}

.onu-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(15, 23, 42, 0.3);
}

.onu-page-ellipsis {
  min-width: 24px;
  text-align: center;
  color: #64748b;
  font-size: 0.85rem;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.onu-pagination-jump {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-left: 8px;
}

.onu-jump-input {
  width: 58px;
  height: 32px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  text-align: center;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}

.onu-jump-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.onu-jump-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.onu-jump-btn:hover {
  background: rgba(56, 189, 248, 0.28);
  color: #fff;
}

/* ===================================================================== */
/* BOTÃO SELETOR DE TEMAS (DARK / LIGHT TOGGLE)                          */
/* ===================================================================== */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  user-select: none;
  font-family: inherit;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: rgba(51, 65, 85, 0.85);
  color: #ffffff;
  border-color: var(--brand-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.theme-toggle-btn .theme-icon {
  font-size: 1rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.35s ease;
}

.theme-toggle-btn:hover .theme-icon {
  transform: rotate(20deg) scale(1.15);
}

.theme-toggle-btn.login-theme-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 50;
}

@media (max-width: 640px) {
  .theme-toggle-btn .theme-label {
    display: none;
  }
  .theme-toggle-btn {
    padding: 6px 10px;
  }
}

.hero-subtitle {
  font-size: 0.85rem;
  color: #bae6fd;
  margin-top: 4px;
  line-height: 1.45;
}

.hero-subtitle.mint {
  color: #a7f3d0;
}

/* ===================================================================== */
/* TEMA CLARO (LIGHT THEME) - FUNDO BRANCO COM LETRAS ESCURAS           */
/* ===================================================================== */

[data-theme="light"] .hero-subtitle,
[data-theme="light"] .hero-subtitle.mint {
  color: #475569 !important;
}

[data-theme="light"] body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  background-image: 
    radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(14, 165, 233, 0.02) 0px, transparent 100%) !important;
}

[data-theme="light"] .dashboard-layout {
  background-color: #f8fafc !important;
}

[data-theme="light"] .main-content-wrapper {
  background-color: #f8fafc !important;
  scrollbar-color: rgba(203, 213, 225, 0.8) transparent;
}

/* Sidebar */
[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-right: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .sidebar-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .sidebar-brand-title {
  color: #0f172a !important;
}

[data-theme="light"] .sidebar-section-label {
  color: #64748b !important;
}

[data-theme="light"] .sidebar-nav-item {
  color: #475569 !important;
}

[data-theme="light"] .sidebar-nav-item:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .sidebar-nav-item.active {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.12), rgba(2, 132, 199, 0.02)) !important;
  color: #0284c7 !important;
  border-left-color: #0284c7 !important;
}

[data-theme="light"] .sidebar-counter-badge {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-color: #bae6fd !important;
}

[data-theme="light"] .sidebar-counter-badge.warn {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
}

[data-theme="light"] .sidebar-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .user-name {
  color: #0f172a !important;
}

[data-theme="light"] .user-role-tag {
  color: #64748b !important;
}

[data-theme="light"] .user-avatar {
  background: #e0f2fe !important;
  color: #0284c7 !important;
}

[data-theme="light"] .logout-btn {
  background: #fef2f2 !important;
  color: #ef4444 !important;
  border: 1px solid #fecaca !important;
}

[data-theme="light"] .logout-btn:hover {
  background: #fee2e2 !important;
  color: #dc2626 !important;
}

/* Topbar */
[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .olt-selector-wrapper select {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .live-status-pill {
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  color: #15803d !important;
}

[data-theme="light"] .topbar-refresh-btn {
  color: #059669 !important;
}

[data-theme="light"] .topbar-refresh-btn:hover {
  background: rgba(5, 150, 105, 0.1) !important;
  color: #047857 !important;
}

[data-theme="light"] .search-bar {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .search-bar:hover,
[data-theme="light"] .search-bar:focus-within {
  border-color: #0284c7 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15) !important;
  background: #ffffff !important;
}

[data-theme="light"] .search-bar input {
  color: #0f172a !important;
}

[data-theme="light"] .search-bar input::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] .search-kbd {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border-color: #e2e8f0 !important;
}

/* Theme Toggle Button in Light Mode */
[data-theme="light"] .theme-toggle-btn {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: #f1f5f9 !important;
  border-color: #0284c7 !important;
  color: #0f172a !important;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.18) !important;
}

/* Glass Panels & Cards */
[data-theme="light"] .glass-panel {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .glass-panel:hover {
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .section-title-group h2,
[data-theme="light"] .section-title,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 {
  color: #0f172a !important;
}

[data-theme="light"] .section-subtitle {
  color: #64748b !important;
}

/* KPI Cards */
[data-theme="light"] .kpi-card.blue {
  background: #f0f9ff !important;
  border-color: #bae6fd !important;
}
[data-theme="light"] .kpi-card.blue .kpi-main-value {
  color: #0284c7 !important;
}

[data-theme="light"] .kpi-card.green {
  background: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
}
[data-theme="light"] .kpi-card.green .kpi-main-value {
  color: #16a34a !important;
}

[data-theme="light"] .kpi-card.graphite {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}
[data-theme="light"] .kpi-card.graphite .kpi-main-value {
  color: #dc2626 !important;
}

[data-theme="light"] .kpi-card.orange {
  background: #fffbeb !important;
  border-color: #fde68a !important;
}
[data-theme="light"] .kpi-card.orange .kpi-main-value {
  color: #d97706 !important;
}

[data-theme="light"] .kpi-title {
  color: #475569 !important;
}

[data-theme="light"] .kpi-sub-breakdown {
  border-top-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .kpi-mini-meter {
  background: rgba(0, 0, 0, 0.08) !important;
}

/* Toolbar de Filtros ONU */
[data-theme="light"] .onu-filter-toolbar {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .onu-pill-btn {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

[data-theme="light"] .onu-pill-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .onu-pill-btn.active {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

[data-theme="light"] .onu-pill-btn.green.active {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #15803d !important;
}

[data-theme="light"] .onu-pill-btn.red.active {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #b91c1c !important;
}

[data-theme="light"] .onu-pill-btn.amber.active {
  background: #fef3c7 !important;
  border-color: #d97706 !important;
  color: #b45309 !important;
}

/* Tabelas */
[data-theme="light"] .data-table th,
[data-theme="light"] .olt-list-table th,
[data-theme="light"] .audit-list-table th {
  background: #f8fafc !important;
  color: #475569 !important;
  border-bottom: 2px solid #e2e8f0 !important;
}

[data-theme="light"] .data-table td,
[data-theme="light"] .olt-list-table td,
[data-theme="light"] .audit-list-table td {
  color: #1e293b !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .data-table tr:hover td,
[data-theme="light"] .olt-list-table tr:hover td,
[data-theme="light"] .audit-list-table tr:hover td {
  background: #f8fafc !important;
}

[data-theme="light"] .data-table tr strong {
  color: #0f172a !important;
}

[data-theme="light"] .sn-code {
  color: #0284c7 !important;
  font-weight: 700 !important;
}

/* Badges Sub-Tag */
[data-theme="light"] .sub-tag.blue { background: #e0f2fe !important; color: #0369a1 !important; }
[data-theme="light"] .sub-tag.green { background: #dcfce7 !important; color: #15803d !important; }
[data-theme="light"] .sub-tag.orange { background: #fef3c7 !important; color: #b45309 !important; }
[data-theme="light"] .sub-tag.red { background: #fee2e2 !important; color: #b91c1c !important; }
[data-theme="light"] .sub-tag.slate { background: #f1f5f9 !important; color: #475569 !important; }

/* Botões Pequenos e Ações */
[data-theme="light"] .btn-small {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light"] .btn-small:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* Modais */
[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.45) !important;
}

[data-theme="light"] .modal-content {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.18) !important;
  color: #0f172a !important;
}

[data-theme="light"] .modal-header {
  border-bottom: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}

[data-theme="light"] .modal-header h3 {
  color: #0f172a !important;
}

[data-theme="light"] .modal-close {
  color: #64748b !important;
}

[data-theme="light"] .modal-close:hover {
  color: #0f172a !important;
}

[data-theme="light"] .modal-body {
  background: #ffffff !important;
  color: #1e293b !important;
}

[data-theme="light"] .modal-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

/* Formulários */
[data-theme="light"] .form-group label {
  color: #334155 !important;
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea,
[data-theme="light"] input[type="text"]:not(.search-bar input),
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] select {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group select:focus,
[data-theme="light"] .form-group textarea:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* OLT Cards */
[data-theme="light"] .olt-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

/* Paginação */
[data-theme="light"] .onu-pagination-bar {
  border-top-color: #e2e8f0 !important;
}

[data-theme="light"] .onu-pagination-info {
  color: #64748b !important;
}

[data-theme="light"] .onu-pagination-info strong {
  color: #0f172a !important;
}

[data-theme="light"] .onu-page-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light"] .onu-page-btn:hover:not(:disabled):not(.active) {
  background: #f1f5f9 !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

[data-theme="light"] .onu-page-btn.active {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
}

[data-theme="light"] .onu-jump-input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .onu-jump-btn {
  background: #e0f2fe !important;
  border: 1px solid #bae6fd !important;
  color: #0284c7 !important;
}

/* VPS / Hardware Telemetry Cards */
[data-theme="light"] .vps-kpi-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .vps-bar-track {
  background: #e2e8f0 !important;
}

[data-theme="light"] .vps-spec-row {
  border-bottom-color: #f1f5f9 !important;
}

[data-theme="light"] .vps-spec-val {
  color: #0f172a !important;
}

/* Gráfico SLA Controls & Tooltips */
[data-theme="light"] .chart-controls {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .time-btn {
  color: #475569 !important;
}

[data-theme="light"] .time-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
}

[data-theme="light"] .timeline-tooltip {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

/* Login Screen */
[data-theme="light"] .login-left-panel {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
  border-right: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .login-left-panel h1,
[data-theme="light"] .login-left-panel h2 {
  color: #0f172a !important;
}

[data-theme="light"] .login-form-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .login-title {
  color: #0f172a !important;
}

[data-theme="light"] .login-form-card label {
  color: #334155 !important;
}

/* Preservação de Contraste em Botões Primários e Badges Coloridas */
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-primary *,
[data-theme="light"] .sidebar-brand-icon svg,
[data-theme="light"] .status-tag,
[data-theme="light"] #csvProgressBar,
[data-theme="light"] .invoice-badge-status {
  color: #ffffff !important;
}

/* Terminal CLI escuro e autêntico */
[data-theme="light"] .terminal-box {
  background: #090d16 !important;
  border-color: #1e293b !important;
  color: #38bdf8 !important;
}

/* Overrides gerais para elementos com estilos inline escuros e claros sem contraste */
[data-theme="light"] [style*="color: #fff"]:not(.btn-primary):not(.btn-primary *):not(.status-tag):not(.sub-tag):not(#csvProgressBar):not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color:#fff"]:not(.btn-primary):not(.btn-primary *):not(.status-tag):not(.sub-tag):not(#csvProgressBar):not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color: #ffffff"]:not(.btn-primary):not(.btn-primary *):not(.status-tag):not(.sub-tag):not(#csvProgressBar):not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color:#ffffff"]:not(.btn-primary):not(.btn-primary *):not(.status-tag):not(.sub-tag):not(#csvProgressBar):not(.terminal-log-box *):not(.terminal-box *) {
  color: #0f172a !important;
}

[data-theme="light"] [style*="color: #f1f5f9"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color:#f1f5f9"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color: #f8fafc"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color:#f8fafc"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color: #e2e8f0"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color:#e2e8f0"]:not(.terminal-log-box *):not(.terminal-box *) {
  color: #0f172a !important;
}

[data-theme="light"] [style*="color: #cbd5e1"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color:#cbd5e1"]:not(.terminal-log-box *):not(.terminal-box *) {
  color: #334155 !important;
}

[data-theme="light"] [style*="color: #bae6fd"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color:#bae6fd"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color: #93c5fd"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color:#93c5fd"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color: #a7f3d0"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color:#a7f3d0"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color: #6ee7b7"]:not(.terminal-log-box *):not(.terminal-box *),
[data-theme="light"] [style*="color:#6ee7b7"]:not(.terminal-log-box *):not(.terminal-box *) {
  color: #475569 !important;
}

[data-theme="light"] h2[style*="color: #38bdf8"],
[data-theme="light"] h2[style*="color:#38bdf8"],
[data-theme="light"] h3[style*="color: #38bdf8"],
[data-theme="light"] h3[style*="color:#38bdf8"] {
  color: #0284c7 !important;
}

[data-theme="light"] h2[style*="color: #34d399"],
[data-theme="light"] h2[style*="color:#34d399"],
[data-theme="light"] h3[style*="color: #34d399"],
[data-theme="light"] h3[style*="color:#34d399"] {
  color: #059669 !important;
}

[data-theme="light"] .olt-name,
[data-theme="light"] .stat-val {
  color: #0f172a !important;
}

/* Tabelas com alta legibilidade no Tema Claro */
[data-theme="light"] .data-table td div:not(.terminal-box):not(.terminal-log-box *),
[data-theme="light"] .olt-list-table td div:not(.terminal-box):not(.terminal-log-box *),
[data-theme="light"] .audit-list-table td div:not(.terminal-box):not(.terminal-log-box *),
[data-theme="light"] table td div:not(.terminal-box):not(.terminal-log-box *) {
  color: #0f172a !important;
}

[data-theme="light"] .data-table td span:not(.live-status-pill):not(.pulse-dot):not(.vendor-logo):not(.badge):not(.audit-badge):not(.sub-tag):not(.status-tag):not(.invoice-badge-status):not(.btn-small):not(.terminal-box *):not(.terminal-log-box *),
[data-theme="light"] .olt-list-table td span:not(.live-status-pill):not(.pulse-dot):not(.vendor-logo):not(.badge):not(.audit-badge):not(.sub-tag):not(.status-tag):not(.invoice-badge-status):not(.btn-small):not(.terminal-box *):not(.terminal-log-box *),
[data-theme="light"] .audit-list-table td span:not(.live-status-pill):not(.pulse-dot):not(.vendor-logo):not(.badge):not(.audit-badge):not(.sub-tag):not(.status-tag):not(.invoice-badge-status):not(.btn-small):not(.terminal-box *):not(.terminal-log-box *),
[data-theme="light"] table td span:not(.live-status-pill):not(.pulse-dot):not(.vendor-logo):not(.badge):not(.audit-badge):not(.sub-tag):not(.status-tag):not(.invoice-badge-status):not(.btn-small):not(.terminal-box *):not(.terminal-log-box *) {
  color: #334155 !important;
}

/* Badges e tags de Auditoria no Tema Claro */
[data-theme="light"] .audit-badge {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}
[data-theme="light"] .audit-badge.olt {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
}
[data-theme="light"] .audit-badge.sistema {
  background: #f0fdf4 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}
[data-theme="light"] .audit-badge.financeiro {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}
[data-theme="light"] .audit-badge.backup {
  background: #f5f3ff !important;
  color: #6d28d9 !important;
  border: 1px solid #ddd6fe !important;
}

[data-theme="light"] .audit-row td span[style*="color: #38bdf8"],
[data-theme="light"] .audit-row td span[style*="color:#38bdf8"] {
  color: #0284c7 !important;
  background: #e0f2fe !important;
  border-color: #bae6fd !important;
}

/* Vendor badges com contraste perfeito no tema claro */
[data-theme="light"] .vendor-logo {
  background: #f1f5f9 !important;
  border-width: 1px !important;
  border-style: solid !important;
  font-weight: 700 !important;
}
[data-theme="light"] .vendor-huawei { border-color: #fca5a5 !important; color: #dc2626 !important; background: #fef2f2 !important; }
[data-theme="light"] .vendor-zte { border-color: #bae6fd !important; color: #0284c7 !important; background: #f0f9ff !important; }
[data-theme="light"] .vendor-fiberhome { border-color: #bbf7d0 !important; color: #16a34a !important; background: #f0fdf4 !important; }
[data-theme="light"] .vendor-vsol { border-color: #fde68a !important; color: #d97706 !important; background: #fffbeb !important; }
[data-theme="light"] .vendor-intelbras { border-color: #bbf7d0 !important; color: #15803d !important; background: #f0fdf4 !important; }
[data-theme="light"] .vendor-nokia { border-color: #bae6fd !important; color: #0369a1 !important; background: #f0f9ff !important; }
[data-theme="light"] .vendor-datacom { border-color: #c7d2fe !important; color: #4f46e5 !important; background: #eef2ff !important; }
[data-theme="light"] .vendor-bdcom { border-color: #fbcfe8 !important; color: #db2777 !important; background: #fdf2f8 !important; }
[data-theme="light"] .vendor-cdata { border-color: #99f6e4 !important; color: #0d9488 !important; background: #f0fdfa !important; }
[data-theme="light"] .vendor-parks { border-color: #ddd6fe !important; color: #7c3aed !important; background: #f5f3ff !important; }

/* Hero panels no tema claro com gradiente sutil de alta legibilidade */
[data-theme="light"] .glass-panel[style*="linear-gradient"] {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.05), #ffffff) !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] [style*="background: #0f172a"]:not(.terminal-log-box):not(.terminal-box),
[data-theme="light"] [style*="background:#0f172a"]:not(.terminal-log-box):not(.terminal-box),
[data-theme="light"] [style*="background: rgba(15, 23, 42"]:not(.terminal-log-box):not(.terminal-box),
[data-theme="light"] [style*="background:rgba(15, 23, 42"]:not(.terminal-log-box):not(.terminal-box),
[data-theme="light"] [style*="background: rgba(11, 15, 25"]:not(.terminal-log-box):not(.terminal-box),
[data-theme="light"] [style*="background:rgba(11, 15, 25"]:not(.terminal-log-box):not(.terminal-box),
[data-theme="light"] [style*="background: #1e293b"]:not(.terminal-log-box):not(.terminal-box),
[data-theme="light"] [style*="background:#1e293b"]:not(.terminal-log-box):not(.terminal-box) {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

/* Animação do Indicador de Varredura de Autofind */
.scan-pulse-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulse-beacon 1.2s infinite ease-in-out;
}

@keyframes pulse-beacon {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 4px #38bdf8;
    opacity: 0.8;
  }
  50% {
    transform: scale(1.35);
    box-shadow: 0 0 14px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.5);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 4px #38bdf8;
    opacity: 0.8;
  }
}

/* ==========================================================================
   ESTILOS DO BOT TELEGRAM DO TÉCNICO & SIMULADOR DE CHAT
   ========================================================================== */

.tg-bot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.tg-bubble {
  position: relative;
  font-size: 0.84rem;
  line-height: 1.45;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  word-wrap: break-word;
}

.tg-bubble-user {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border-radius: 14px 14px 2px 14px;
  max-width: 82%;
  padding: 10px 14px;
}

.tg-bubble-bot {
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 14px 14px 14px 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 100%;
  padding: 12px 16px;
}

.tg-msg-time {
  font-size: 0.68rem;
  opacity: 0.7;
  margin-top: 6px;
  text-align: right;
}

.tg-inline-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.tg-keyboard-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tg-inline-btn {
  flex: 1 1 auto;
  min-width: 120px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.tg-inline-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.2);
}

.tg-code-block {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 6px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  overflow-x: auto;
  white-space: pre-wrap;
  color: #38bdf8;
}

.tg-inline-code {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 2px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  color: #38bdf8;
}

/* Regras de Alto Contraste no Tema Claro */
[data-theme="light"] #tgSimulatorMessages {
  background: #f1f5f9 !important;
}

[data-theme="light"] .tg-bubble-bot {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .tg-bubble-bot strong {
  color: #0369a1 !important;
}

[data-theme="light"] .tg-inline-keyboard {
  border-top-color: #e2e8f0 !important;
}

[data-theme="light"] .tg-inline-btn {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  color: #0369a1 !important;
}

[data-theme="light"] .tg-inline-btn:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25) !important;
}

[data-theme="light"] .tg-code-block {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .tg-inline-code {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #0369a1 !important;
}

[data-theme="light"] #tgSimulatorInput {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] #tgSimulatorInput::placeholder {
  color: #94a3b8 !important;
}

/* ===================================================================== */
/* CONFIGURAÇÃO DE PORTA ETHERNET DA ONU (MODAL EDITAR ONU)              */
/* ===================================================================== */
.eth-port-config-box {
  margin-top: 14px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .eth-port-config-box {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-eth-pill {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Fira Code', monospace;
}

.btn-eth-pill:hover {
  border-color: #38bdf8;
  color: #f8fafc;
  background: rgba(56, 189, 248, 0.1);
}

.btn-eth-pill.active {
  background: rgba(14, 165, 233, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

[data-theme="light"] .btn-eth-pill {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="light"] .btn-eth-pill.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0284c7;
}

.eth-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.9rem;
  margin: 0;
  color: #e2e8f0;
  user-select: none;
  transition: color 0.15s ease;
}

.eth-radio-label:hover {
  color: #38bdf8;
}

.eth-radio-label input[type="radio"] {
  cursor: pointer;
  accent-color: #0ea5e9;
  width: 15px;
  height: 15px;
  margin: 0;
}

[data-theme="light"] .eth-radio-label {
  color: #1e293b;
}

.eth-field-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  margin-bottom: 14px;
}

.eth-field-title {
  font-weight: 700;
  color: #f8fafc;
  font-size: 0.92rem;
  margin: 0;
}

[data-theme="light"] .eth-field-title {
  color: #0f172a;
}

/* ==========================================================================
   NOTIFICAÇÕES IN-APP & CENTRAL DE SUPORTE
   ========================================================================== */

.notifications-bell-btn {
  position: relative;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notifications-bell-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  transform: translateY(-1px);
}

.notifications-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  text-align: center;
  padding: 0 4px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
  animation: notifPulse 2s infinite ease-in-out;
}

@keyframes notifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.notifications-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-width: 90vw;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 1050;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: notifDropIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes notifDropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notifications-dropdown-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(30, 41, 59, 0.4);
}

.notif-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-header-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 12px;
}

.notif-mark-read-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

.notif-mark-read-btn:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.notifications-dropdown-body {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}

.notif-item:hover {
  background: rgba(56, 189, 248, 0.08);
}

.notif-item.unread {
  background: rgba(56, 189, 248, 0.05);
  border-left: 3px solid #38bdf8;
}

.notif-icon-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 1rem;
}

.notif-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-item-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #f1f5f9;
}

.notif-item-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.35;
}

.notif-item-time {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 4px;
}

.notif-empty-state {
  padding: 36px 20px;
  text-align: center;
  color: #64748b;
  font-size: 0.84rem;
}

/* Toast de Alerta In-App Flutuante */
.in-app-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.in-app-toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 4px solid #38bdf8;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.in-app-toast:hover {
  transform: translateY(-2px);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Painel da Central de Suporte & Chamados */
.ticket-chat-container {
  display: flex;
  flex-direction: column;
  height: 520px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
}

.ticket-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-bubble.tenant {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.chat-bubble.owner {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(14, 165, 233, 0.45);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-bubble-author {
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-bubble.tenant .chat-bubble-author {
  color: #38bdf8;
}

.chat-bubble.owner .chat-bubble-author {
  color: #fbbf24;
}

.chat-bubble-time {
  font-size: 0.68rem;
  color: #94a3b8;
  align-self: flex-end;
  margin-top: 2px;
}

.ticket-chat-input-area {
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ticket-chat-textarea {
  flex: 1;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #f8fafc;
  padding: 10px 14px;
  font-size: 0.88rem;
  resize: none;
  outline: none;
  min-height: 42px;
  max-height: 120px;
  font-family: inherit;
}

.ticket-chat-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Light Theme Adjustments */
[data-theme="light"] .notifications-bell-btn {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .notifications-dropdown {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .notifications-dropdown-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .notif-header-title span {
  color: #0f172a !important;
}

[data-theme="light"] .notif-item {
  border-bottom-color: #f1f5f9;
}

[data-theme="light"] .notif-item-title {
  color: #0f172a;
}

[data-theme="light"] .notif-item:hover {
  background: #f8fafc;
}

[data-theme="light"] .in-app-toast {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .ticket-chat-container {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .chat-bubble.tenant {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .chat-bubble.owner {
  background: #f0fdf4;
  border-color: #86efac;
  color: #0f172a;
}

/* ==========================================================================
   MANUAIS, ATUALIZAÇÕES & COMUNIDADE (KNOWLEDGE & FORUM)
   ========================================================================== */
.knowledge-nav-pill {
  background: rgba(30, 41, 59, 0.6);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.knowledge-nav-pill:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.3);
}

.knowledge-nav-pill.active {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #ffffff;
  border-color: #8b5cf6;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.knowledge-article-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.knowledge-article-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(139, 92, 246, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.knowledge-article-card.active {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.12);
  box-shadow: 0 0 0 1px #8b5cf6;
}

.knowledge-article-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
}

.knowledge-article-card-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-article-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 4px;
}

/* Leitor de Markdown & Comandos */
.knowledge-markdown-body h1,
.knowledge-markdown-body h2,
.knowledge-markdown-body h3 {
  color: #f8fafc;
  margin-top: 1.4rem;
  margin-bottom: 0.6rem;
}

.knowledge-markdown-body h1 { font-size: 1.4rem; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 6px; }
.knowledge-markdown-body h2 { font-size: 1.15rem; color: #a78bfa; }
.knowledge-markdown-body h3 { font-size: 1.0rem; color: #38bdf8; }

.knowledge-markdown-body p {
  margin: 0.6rem 0;
  line-height: 1.6;
}

.knowledge-markdown-body ul, 
.knowledge-markdown-body ol {
  padding-left: 20px;
  margin: 0.6rem 0;
}

.knowledge-markdown-body li {
  margin-bottom: 4px;
}

.knowledge-markdown-body pre {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.84rem;
  color: #38bdf8;
  position: relative;
  margin: 12px 0;
}

.knowledge-markdown-body code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  padding: 2px 6px;
  border-radius: 4px;
}

.knowledge-markdown-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.knowledge-markdown-body blockquote {
  border-left: 4px solid #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
  padding: 10px 16px;
  margin: 12px 0;
  border-radius: 0 8px 8px 0;
  color: #cbd5e1;
}

/* Mural de Atualizações (Changelog) */
.changelog-timeline-item {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid rgba(139, 92, 246, 0.3);
}

.changelog-timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8b5cf6;
  border: 2px solid #0f172a;
}

.changelog-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.changelog-version-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.changelog-badge-major {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
}

.changelog-badge-minor {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
}

.changelog-badge-patch {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
}

/* Fórum da Comunidade */
.forum-topic-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forum-topic-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(139, 92, 246, 0.35);
  transform: translateY(-1px);
}

.forum-topic-card.active {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.12);
  box-shadow: 0 0 0 1px #8b5cf6;
}

.forum-topic-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc;
}

.forum-topic-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748b;
}

.forum-reply-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forum-reply-card.is-solution {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

/* Suporte a Tema Claro para Fórum e Manuais */
[data-theme="light"] .knowledge-nav-pill {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

[data-theme="light"] .knowledge-nav-pill:hover {
  background: #ede9fe;
  color: #6d28d9;
}

[data-theme="light"] .knowledge-nav-pill.active {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #ffffff;
}

[data-theme="light"] .knowledge-article-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .knowledge-article-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .knowledge-article-card-title {
  color: #0f172a;
}

[data-theme="light"] .knowledge-article-card-desc {
  color: #64748b;
}

[data-theme="light"] .knowledge-markdown-body h1,
[data-theme="light"] .knowledge-markdown-body h2,
[data-theme="light"] .knowledge-markdown-body h3 {
  color: #0f172a;
}

[data-theme="light"] .knowledge-markdown-body pre {
  background: #0f172a;
  color: #38bdf8;
}

[data-theme="light"] .changelog-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .forum-topic-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .forum-topic-card-title {
  color: #0f172a;
}

[data-theme="light"] .forum-reply-card {
  background: #ffffff;
  border-color: #e2e8f0;
}



