/* IPMC ONE Design System tokens — aligned with the landing page brand palette. See DESIGN-SYSTEM.md */
:root {
  --bg: #0a121c;
  --panel: #111a26;
  --panel-2: #16212f;
  --line: #22303f;
  --text: #f4f6fa;
  --muted: #8b96a8;
  --accent: #39d3a5;
  --accent-2: #4a8dff;
  --amber: #f0b429;
  --danger: #ef7b6c;
  --good: #39d3a5;
  --shadow: 0 14px 40px rgba(0,0,0,.22);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, rgba(74,168,255,.08), transparent 30%), var(--bg);
}

button, input, select { font: inherit; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(8, 17, 25, .96);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 6px 26px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04130f;
  font-weight: 900;
}

.brand h1 { font-size: 15px; margin: 0; letter-spacing: .2px; }
.brand p { font-size: 11px; margin: 4px 0 0; color: var(--muted); }

.nav-title {
  margin: 20px 10px 8px;
  font-size: 10px;
  text-transform: uppercase;
  color: #627989;
  letter-spacing: 1.4px;
}

.nav-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: #aac0cf;
  padding: 10px 12px;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
  margin-bottom: 4px;
}

.nav-btn:hover { background: #112431; color: #fff; }
.nav-btn.active { background: #143127; color: #dffbf1; border: 1px solid #225343; }

.sidebar-foot {
  margin: 24px 8px 0;
  padding: 12px;
  border: 1px solid #27404e;
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 24, .92);
  backdrop-filter: blur(10px);
}

.headline h2 { margin: 0; font-size: 18px; }
.headline p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

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

.control {
  min-width: 138px;
  border: 1px solid #29404e;
  background: #0d1b25;
  color: var(--text);
  border-radius: 9px;
  padding: 8px 10px;
  outline: none;
}

.content { padding: 20px 22px 42px; }
.view { display: none; }
.view.active { display: block; }

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #304655;
  background: #0d1a24;
  color: #a9bdca;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
}

.badge strong { color: #fff; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(69,214,168,.65); }

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  background: linear-gradient(180deg, #0e1d28, #0b1720);
  border: 1px solid #223947;
  border-radius: 13px;
  padding: 14px;
  min-height: 104px;
  box-shadow: var(--shadow);
}

.metric .label { color: #849cab; font-size: 11px; }
.metric .value { font-size: 25px; font-weight: 750; margin-top: 8px; }
.metric .sub { color: #748a99; font-size: 10px; margin-top: 6px; }
.metric .up { color: var(--accent); }
.metric .warn { color: var(--amber); }
.metric .down { color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; margin-bottom: 14px; }
.grid-2-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }

.panel {
  background: linear-gradient(180deg, rgba(15,30,41,.98), rgba(11,24,33,.98));
  border: 1px solid #223946;
  border-radius: 14px;
  padding: 14px;
  min-width: 0;
  box-shadow: var(--shadow);
}

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

.panel-head h3 { margin: 0; font-size: 13px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.chart { width: 100%; height: 310px; }
.chart-sm { width: 100%; height: 240px; }
.chart-lg { width: 100%; height: 380px; }

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 6px 0 12px;
}
.section-title h3 { margin: 0; font-size: 15px; }
.section-title span { color: var(--muted); font-size: 11px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

th, td {
  padding: 10px 8px;
  border-bottom: 1px solid #213644;
  text-align: left;
  white-space: nowrap;
}

th { color: #7790a0; font-weight: 600; background: #0b1821; position: sticky; top: 0; }
tr.company-row { cursor: pointer; }
tr.company-row:hover { background: #122531; }

.score-pill {
  display: inline-flex;
  min-width: 36px;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 7px;
  font-weight: 700;
  border: 1px solid #2b4857;
}

.good { color: #7ce8c6; background: rgba(69,214,168,.08); }
.mid { color: #f5c96d; background: rgba(242,184,75,.08); }
.bad { color: #ff9494; background: rgba(242,107,107,.08); }

.table-wrap { overflow-x: auto; max-height: 400px; }

.screen-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.2fr;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-card {
  border: 1px solid #28404f;
  border-radius: 12px;
  padding: 12px;
  background: #0c1922;
}
.filter-card label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.filter-card .range-row { display: flex; gap: 10px; align-items: center; }
.filter-card input[type="range"] { width: 100%; accent-color: var(--accent); }
.filter-card output { min-width: 38px; color: var(--text); font-weight: 700; }

.action-btn {
  border: 1px solid #2b5a4c;
  background: #12372c;
  color: #dafbef;
  border-radius: 9px;
  padding: 8px 11px;
  cursor: pointer;
}
.action-btn:hover { background: #18483a; }

.feed { display: grid; gap: 8px; }
.feed-item {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #223845;
  border-radius: 11px;
  background: #0c1922;
}
.feed-item .source { color: #86a0b1; font-size: 10px; }
.feed-item .title { font-size: 11px; line-height: 1.45; }
.feed-item .time { color: #6e8594; font-size: 10px; }

.severity {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 9px;
  border: 1px solid #35505d;
}
.sev-high { color: #ff9b9b; border-color: #7f3f43; }
.sev-med { color: #f5cc77; border-color: #725d35; }
.sev-low { color: #89e5ca; border-color: #2f6658; }

.profile-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.profile-head h3 { margin: 0 0 4px; }
.profile-head p { margin: 0; color: var(--muted); font-size: 11px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.mini { border: 1px solid #233b48; background: #0c1922; padding: 10px; border-radius: 10px; }
.mini span { color: var(--muted); font-size: 10px; }
.mini b { display: block; margin-top: 5px; font-size: 17px; }

.roadmap {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
}
.phase {
  border: 1px solid #273d49;
  border-radius: 11px;
  padding: 11px;
  background: #0c1922;
  min-height: 148px;
}
.phase b { font-size: 11px; display: block; margin-bottom: 7px; }
.phase span { font-size: 10px; color: var(--muted); line-height: 1.45; display: block; }
.phase .phase-no { color: var(--accent); font-size: 10px; margin-bottom: 4px; }

.legend-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; }
.legend-line i { width: 8px; height: 8px; display: inline-block; border-radius: 50%; margin-right: 4px; }

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

@media (max-width: 1180px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .roadmap { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; display: flex; gap: 8px; overflow-x: auto; align-items: center; }
  .brand { min-width: 230px; margin-bottom: 0; }
  .nav-title, .sidebar-foot { display: none; }
  .nav-btn { min-width: 150px; margin-bottom: 0; }
  .topbar { position: relative; align-items: flex-start; flex-direction: column; }
  .filters { justify-content: flex-start; }
  .grid-2, .grid-2-equal { grid-template-columns: 1fr; }
  .screen-controls { grid-template-columns: 1fr 1fr; }
  .mini-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .content { padding: 14px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .screen-controls { grid-template-columns: 1fr; }
  .roadmap { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: 1fr 1fr; }
  .chart, .chart-lg { height: 280px; }
}
