/* Threat Landscape Visualization Dashboard — mockup styles.
 * Dark security-ops theme. No build step; plain CSS. */

:root {
  /* Surface palette (kept dark) */
  --bg: #0b0f17;
  --bg-2: #111725;
  --panel: #141b2b;
  --panel-2: #1a2336;
  --border: #243049;
  --text: #e6ecf5;
  --muted: #8a98b5;
  --dim: #5d6b8a;

  /* MalwarePatrol brand palette */
  --mp-blue-1: #06193e;   /* deep navy   */
  --mp-blue-2: #48529f;   /* indigo      */
  --mp-orange-1: #ed670e; /* orange      */
  --mp-orange-2: #faab4d; /* light orange*/
  --mp-gray: #89898b;     /* neutral     */
  --mp-blue-2-bright: #7a85d6; /* lifted indigo for UI accents on dark */

  /* Semantic accents mapped to brand */
  --accent: var(--mp-blue-2-bright);
  --accent-2: var(--mp-orange-1);
  --crit: var(--mp-orange-1);
  --high: var(--mp-orange-2);
  --med: var(--mp-blue-2-bright);
  --ok: #3ddc97;          /* status green (feeds live) */
  --radius: 12px;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.mono { font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; }
.dim { color: var(--dim); }
.ok { color: var(--ok); }

/* Layout ----------------------------------------------------------------- */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 4px 22px; }
.brand-logo { width: 30px; height: auto; flex-shrink: 0; }
.brand-name { font-weight: 600; letter-spacing: .2px; }
.brand-name b { color: var(--text); font-weight: 700; }
.brand-name span { color: var(--mp-orange-1); font-weight: 600; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  color: var(--muted); text-decoration: none; font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--text); }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { width: 18px; text-align: center; color: var(--dim); }

.sidebar-foot {
  margin-top: auto; padding: 10px 8px 0;
  color: var(--muted); font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-live { background: var(--ok); box-shadow: 0 0 0 3px rgba(61,220,151,.18); }

.main { padding: 24px 28px 40px; max-width: 1320px; }

/* Topbar ----------------------------------------------------------------- */
.topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 22px;
}
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: .2px; }
.subtitle { margin: 2px 0 0; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.updated { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* Cards ------------------------------------------------------------------ */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.card-label { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .6px; }
.card-value { font-size: 28px; font-weight: 650; margin: 6px 0 4px; }
.card-trend { font-size: 12.5px; color: var(--muted); }
.card-trend.up { color: var(--ok); }
.card-trend.warn { color: var(--high); }

/* Panels / grid ---------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 18px; }
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-tag { color: var(--dim); font-size: 12px; }

/* Bars ------------------------------------------------------------------- */
.bars { display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 56px; align-items: center; gap: 12px; }
.bar-label { color: var(--muted); font-size: 13px; }
.bar-track { background: var(--bg-2); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--mp-orange-1), var(--mp-orange-2)); }
.bar-value { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

/* Donut ------------------------------------------------------------------ */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut {
  width: 132px; height: 132px; border-radius: 50%;
  -webkit-mask: radial-gradient(circle 42px at center, transparent 98%, #000 100%);
          mask: radial-gradient(circle 42px at center, transparent 98%, #000 100%);
  flex-shrink: 0;
}
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; }
.legend li { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-pct { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }

/* Table ------------------------------------------------------------------ */
.threats { width: 100%; border-collapse: collapse; }
.threats th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 12px;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 0 12px 12px; border-bottom: 1px solid var(--border);
}
.threats td { padding: 13px 12px; border-bottom: 1px solid rgba(36,48,73,.5); }
.threats tbody tr:hover { background: var(--panel-2); }

.sev { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; }
.sev-critical { background: rgba(255,77,109,.15); color: var(--crit); }
.sev-high { background: rgba(255,159,28,.15); color: var(--high); }
.sev-medium { background: rgba(72,202,228,.15); color: var(--med); }

.conf { display: flex; align-items: center; gap: 8px; }
.conf-bar { width: 60px; height: 6px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.conf-fill { height: 100%; background: var(--mp-blue-2-bright); }

/* Section pages — data-driven card grid -------------------------------- */
.page-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }

.tile-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tile-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid rgba(36,48,73,.5);
}
.tile-list li:last-child { border-bottom: none; }
.tl-main { display: flex; flex-direction: column; gap: 2px; }
.tl-primary { color: var(--text); font-weight: 500; }
.tl-secondary { color: var(--muted); font-size: 12.5px; }
.tl-tag {
  font-size: 11.5px; color: var(--mp-orange-2);
  background: rgba(237,103,14,.13); padding: 3px 10px; border-radius: 6px;
  white-space: nowrap;
}

.foot { margin-top: 20px; color: var(--muted); font-size: 12.5px; }

/* Login page ----------------------------------------------------------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(72,82,159,.18), transparent),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-brand .brand-logo { width: 34px; }
.login-title { margin: 0; font-size: 20px; }
.login-sub { margin: 4px 0 22px; color: var(--muted); }
.login-error {
  background: rgba(237,103,14,.12); border: 1px solid rgba(237,103,14,.4);
  color: var(--mp-orange-2); border-radius: 9px;
  padding: 10px 13px; font-size: 13px; margin-bottom: 18px;
}
.login-form { display: flex; flex-direction: column; gap: 15px; }
.login-form label > span { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 9px; padding: 11px 13px; outline: none;
}
.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus { border-color: var(--accent); }
.login-remember {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px; cursor: pointer;
}
.login-remember input { accent-color: var(--mp-orange-1); }
.login-btn {
  margin-top: 4px; padding: 11px 16px; border: none; cursor: pointer;
  border-radius: 9px; font-size: 14px; font-weight: 600; color: #fff;
  background: var(--mp-orange-1); transition: filter .12s;
}
.login-btn:hover { filter: brightness(1.08); }
.login-foot { margin: 22px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

/* Sidebar user / logout ------------------------------------------------ */
.user-box {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-top: 1px solid var(--border); margin-top: 12px;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--mp-blue-2); color: #fff; font-weight: 600; font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-name { color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-logout { color: var(--muted); font-size: 12px; text-decoration: none; }
.user-logout:hover { color: var(--mp-orange-1); }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .page-grid { grid-template-columns: repeat(2, 1fr); }
  .span-3, .span-4 { grid-column: span 2; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; overflow-x: auto; }
  .nav { flex-direction: row; }
  .sidebar-foot { display: none; }
  .page-grid { grid-template-columns: 1fr; }
  .tile { grid-column: span 1 !important; }
}
