:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #f9fbfd;
  --text: #17202a;
  --muted: #667085;
  --line: #d9e0e8;
  --line-strong: #c5ced9;
  --nav: #101828;
  --nav-soft: #1d2939;
  --blue: #1f5fbf;
  --green: #0f766e;
  --red: #b42318;
  --amber: #b35a00;
  --shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--nav);
  color: #fff;
  padding: 20px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 26px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #184a93;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.brand p {
  margin: 4px 0 0;
  color: #bac6d6;
  font-size: 13px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  color: #d9e2ef;
  background: transparent;
  text-align: left;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #c7d7ef;
  font-size: 11px;
  font-weight: 700;
}

.nav-item.active,
.nav-item:hover {
  background: var(--nav-soft);
  color: #fff;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #c7d7ef;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #12b76a;
}

.main {
  padding: 24px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

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

.primary,
.secondary {
  min-height: 40px;
  border: 1px solid var(--line);
  padding: 9px 13px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.secondary {
  background: #fff;
  color: var(--text);
}

.status-banner {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  margin-bottom: 18px;
  color: var(--text);
}

.status-banner.error {
  border-left-color: var(--red);
}

.hidden,
.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric {
  min-height: 106px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.metric.urgent strong {
  color: var(--red);
}

.metric.high strong {
  color: var(--amber);
}

.metric.score strong {
  color: var(--green);
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.full-panel {
  min-height: 520px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 15px 16px;
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-header span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.alerts-list,
.alert-board {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.alert-board {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.alert-item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 6px;
  padding: 11px;
  background: #fff;
}

.alert-item.Urgent {
  border-left-color: var(--red);
}

.alert-item.High {
  border-left-color: var(--amber);
}

.alert-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.alert-item p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.empty {
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  background: var(--panel-soft);
  font-weight: 700;
}

td {
  font-size: 13px;
  line-height: 1.35;
}

.priority {
  font-weight: 700;
}

.priority.Urgent {
  color: var(--red);
}

.priority.High {
  color: var(--amber);
}

.priority.Medium {
  color: var(--blue);
}

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

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
}

.settings-card {
  min-height: 260px;
}

.settings-list {
  margin: 0;
  padding: 8px 16px 16px;
}

.settings-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.settings-list div:last-child {
  border-bottom: 0;
}

.settings-list dt {
  color: var(--muted);
  font-size: 13px;
}

.settings-list dd {
  margin: 0;
  font-weight: 700;
}

.deployment-box {
  margin: 16px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
}

.deployment-box span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.deployment-box strong {
  font-size: 20px;
}

@media (max-width: 1100px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .overview-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .brand {
    margin-bottom: 14px;
  }

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

  .sidebar-footer {
    margin-top: 14px;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }

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