:root {
  --bg: #080d14;
  --panel: #111926;
  --panel-strong: #152033;
  --panel-soft: #0d1521;
  --border: #243247;
  --text: #e5edf7;
  --muted: #8fa1b7;
  --muted-2: #607188;
  --accent: #36c5f0;
  --accent-2: #00e09d;
  --warning: #f2b84b;
  --danger: #ff5c7a;
  --purple: #8b7cf6;
  --orange: #ff9f43;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% -10%, rgba(54, 197, 240, 0.14), transparent 34rem),
    linear-gradient(145deg, #060a10 0%, #09111c 48%, #070b12 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--border);
  background: rgba(10, 16, 25, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 22px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(54, 197, 240, 0.45);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(54, 197, 240, 0.24), rgba(0, 224, 157, 0.14));
  color: #dffaff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand h1,
.brand span,
.topbar h2,
.panel h3,
.metric-card strong,
.metric-card span,
.metric-card small,
.sidebar-footer strong,
.sidebar-footer small {
  margin: 0;
}

.brand h1 {
  font-size: 0.98rem;
  line-height: 1.1;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-menu {
  display: grid;
  gap: 8px;
  padding: 24px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(54, 197, 240, 0.32);
  background: rgba(54, 197, 240, 0.08);
  color: var(--text);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.sidebar-footer small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 20px rgba(0, 224, 157, 0.8);
}

.main-content {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h2 {
  margin-top: 3px;
  font-size: clamp(1.35rem, 2.5vw, 2.2rem);
  line-height: 1.08;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(17, 25, 38, 0.78);
  color: var(--muted);
  font-size: 0.78rem;
}

.pill-ok {
  border-color: rgba(0, 224, 157, 0.4);
  color: #8ffadd;
}

.pill-warning {
  border-color: rgba(242, 184, 75, 0.42);
  color: #ffe1a0;
}

.pill-danger {
  border-color: rgba(255, 92, 122, 0.48);
  color: #ffafbe;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 42%),
    rgba(17, 25, 38, 0.88);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 116px;
  padding: 18px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card span {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 2rem;
  line-height: 1;
}

.metric-card small {
  font-size: 0.78rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  min-height: 290px;
  padding: 16px;
}

.panel-wide,
.panel-map {
  grid-column: span 1;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h3 {
  margin-top: 3px;
  font-size: 1rem;
}

.panel-value {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.world-map {
  height: 462px;
  overflow: hidden;
  border: 1px solid #1f2c3f;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 35%, rgba(54, 197, 240, 0.1), transparent 20rem),
    #07101d;
}

.leaflet-container {
  background: #08101b;
  color: var(--text);
  font: inherit;
}

.leaflet-tile {
  filter: brightness(0.92) contrast(1.12) saturate(1.08);
  opacity: 0.9 !important;
}

.leaflet-overlay-pane {
  z-index: 450;
}

.geo-marker {
  filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 18px rgba(255, 255, 255, 0.1));
  stroke: rgba(9, 13, 20, 0.92);
  stroke-width: 2.5px;
}

.geo-label {
  border: 1px solid rgba(54, 197, 240, 0.42) !important;
  border-radius: 999px !important;
  background: rgba(4, 10, 18, 0.88) !important;
  box-shadow: 0 0 18px rgba(54, 197, 240, 0.18);
  color: #e8f8ff !important;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}

.geo-label::before {
  display: none;
}

.map-legend {
  display: grid;
  gap: 7px;
  min-width: 126px;
  padding: 11px 12px;
  border: 1px solid rgba(54, 197, 240, 0.18);
  border-radius: 6px;
  background: rgba(11, 20, 33, 0.88);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  color: #d9e8f5;
  font-size: 0.76rem;
}

.map-legend strong {
  margin-bottom: 2px;
  color: #e8f2ff;
  font-size: 0.78rem;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-legend i {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  box-shadow: 0 0 10px currentColor;
}

.leaflet-control-attribution {
  background: rgba(8, 13, 20, 0.78) !important;
  color: var(--muted) !important;
}

.leaflet-control-attribution a {
  color: var(--accent) !important;
}

.map-popup {
  color: #101820;
}

.map-popup strong {
  display: block;
  margin-bottom: 3px;
}

.gauge-wrap {
  position: relative;
  display: grid;
  min-height: 210px;
  place-items: center;
}

.gauge {
  width: min(100%, 260px);
  overflow: visible;
}

.gauge-bg,
.gauge-arc {
  fill: none;
  stroke-linecap: round;
  stroke-width: 18;
}

.gauge-bg {
  stroke: #25344a;
}

.gauge-arc {
  stroke: url("#gaugeGradient");
  stroke: var(--accent-2);
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  filter: drop-shadow(0 0 12px rgba(0, 224, 157, 0.52));
  transition: stroke-dashoffset 700ms ease;
}

.gauge-number {
  position: absolute;
  top: 54%;
  left: 50%;
  display: grid;
  gap: 4px;
  text-align: center;
  transform: translate(-50%, -50%);
}

.gauge-number strong {
  font-size: 2.35rem;
  line-height: 1;
}

.gauge-number span {
  color: var(--muted);
  font-size: 0.8rem;
}

.bar-list,
.rank-list,
.intel-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.bar-name,
.rank-ip {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #243247;
}

.bar-fill {
  width: var(--bar-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--accent));
  box-shadow: 0 0 18px color-mix(in srgb, var(--bar-color, var(--accent)), transparent 62%);
}

.rank-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px;
  border: 1px solid #223046;
  border-radius: 8px;
  background: rgba(13, 21, 33, 0.72);
}

.rank-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: rgba(54, 197, 240, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.rank-meta {
  min-width: 0;
}

.rank-sub {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  color: var(--text);
  font-weight: 800;
}

.intel-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #223046;
  border-radius: 8px;
  background: rgba(13, 21, 33, 0.72);
}

.intel-topline,
.intel-tags {
  display: flex;
  align-items: center;
  gap: 8px;
}

.intel-topline {
  justify-content: space-between;
}

.intel-ip {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intel-tags {
  flex-wrap: wrap;
}

.intel-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(54, 197, 240, 0.24);
  border-radius: 999px;
  background: rgba(54, 197, 240, 0.08);
  color: #bdefff;
  font-size: 0.72rem;
  font-weight: 750;
}

.intel-tag.danger {
  border-color: rgba(255, 92, 122, 0.35);
  background: rgba(255, 92, 122, 0.1);
  color: #ffbac6;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #223046;
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #223046;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #101827;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #d5e0ee;
  font-size: 0.86rem;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 92, 122, 0.12);
  color: #ffafbe;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

#timelineChart {
  width: 100%;
  height: 220px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

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

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .main-content {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .world-map {
    height: 360px;
  }
}


/* SOC Dashboard v3 Compact */
.sidebar{width:180px}
.world-map{height:320px!important}
.panel{padding:12px}
.table-wrap{max-height:320px;overflow:auto}
.rank-list,.intel-list,.bar-list{max-height:320px;overflow:auto}


/* SOC Dashboard v3.1 Enterprise */
.world-map{height:300px!important;}
.sidebar{width:180px!important;}
.panel{padding:10px!important;}
.rank-list,.intel-list,.bar-list,.table-wrap{
max-height:300px;
overflow:auto;
}
