* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}
.chart-section {
  margin: 24px 0;
}

.chart-card {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 16px;
  height: 360px;
}

#domainIpChart {
  width: 100%;
  height: 100%;
}

.site-header {
  padding: 22px 32px;
  background: #020617;
  border-bottom: 1px solid #1e293b;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  width: 52px;
  height: auto;
  object-fit: contain;
}

h1 {
  margin: 0;
  font-size: 30px;
}

.tagline {
  color: #93c5fd;
  font-weight: 600;
  margin: 4px 0 0;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  gap: 10px;
  padding: 12px 32px;
  background: rgba(2, 6, 23, 0.96);
  border-bottom: 1px solid #1e293b;
  backdrop-filter: blur(8px);
}

.tabs a {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 999px;
  background: #0f172a;
  border: 1px solid #1e293b;
}

.tabs a:hover {
  background: #2563eb;
  border-color: #2563eb;
}

main {
  padding: 24px 32px;
}

.tab-section {
  scroll-margin-top: 90px;
  margin-bottom: 28px;
}

.search-card {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
}

input,
select,
button {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 12px;
  background: #020617;
  color: #e5e7eb;
  font-size: 15px;
}

input {
  min-width: 320px;
}

button {
  cursor: pointer;
  background: #2563eb;
  border-color: #2563eb;
  font-weight: 600;
}

button:hover {
  background: #1d4ed8;
}


.stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-card {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 14px 18px;
  min-width: 160px;
}

.label {
  display: block;
  color: #94a3b8;
  font-size: 13px;
}

.value {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 700;
}

.alerts-section {
    margin-top: 24px;      /* Space below stats */
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 16px;
}

.alerts-section h2 {
  margin-top: 0;
}

.alerts-list {
  display: grid;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 12px;
  background: #111827;
}

.alert-card {
  background: #2a1111;
  border: 1px solid #7f1d1d;
  border-radius: 12px;
  padding: 14px;
}

.alert-card strong {
  color: #fecaca;
}

.alert-card code {
  color: #bfdbfe;
}

.alerts-list::-webkit-scrollbar,
.info-section::-webkit-scrollbar,
#detailsPanel::-webkit-scrollbar {
  width: 8px;
}

.alerts-list::-webkit-scrollbar-thumb,
.info-section::-webkit-scrollbar-thumb,
#detailsPanel::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

.content {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
}

#map {
  height: 620px;
  border-radius: 16px;
  border: 1px solid #1e293b;
  overflow: hidden;
}

#detailsPanel {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 18px;
  max-height: 620px;
  overflow: auto;
}

#detailsPanel h2 {
  margin-top: 0;
}

.muted {
  color: #94a3b8;
}

.detail-row {
  margin-bottom: 12px;
}

.detail-row strong {
  display: block;
  color: #93c5fd;
  margin-bottom: 4px;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-dns {
  background: #1e40af;
  color: #dbeafe;
}

.badge-direct {
  background: #991b1b;
  color: #fee2e2;
}

.table-section {
  margin-top: 22px;
}

.table-section h2 {
  margin-bottom: 10px;
}

.table-wrap {
    max-height: 700px;
    overflow-y: auto;
    overflow-x: auto;

    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #020617;
  min-width: 1200px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #1e293b;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #93c5fd;
  background: #0f172a;
  position: sticky;
  top: 0;
}

td {
  color: #e5e7eb;
}

.small-list {
  max-width: 260px;
  word-break: break-word;
}

.leaflet-popup-content {
  color: #111827;
}

.info-section {
  background: #d1d5db;
  color: #000;
  border-left: 5px solid #2563eb;
  padding: 18px 20px;
  margin: 22px 0;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  max-height: 720px;
  overflow-y: auto;
}

.info-section h2 {
  margin-top: 0;
  color: #1d4ed8;
  font-size: 1.35rem;
}

.info-section p {
  color: #000;
  line-height: 1.6;
}

.info-section details {
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(15,23,42,0.15);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0;
}

.info-section summary {
  cursor: pointer;
  font-weight: 800;
  color: #1e3a8a;
}

.info-section ul {
  margin: 10px 0 0 22px;
  padding: 0;
}

.info-section li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.support-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.support-btn img,
.popup-logo {
  height: 24px;
}

.support-popup {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 75px;
  z-index: 9999;
  width: 280px;
  padding: 18px;
  border-radius: 14px;
  background: white;
  color: #111827;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.close-popup {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.popup-support-btn {
  display: block;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .dashboard-grid,
  .content {
    grid-template-columns: 1fr;
  }

  #detailsPanel {
    max-height: none;
  }

  .tabs {
    overflow-x: auto;
  }
}
