:root {
  --gss-blue: #0b3d66;
  --gss-blue-dark: #072944;
  --gss-accent: #1e88e5;
  --gss-green: #2e7d32;
  --gss-yellow: #b8860b;
  --gss-red: #c62828;
  --bg: #f4f6f8;
  --border: #dbe2ea;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; background: var(--bg); color: #1c2b36; }
a { color: var(--gss-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--gss-blue);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.6rem 1.2rem;
  flex-wrap: wrap;
}
.topbar .brand { font-weight: 700; font-size: 1.05rem; }
.topbar .version { font-weight: 400; opacity: 0.7; font-size: 0.8rem; }
.mainnav { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.mainnav a { color: #dce8f5; font-size: 0.92rem; }
.mainnav a:hover { color: #fff; }

.subnav {
  background: #16395b;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #0f2c48;
}
.subnav:empty { display: none; }
.subnav a {
  color: #b8cfe4;
  font-size: 0.85rem;
  padding: 0.5rem 0.8rem;
  border-bottom: 3px solid transparent;
}
.subnav a:hover { color: #fff; text-decoration: none; }
.subnav a.active { color: #fff; border-bottom-color: var(--gss-accent); font-weight: 600; }

.grid a.tile { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.grid a.tile .muted { font-size: 0.78rem; }
.userbox { display: flex; align-items: center; gap: 0.8rem; font-size: 0.9rem; }
.btn-link { color: #ffd9d9; }

.container { max-width: 1180px; margin: 1.5rem auto; padding: 0 1rem 3rem; }

.flash-stack { margin-bottom: 1rem; }
.flash { padding: 0.6rem 1rem; border-radius: 4px; margin-bottom: 0.5rem; font-size: 0.9rem; }
.flash-success { background: #e6f4ea; color: var(--gss-green); border: 1px solid #b7dfc0; }
.flash-warning { background: #fff8e1; color: var(--gss-yellow); border: 1px solid #f0e0a6; }
.flash-danger { background: #fdecea; color: var(--gss-red); border: 1px solid #f5c6c2; }
.flash-info { background: #e8f1fb; color: var(--gss-blue); border: 1px solid #c6dbf0; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.card h2, .card h3 { margin-top: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.grid a.tile {
  display: block; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 1.2rem; color: var(--gss-blue-dark); font-weight: 600; text-align: center;
}
.grid a.tile:hover { border-color: var(--gss-accent); text-decoration: none; }

table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th, table.data td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; }
table.data th { background: #eef3f8; font-weight: 600; }
table.data tr:hover { background: #f8fbfe; }

form.stacked label { display: block; font-size: 0.82rem; font-weight: 600; margin: 0.6rem 0 0.2rem; }
form.stacked input, form.stacked select, form.stacked textarea {
  width: 100%; padding: 0.45rem 0.55rem; border: 1px solid var(--border); border-radius: 4px; font-size: 0.9rem;
}
form.stacked textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }

.btn {
  display: inline-block; background: var(--gss-accent); color: #fff; border: none; border-radius: 4px;
  padding: 0.5rem 1rem; font-size: 0.9rem; cursor: pointer; margin-top: 0.8rem;
}
.btn:hover { background: #1567b3; text-decoration: none; }
.btn.danger { background: var(--gss-red); }
.btn.secondary { background: #607d8b; }
.btn.small { padding: 0.25rem 0.6rem; font-size: 0.8rem; margin-top: 0; }

.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.badge.green { background: #e6f4ea; color: var(--gss-green); }
.badge.yellow { background: #fff8e1; color: var(--gss-yellow); }
.badge.red { background: #fdecea; color: var(--gss-red); }
.badge.gray { background: #eceff1; color: #455a64; }

.login-wrap { max-width: 380px; margin: 4rem auto; }
.login-wrap .card { text-align: center; }
.muted { color: #6b7d8c; font-size: 0.85rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }


/* ==========================================================
   SIG NEXUS · ENTERPRISE UI
   Dashboard / Shell v3.1
   ========================================================== */

:root {
  --nexus-ink: #111820;
  --nexus-ink-soft: #34424f;
  --nexus-blue: #0b5875;
  --nexus-blue-dark: #073e55;
  --nexus-teal: #14869a;
  --nexus-teal-soft: #e7f5f7;
  --nexus-line: #dfe6ea;
  --nexus-surface: #ffffff;
  --nexus-bg: #f5f7f8;
  --nexus-muted: #70808c;
  --nexus-success: #13835f;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(
      180deg,
      #ffffff 0,
      #f7f9fa 220px,
      var(--nexus-bg) 100%
    );
  color: var(--nexus-ink);
  font-family:
    "Segoe UI",
    "Helvetica Neue",
    Arial,
    sans-serif;
}


/* ---------- HEADER ---------- */

.nexus-header {
  min-height: 82px;
  padding: 0 38px;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--nexus-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nexus-brand-link {
  color: var(--nexus-ink);
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.nexus-brand-link:hover {
  text-decoration: none;
}

.nexus-wordmark {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: .12em;
}

.nexus-product {
  margin-top: 7px;
  color: var(--nexus-teal);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.nexus-header-status {
  display: flex;
  align-items: center;
  gap: 20px;
}

.system-status,
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--nexus-success);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nexus-success);
  box-shadow: 0 0 0 4px rgba(19,131,95,.10);
}

.nexus-version {
  color: var(--nexus-muted);
  font-size: 12px;
  border-left: 1px solid var(--nexus-line);
  padding-left: 20px;
}

.nexus-user {
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 1px solid var(--nexus-line);
  padding-left: 20px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--nexus-ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.logout-link {
  color: var(--nexus-muted);
  font-size: 11px;
  margin-left: 5px;
}

.logout-link:hover {
  color: var(--nexus-blue);
}


/* ---------- MAIN NAV ---------- */

.nexus-nav {
  min-height: 48px;
  background: #fff;
  border-bottom: 1px solid var(--nexus-line);
  padding: 0 38px;
  display: flex;
  align-items: stretch;
  gap: 27px;
  overflow-x: auto;
}

.nexus-nav a {
  color: #586773;
  display: flex;
  align-items: center;
  position: relative;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

.nexus-nav a:hover {
  color: var(--nexus-ink);
  text-decoration: none;
}

.nexus-nav a.active {
  color: var(--nexus-blue-dark);
}

.nexus-nav a.active::after {
  content: "";
  height: 2px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--nexus-teal);
}


/* ---------- SUBNAV ---------- */

.subnav {
  min-height: 39px;
  background: #f7f9fa;
  border-bottom: 1px solid var(--nexus-line);
  padding: 0 38px;
}

.subnav a {
  color: #71808b;
}

.subnav a:hover {
  color: var(--nexus-ink);
}

.subnav a.active {
  color: var(--nexus-blue-dark);
  border-bottom-color: var(--nexus-teal);
}


/* ---------- MAIN CONTENT ---------- */

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 42px 38px 70px;
}


/* ---------- DASHBOARD HERO ---------- */

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--nexus-line);
}

.dashboard-eyebrow,
.section-kicker {
  color: var(--nexus-teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}

.dashboard-hero h1 {
  margin: 7px 0 5px;
  font-size: clamp(32px, 4vw, 47px);
  line-height: 1;
  letter-spacing: -.035em;
  color: var(--nexus-ink);
}

.dashboard-hero p {
  max-width: 650px;
  margin: 12px 0 0;
  color: var(--nexus-muted);
  font-size: 14px;
  line-height: 1.6;
}

.dashboard-live {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.dashboard-time {
  color: var(--nexus-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}


/* ---------- STATUS ---------- */

.dashboard-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 48px;
}

.status-card {
  min-height: 138px;
  padding: 22px 23px;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--nexus-line);
  border-radius: 5px;
  position: relative;
  overflow: hidden;
}

.status-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--nexus-teal);
  opacity: .85;
}

.status-card-label {
  color: var(--nexus-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .15em;
}

.status-card-value {
  margin-top: 15px;
  color: var(--nexus-ink);
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -.025em;
}

.status-card-value-small {
  font-size: 19px;
  word-break: break-word;
}

.status-card-meta {
  margin-top: 7px;
  color: var(--nexus-muted);
  font-size: 11px;
}


/* ---------- SECTIONS ---------- */

.dashboard-section,
.dashboard-system {
  margin-top: 45px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 19px;
}

.section-heading h2 {
  margin: 6px 0 0;
  color: var(--nexus-ink);
  font-size: 21px;
  letter-spacing: -.02em;
}

.section-count {
  color: var(--nexus-muted);
  font-size: 11px;
}


/* ---------- MODULE CARDS ---------- */

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

.module-card {
  min-height: 126px;
  background: #fff;
  border: 1px solid var(--nexus-line);
  border-radius: 5px;
  padding: 21px;
  display: grid;
  grid-template-columns: 35px 1fr auto;
  gap: 14px;
  align-items: start;
  color: var(--nexus-ink);
  transition:
    transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

.module-card:hover {
  color: var(--nexus-ink);
  text-decoration: none;
  transform: translateY(-2px);
  border-color: #b9ccd3;
  box-shadow: 0 10px 25px rgba(14,45,58,.07);
}

.module-number {
  color: var(--nexus-teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  padding-top: 4px;
}

.module-content h3 {
  margin: 0;
  color: var(--nexus-ink);
  font-size: 14px;
  font-weight: 700;
}

.module-content p {
  margin: 9px 0 0;
  color: var(--nexus-muted);
  font-size: 11px;
  line-height: 1.5;
}

.module-arrow {
  color: var(--nexus-teal);
  font-size: 19px;
  line-height: 1;
}


/* ---------- SYSTEM INFO ---------- */

.system-information {
  background: #fff;
  border: 1px solid var(--nexus-line);
  border-radius: 5px;
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
}

.system-info-item {
  min-height: 88px;
  padding: 19px 22px;
  border-right: 1px solid var(--nexus-line);
  border-bottom: 1px solid var(--nexus-line);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.system-info-item:nth-child(3n) {
  border-right: 0;
}

.system-info-item:nth-last-child(-n+3) {
  border-bottom: 0;
}

.system-info-item span {
  color: var(--nexus-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.system-info-item strong {
  color: var(--nexus-ink-soft);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.system-online-text {
  color: var(--nexus-success) !important;
}


/* ---------- FOOTER ---------- */

.nexus-footer {
  min-height: 78px;
  border-top: 1px solid var(--nexus-line);
  background: #fff;
  padding: 18px 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--nexus-muted);
  font-size: 10px;
}

.nexus-footer > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nexus-footer strong {
  color: var(--nexus-ink);
  font-size: 11px;
}

.nexus-footer span {
  color: var(--nexus-teal);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .09em;
}


/* ---------- EXISTING COMPONENT REFINEMENT ---------- */

.card {
  border-color: var(--nexus-line);
  border-radius: 5px;
  box-shadow: 0 3px 14px rgba(18,48,61,.035);
}

.grid a.tile {
  border-color: var(--nexus-line);
  border-radius: 5px;
}

.grid a.tile:hover {
  border-color: var(--nexus-teal);
}

.btn {
  background: var(--nexus-blue);
  border-radius: 4px;
}

.btn:hover {
  background: var(--nexus-blue-dark);
}


/* ---------- RESPONSIVE ---------- */

@media (max-width: 1050px) {

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

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

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

  .system-info-item:nth-child(3n) {
    border-right: 1px solid var(--nexus-line);
  }

  .system-info-item:nth-child(2n) {
    border-right: 0;
  }

  .system-info-item:nth-last-child(-n+3) {
    border-bottom: 1px solid var(--nexus-line);
  }

  .system-info-item:nth-last-child(-n+2) {
    border-bottom: 0;
  }
}


@media (max-width: 760px) {

  .nexus-header {
    padding: 17px 20px;
    align-items: flex-start;
  }

  .nexus-wordmark {
    font-size: 19px;
  }

  .system-status,
  .nexus-version,
  .user-name {
    display: none;
  }

  .nexus-user {
    border-left: 0;
    padding-left: 0;
  }

  .nexus-nav,
  .subnav {
    padding-left: 20px;
    padding-right: 20px;
  }

  .container {
    padding: 30px 20px 55px;
  }

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

  .dashboard-live {
    align-items: flex-start;
  }

  .dashboard-status-grid,
  .module-grid,
  .system-information {
    grid-template-columns: 1fr;
  }

  .system-info-item,
  .system-info-item:nth-child(2n),
  .system-info-item:nth-child(3n),
  .system-info-item:nth-last-child(-n+2),
  .system-info-item:nth-last-child(-n+3) {
    border-right: 0;
    border-bottom: 1px solid var(--nexus-line);
  }

  .system-info-item:last-child {
    border-bottom: 0;
  }

  .nexus-footer {
    padding: 18px 20px;
    align-items: flex-start;
    gap: 18px;
    flex-direction: column;
  }
}
