:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d8dee8;
  --navy: #17324d;
  --navy-2: #23435f;
  --graphite: #2f343b;
  --soft: #eef2f6;
  --accent: #2c5f8f;
  --good: #1d7a57;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
p { line-height: 1.65; color: var(--muted); }
h1, h2, h3 { margin: 0; color: #17212f; letter-spacing: 0; }
h1 { font-size: 40px; line-height: 1.1; }
h2 { font-size: 26px; }
h3 { font-size: 18px; margin-bottom: 12px; }

.site-header {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 40px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.portal-mode .site-header { display: none; }

.brand, .portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.brand small, .portal-brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.top-nav {
  display: flex;
  gap: 18px;
  color: #3d4652;
  font-size: 14px;
  flex: 1;
}

.top-nav a:hover { color: var(--navy); }
.login-link {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  font-weight: 650;
}

.hero {
  max-width: 1180px;
  margin: 34px auto 0;
  padding: 56px;
  background: linear-gradient(135deg, #f9fbfd, #e8eef4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 40px;
  align-items: center;
}

.hero-copy p { font-size: 18px; max-width: 760px; }
.hero-actions { display: flex; gap: 12px; margin-top: 24px; }
.hero-panel { display: grid; gap: 12px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.button.secondary { background: white; color: var(--navy); border: 1px solid var(--line); }
.section { max-width: 1180px; margin: 28px auto; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 14px;
}
.section-head a { color: var(--accent); font-weight: 650; }
.page-title { max-width: 1180px; margin: 36px auto 18px; }
.page-title h1 { max-width: 850px; }
.eyebrow {
  margin: 0 0 8px;
  color: #6b7280;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 750;
}

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; }

.card, .metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}

.metric span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.metric strong { display: block; color: #17212f; font-size: 28px; line-height: 1.1; }
.metric small { display: block; color: var(--muted); margin-top: 8px; }

.list, .news-grid { display: grid; gap: 10px; }
.news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.list-row {
  display: grid;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.list-row time { color: var(--muted); font-size: 12px; }
.list-row span { color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags span, .org span {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: #344054;
  font-size: 13px;
}

.clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.clean span { display: block; color: var(--muted); margin-top: 3px; }
.map-placeholder {
  min-height: 220px;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, #eef2f6, #eef2f6 12px, #e3e9f0 12px, #e3e9f0 24px);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.form, .login-card { display: grid; gap: 12px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  background: white;
}
textarea { min-height: 130px; resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.login-page { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 32px; }
.login-card { width: min(420px, 100%); background: white; border: 1px solid var(--line); border-radius: 8px; padding: 28px; }

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
}
.portal-sidebar {
  background: #162235;
  color: white;
  padding: 22px 16px;
}
.portal-brand { min-width: 0; margin-bottom: 26px; }
.portal-brand .brand-mark { background: #284767; }
.portal-brand small { color: #b9c4d0; }
.side-nav { display: grid; gap: 4px; }
.side-nav a {
  color: #dbe3ec;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.side-nav a.active, .side-nav a:hover { background: #24364e; color: white; }
.nav-caption {
  color: #94a3b8;
  font-size: 12px;
  margin: 18px 12px 6px;
  text-transform: uppercase;
}
.portal-content { padding: 24px; min-width: 0; }
.portal-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.user-chip {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  white-space: nowrap;
}
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-links a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px 12px;
  font-weight: 650;
}
.toolbar { display: grid; grid-template-columns: 1fr 220px; gap: 12px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; }
.progress { height: 8px; background: #e4e9ef; border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress span { display: block; height: 100%; background: var(--accent); }
.org { display: flex; flex-wrap: wrap; gap: 10px; }
.chart { width: 100%; height: 260px; display: block; }
.infra-note {
  background: #edf3f8;
  border: 1px solid #ced9e5;
  border-radius: 8px;
  padding: 14px 16px;
  color: #344054;
  margin-bottom: 16px;
}
.empty {
  background: white;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
}
.log-view {
  background: #111827;
  color: #d7e4f4;
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  max-height: 620px;
  font: 12px/1.55 Consolas, "Courier New", monospace;
}

@media (max-width: 1050px) {
  .site-header { height: auto; padding: 16px; align-items: flex-start; flex-wrap: wrap; }
  .top-nav { flex-wrap: wrap; }
  .hero, .split, .portal-shell { grid-template-columns: 1fr; }
  .portal-sidebar { position: static; }
  .cols-2, .cols-3, .cols-4, .cols-5, .news-grid { grid-template-columns: 1fr; }
  .section, .page-title, .hero { margin-left: 16px; margin-right: 16px; }
  .hero { padding: 28px; }
  h1 { font-size: 30px; }
  .toolbar { grid-template-columns: 1fr; }
}
