:root {
  --ink: #172421;
  --muted: #566660;
  --subtle: #74827d;
  --line: #dce5dd;
  --surface: #ffffff;
  --soft: #f5f7f2;
  --forest: #18342f;
  --green: #2f7a67;
  --citrine: #e0b84f;
  --red: #d14f3f;
  --blue: #315b78;
  --shadow: 0 18px 45px rgba(24, 52, 47, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
  line-height: 1.5;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  color: #fff;
  background: var(--forest);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  text-decoration: none;
}

.brand img {
  width: 48px;
  height: 48px;
}

.brand strong {
  display: block;
  font-size: 1.08rem;
}

.brand span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
}

.side-label {
  margin: 26px 0 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  margin: 3px 0;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 720;
}

.side-link.active,
.side-link:hover,
.side-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--citrine);
}

.dot.green {
  background: #69c294;
}

.dot.red {
  background: var(--red);
}

.dot.blue {
  background: #72a9c9;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 242, 0.94);
  backdrop-filter: blur(16px);
}

.mobile-menu {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.mobile-menu span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--forest);
}

.topbar h1 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.15;
}

.topbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 750;
  font-size: 0.86rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 820;
}

.button.primary {
  background: var(--forest);
  color: #fff;
}

.button.citrine {
  background: var(--citrine);
  color: #211900;
}

.button.outline {
  background: #fff;
  border-color: var(--line);
  color: var(--forest);
}

.content {
  width: min(100% - 36px, 1320px);
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr);
  gap: 22px;
  align-items: stretch;
}

.hero-panel {
  min-height: 430px;
  padding: 34px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #18342f 0%, #2f7a67 70%, #315b78 100%);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--citrine);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-panel h2 {
  max-width: 560px;
  margin: 0;
  font-size: 3.05rem;
  line-height: 1.02;
}

.hero-panel p {
  max-width: 610px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.03rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.map-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.map-panel img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: cover;
  border-radius: 6px;
}

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

.metric {
  min-height: 116px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 780;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 9px;
  color: var(--subtle);
}

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

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

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

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(24, 52, 47, 0.06);
}

.panel h3 {
  margin: 0;
  font-size: 1.05rem;
}

.panel p {
  color: var(--muted);
}

.module-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.module-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}

.module-list strong {
  display: block;
}

.module-list span {
  color: var(--subtle);
  font-size: 0.86rem;
}

.status {
  white-space: nowrap;
  padding: 5px 8px;
  border-radius: 6px;
  background: #eaf4ef;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
}

.status.warn {
  background: #fff4d9;
  color: #8b6500;
}

.status.alert {
  background: #ffe9e5;
  color: var(--red);
}

.role-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.role-tabs button {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--forest);
  cursor: pointer;
  font-weight: 800;
}

.role-tabs button.active {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

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

.step {
  min-height: 156px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.step b {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--citrine);
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sos-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(320px, 1fr);
  gap: 14px;
}

.sos-button {
  width: 100%;
  min-height: 180px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--red);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.6rem;
  font-weight: 900;
}

.sos-button.arming {
  background: #a5362b;
}

.sos-button.sent {
  background: var(--green);
}

.notice {
  padding: 16px;
  border-left: 4px solid var(--citrine);
  border-radius: 7px;
  background: #fff9e8;
  color: #4f4327;
}

.footer {
  padding: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer a {
  color: var(--forest);
  font-weight: 760;
  text-decoration: none;
}

@media (max-width: 1180px) {
  .hero-grid,
  .sos-panel {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar {
    display: none;
    position: fixed;
    inset: 78px 14px auto 14px;
    z-index: 20;
    height: auto;
    max-height: calc(100vh - 96px);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    display: block;
  }

  .mobile-menu {
    display: block;
  }

  .topbar {
    padding: 14px 18px;
  }

  .top-actions .badge {
    display: none;
  }

  .content {
    width: min(100% - 28px, 1320px);
    padding-top: 18px;
  }

  .hero-panel {
    min-height: auto;
    padding: 26px;
  }

  .hero-panel h2 {
    font-size: 2.35rem;
  }

  .map-panel img {
    min-height: 280px;
  }

  .metrics,
  .grid.two,
  .grid.three,
  .workflow {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .topbar h1 {
    font-size: 1rem;
  }

  .hero-panel h2 {
    font-size: 1.95rem;
  }

  .hero-actions {
    width: 100%;
  }

  .top-actions {
    display: none;
  }

  .button {
    width: 100%;
  }
}
