﻿:root {
  color-scheme: dark;
  --bg: #090c10;
  --panel: #11161c;
  --panel2: #171d24;
  --line: #2b333d;
  --text: #edf0f2;
  --muted: #8f99a4;
  --green: #7eb59d;
  --blue: #7699b1;
  --red: #c75b63;
  --amber: #d7a85d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, "Courier New", monospace; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand b {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--green);
  color: #07110e;
  font-size: 20px;
}

.brand span { font-size: 17px; font-weight: 750; }
.brand small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .14em; }

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 440px;
  align-items: center;
  gap: clamp(40px, 7vw, 110px);
  margin: auto;
  padding: 72px max(24px, calc((100vw - 1240px) / 2));
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url('/assets/portal-somt2-hero.png') center / cover no-repeat;
  animation: hero-settle 12s ease-out both;
}

.auth-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #080b0fe8 0%, #080b0fbd 43%, #080b0f8f 68%, #080b0fca 100%), linear-gradient(0deg, #080b0fd9, transparent 45%);
}

.auth-copy { position: relative; max-width: 690px; animation: rise-in .65s ease-out both; }
.auth-copy .brand { position: absolute; top: -36px; }
.auth-copy h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(44px, 5.2vw, 72px); font-weight: 500; letter-spacing: -.035em; line-height: .98; margin: 22px 0; }
.auth-copy > p:not(.eyebrow) { color: #b3bbc2; font-size: 17px; max-width: 580px; }

.auth-points { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 30px; color: #c5cbd0; font-size: 12px; }
.auth-points span { display: flex; align-items: center; gap: 8px; }
.auth-points i { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px #d7a85d99; }

.auth-card,
.panel {
  background: linear-gradient(145deg, #171d23f2, #10151bf2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 70px #0004;
}

.auth-card { backdrop-filter: blur(16px); animation: rise-in .65s .08s ease-out both; }

.auth-footer {
  position: absolute;
  left: max(24px, calc((100vw - 1240px) / 2));
  right: max(24px, calc((100vw - 1240px) / 2));
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: #7f898f;
  font-size: 11px;
  letter-spacing: .04em;
}

.auth-footer span + span { padding-left: 18px; border-left: 1px solid #4a4f50; }

.tabs {
  display: flex;
  background: #080d14;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.tabs button {
  flex: 1;
  background: transparent;
  color: var(--muted);
}

.tabs button.active {
  background: #1b293a;
  color: var(--text);
}

form { display: grid; gap: 14px; }

label {
  display: grid;
  gap: 6px;
  color: #bdc9d8;
  font-size: 12px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #090f18;
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
}

input:focus, select:focus, textarea:focus { border-color: var(--green); }

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--green);
  color: #06120e;
  font-weight: 750;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: #c7d1de;
  border: 1px solid var(--line);
}

button.danger {
  background: transparent;
  color: #ff9aa6;
  border: 1px solid #6d2a33;
}

button.small { padding: 7px 10px; font-size: 12px; }
.message { min-height: 1.4em; color: #ffb5be; }

.app { min-height: 100vh; display: grid; grid-template-columns: 290px 1fr; }

aside {
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  background: linear-gradient(180deg, #11161c, #0b0f13);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#nav { display: grid; gap: 6px; }

#nav button {
  text-align: left;
  background: transparent;
  color: #b8c5d8;
  border: 1px solid transparent;
}

#nav button.active {
  border-color: #2f445f;
  background: #0f1e31;
  color: #f1f6fd;
}

.aside-foot { margin-top: auto; display: grid; gap: 10px; }
.aside-foot span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

main { padding: 26px; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

header h1 { margin: 2px 0 0; font-size: clamp(26px, 3vw, 38px); }
.status {
  border: 1px solid #29533e;
  border-radius: 100px;
  padding: 8px 14px;
  color: #9ff0ca;
  background: #0b2219;
  white-space: nowrap;
}

.view { display: none; }
.view.active { display: block; }
.view-intro { margin: 4px 0 16px; color: var(--muted); }

.dashboard-hero {
  min-height: 190px;
  margin-bottom: 14px;
  border: 1px solid #343c45;
  border-radius: 16px;
  padding: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(90deg, #0b0f13f2 0%, #0b0f13bd 43%, #0b0f134f 100%), url('/assets/portal-somt2-hero.png') 68% 42% / cover no-repeat;
  animation: rise-in .45s ease-out both;
}

.dashboard-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 -80px 100px #07090ca6; }
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero h2 { font: 500 clamp(26px, 3vw, 38px)/1.1 Georgia, "Times New Roman", serif; margin: 7px 0 4px; }
.dashboard-hero p:last-child { margin: 0; color: #aeb6bd; }
.live-indicator { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid #416052; border-radius: 4px; background: #0c1712d9; color: #a8d6c0; font-size: 12px; white-space: nowrap; }
.live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #77c89f; box-shadow: 0 0 0 0 #77c89f80; animation: status-pulse 2.2s infinite; }

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

.metrics article {
  background: #0f1725;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  animation: rise-in .45s ease-out both;
}

.metrics article:nth-child(2) { animation-delay: .04s; }
.metrics article:nth-child(3) { animation-delay: .08s; }
.metrics article:nth-child(4) { animation-delay: .12s; }
.metrics article::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--amber); opacity: .7; }

.metrics span { display: block; color: var(--muted); font-size: 12px; }
.metrics strong { font-size: 24px; }
.metrics small { display: block; color: #697480; font-size: 10px; margin-top: 2px; }

.dashboard-charts { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 12px; margin-bottom: 12px; }
.chart-panel, .severity-panel { padding: 20px; }
.panel-title { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.panel-title h2 { margin: 4px 0 0; font-size: 18px; }
.chart-total { color: var(--muted); font-size: 12px; }
.trend-chart { min-height: 190px; margin-top: 10px; }
.trend-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: #29313a; stroke-width: 1; stroke-dasharray: 3 6; }
.chart-area { fill: url(#trendFill); }
.chart-line { fill: none; stroke: var(--amber); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1000; animation: draw-line 1.15s ease-out both; }
.chart-dot { fill: #151b21; stroke: var(--amber); stroke-width: 2; }
.chart-value { fill: #c7cdd3; font-size: 11px; text-anchor: middle; }
.chart-label { fill: #717c86; font-size: 10px; text-anchor: middle; text-transform: uppercase; }
.severity-chart { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 20px; min-height: 190px; }
.donut { width: 138px; aspect-ratio: 1; border-radius: 50%; background: var(--slices); display: grid; place-items: center; position: relative; animation: scale-in .5s ease-out both; }
.donut::after { content: ""; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; background: #12181e; box-shadow: inset 0 0 0 1px #29313a; }
.donut span { position: relative; z-index: 1; text-align: center; }
.donut strong { display: block; font-size: 26px; line-height: 1; }
.donut small { color: var(--muted); }
.severity-legend { display: grid; gap: 10px; }
.severity-legend div { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.severity-legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--legend); }
.severity-legend strong { color: var(--text); font-size: 12px; }

.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.protection-heading { align-items: flex-end; margin-bottom: 22px; }
.protection-heading h2 { margin: 5px 0 3px; font: 500 30px/1.15 Georgia, "Times New Roman", serif; }
.protection-heading p:last-child { margin: 0; color: var(--muted); }
.protection-updates { display: grid; gap: 0; }
.protection-update { display: grid; grid-template-columns: 28px 1fr; min-width: 0; }
.update-rail { display: flex; justify-content: center; position: relative; }
.update-rail::before { content: ""; position: absolute; inset: 18px auto -18px; width: 1px; background: #343c45; }
.protection-update:last-child .update-rail::before { bottom: calc(100% - 22px); }
.update-rail span { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 20px; border: 2px solid #69747d; border-radius: 50%; background: var(--bg); }
.protection-update.latest .update-rail span { border-color: var(--amber); box-shadow: 0 0 0 5px #d7a85d12; }
.update-body { margin-bottom: 14px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: #10161b; }
.protection-update.latest .update-body { border-color: #594b33; background: linear-gradient(135deg, #171810, #11161b 42%); }
.update-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.update-head > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.update-head h2 { flex-basis: 100%; margin: 3px 0 0; font-size: 19px; }
.update-head time { color: #6f7982; font-size: 11px; white-space: nowrap; }
.version-tag, .latest-tag { display: inline-flex; padding: 3px 7px; border: 1px solid #3c4650; border-radius: 3px; color: #aab3bb; font: 700 10px/1.2 Consolas, monospace; }
.latest-tag { border-color: #675535; color: #e1b96f; }
.update-summary { max-width: 850px; margin: 12px 0 18px; color: #a8b0b7; }
.update-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.update-columns > div { padding: 14px; border: 1px solid #29323a; border-radius: 8px; background: #0b1015; }
.update-columns h3 { margin: 0 0 10px; color: #cbd1d6; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; }
.update-columns ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.update-columns li { position: relative; padding-left: 14px; color: #929ca5; font-size: 12px; }
.update-columns li::before { content: ""; position: absolute; left: 0; top: .58em; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.empty-update { text-align: center; }

.actions-inline { display: flex; gap: 8px; }

.details { display: grid; gap: 8px; }
.details > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #223145;
}

.details > div:last-child { border-bottom: 0; }
.details span { color: var(--muted); }

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

.filters .filter-buttons {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  background: #0d1522;
}

table { width: 100%; border-collapse: collapse; min-width: 740px; }
th, td { padding: 10px 12px; border-bottom: 1px solid #1f2d40; text-align: left; }
th { color: #a7b7ce; font-size: 12px; background: #0b111b; position: sticky; top: 0; }

.compact-table table { min-width: 520px; }
.compact-table th,
.compact-table td { padding: 8px 10px; font-size: 13px; }

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

.severity-low { color: #9ad4ff; }
.severity-medium { color: var(--amber); }
.severity-high { color: #ff9f6e; }
.severity-critical { color: var(--red); font-weight: 700; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f1725;
  padding: 16px;
}

.badge {
  display: inline-flex;
  border: 1px solid #3a4f68;
  color: #aac1df;
  border-radius: 100px;
  padding: 3px 9px;
  font-size: 11px;
  margin-bottom: 8px;
}

dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: transparent;
  width: min(640px, calc(100vw - 20px));
}

dialog::backdrop { background: #0008; }

.help-dialog { width: min(560px, calc(100vw - 24px)); }
.help-dialog::backdrop { background: #050709d9; backdrop-filter: blur(5px); }

.help-card {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid #414a53;
  border-radius: 16px;
  background: linear-gradient(145deg, #1a2026, #0f1419);
  box-shadow: 0 30px 100px #000b;
}

.help-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--amber), #6b7d69); }
.help-kicker { color: var(--amber); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.help-card h2 { max-width: 440px; margin: 10px 0 12px; font: 500 28px/1.15 Georgia, "Times New Roman", serif; }
.help-card > p { margin: 0; color: #a6afb7; font-size: 14px; line-height: 1.65; }
.help-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); background: transparent; color: #aab2b9; font-size: 20px; line-height: 1; }
.help-topics { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0 24px; }
.help-topics span { padding: 6px 9px; border: 1px solid #343e47; border-radius: 4px; background: #0b1015; color: #939da6; font-size: 11px; }
.help-actions { display: flex; justify-content: flex-end; gap: 9px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; padding: 10px 15px; background: var(--green); color: #07110e; font-weight: 750; text-decoration: none; }

.modal {
  background: linear-gradient(145deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input { width: auto; }

#toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: #0e1b2a;
  border: 1px solid #33506f;
  border-radius: 10px;
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}

#toast.show { opacity: 1; transform: translateY(0); }

.portal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
  padding: 20px 2px 4px;
  border-top: 1px solid var(--line);
  color: #707b85;
  font-size: 11px;
}

.portal-footer > div { display: flex; align-items: center; gap: 12px; }
.portal-footer strong { color: #aab2b9; font-size: 13px; }
.portal-footer-meta span + span { padding-left: 12px; border-left: 1px solid var(--line); }

@keyframes hero-settle { from { transform: scale(1.045); } to { transform: scale(1); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scale-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes draw-line { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
@keyframes status-pulse { 70% { box-shadow: 0 0 0 7px #77c89f00; } 100% { box-shadow: 0 0 0 0 #77c89f00; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 86px;
  }

  .auth-copy .brand { top: -52px; }
  .auth-footer { position: static; grid-column: 1; margin-top: 12px; }
  .app { grid-template-columns: 1fr; }

  aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: 1fr; }
  .dashboard-charts { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .update-columns { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  main { padding: 14px; }
  .filters { grid-template-columns: 1fr; }
  #nav { grid-template-columns: 1fr; }
  header { align-items: flex-start; flex-direction: column; }
  .dashboard-hero { min-height: 220px; align-items: flex-start; flex-direction: column; justify-content: flex-end; }
  .severity-chart { grid-template-columns: 120px 1fr; }
  .donut { width: 112px; }
  .protection-heading, .update-head { align-items: flex-start; flex-direction: column; }
  .auth-footer, .portal-footer, .portal-footer > div { align-items: flex-start; flex-direction: column; gap: 7px; }
  .auth-footer span + span, .portal-footer-meta span + span { padding-left: 0; border-left: 0; }
}
