:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --panel: #ffffff;
  --line: #dce4ea;
  --text: #172331;
  --muted: #607080;
  --navy: #0b1f33;
  --navy-soft: #123250;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --orange: #f97316;
  --green: #15803d;
  --red: #b42318;
  --amber: #b7791f;
  --shadow: 0 14px 30px rgba(15, 35, 52, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 15px;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.sidebar {
  background: linear-gradient(180deg, var(--navy), #071522);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
}

.logo-lockup {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 26px;
}

.logo-initials {
  align-items: center;
  background: #0f766e;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
  color: #ffffff;
  display: flex;
  flex: 0 0 52px;
  font-size: 18px;
  font-weight: 800;
  height: 52px;
  justify-content: center;
}

.logo-copy {
  display: grid;
  gap: 3px;
}

.logo-copy strong {
  color: #ffffff;
  font-size: 16px;
  line-height: 1.15;
}

.logo-copy span {
  color: #b7c7d6;
  font-size: 12px;
  line-height: 1.25;
}

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

.nav a {
  color: #dbe7ef;
  border-radius: 8px;
  padding: 11px 12px;
  text-decoration: none;
}

.nav a.active,
.nav a:hover {
  background: var(--navy-soft);
}

.nav-group {
  border-top: 1px solid rgba(203, 213, 225, 0.22);
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 12px;
}

.nav-group > span {
  color: #91a4b7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0 12px 2px;
  text-transform: uppercase;
}

.nav-group a {
  padding-left: 22px;
}

.sidebar-support {
  border-top: 1px solid #475569;
  color: #cbd5e1;
  display: grid;
  font-size: 12px;
  gap: 4px;
  margin-top: auto;
  padding-top: 16px;
}

.sidebar-support strong {
  color: #ffffff;
}

.user-chip {
  border-top: 1px solid #475569;
  color: #cbd5e1;
  display: grid;
  font-size: 12px;
  gap: 4px;
  margin-top: 18px;
  padding-top: 14px;
}

.user-chip strong {
  color: #ffffff;
}

.content {
  padding: 32px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.page-subtitle {
  color: var(--muted);
  margin: 6px 0 0;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

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

.grid.two {
  grid-template-columns: minmax(300px, 420px) 1fr;
}

.grid.two.wide-left {
  grid-template-columns: minmax(420px, 1.4fr) minmax(280px, 0.8fr);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.metric {
  min-height: 132px;
  position: relative;
}

.metric-icon {
  align-items: center;
  background: #ecfdf5;
  border-radius: 999px;
  display: inline-flex;
  font-size: 18px;
  height: 34px;
  justify-content: center;
  margin-bottom: 12px;
  width: 34px;
}

.metric .value {
  display: block;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.metric .label {
  color: var(--muted);
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  padding: 9px 10px;
  width: 100%;
}

.checkbox {
  align-items: center;
  display: flex;
  gap: 8px;
}

.checkbox input {
  width: auto;
}

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

button,
.button {
  background: var(--teal);
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  padding: 10px 14px;
  text-decoration: none;
}

button:hover,
.button:hover {
  background: var(--teal-dark);
  text-decoration: none;
}

.button.secondary {
  background: #475569;
}

.button.danger,
button.danger {
  background: var(--red);
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:hover {
  background: #f8fafc;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  text-transform: capitalize;
}

.badge.present,
.badge.active,
.badge.success,
.badge.completed {
  background: #dcfce7;
  color: var(--green);
}

.badge.missing,
.badge.inactive,
.badge.failed,
.badge.invalid,
.badge.expired {
  background: #fee4e2;
  color: var(--red);
}

.badge.stale,
.badge.requested,
.badge.locked {
  background: #fef3c7;
  color: var(--amber);
}

.badge.warning {
  background: #ffedd5;
  color: var(--orange);
}

.empty {
  color: var(--muted);
  padding: 20px 0;
}

.empty.compact {
  padding: 8px 0;
}

.map-board {
  background: #e9edf2;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 420px;
  overflow: auto;
  position: relative;
}

.zone-block {
  background: var(--panel);
  border: 2px solid #94a3b8;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  padding: 14px;
  position: absolute;
}

.zone-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.zone-head h2 {
  margin: 0;
}

.zone-meta {
  color: var(--muted);
  font-size: 13px;
}

.people-list {
  margin: 0;
  padding-left: 18px;
}

.demo-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  color: #9a3412;
  margin-bottom: 18px;
  padding: 14px 16px;
}

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

.activity-feed li {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.access-metrics {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.access-metrics .metric .value {
  font-size: 28px;
}

.access-metrics .metric .compact-value {
  font-size: 22px;
  line-height: 1.15;
}

.operational-metric {
  min-width: 210px;
}

.metric-detail {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin: -2px 0 8px;
}

.value-banner {
  background: linear-gradient(135deg, #ffffff, #f0fdfa);
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-left: 5px solid var(--teal);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin: 18px 0;
  padding: 20px;
}

.value-banner h2 {
  margin-bottom: 8px;
}

.value-banner p,
.panel-intro {
  color: var(--muted);
  margin: 0 0 14px;
}

.linkage-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.linkage-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 7px;
  padding: 14px;
}

.linkage-card strong {
  color: var(--text);
}

.linkage-card span {
  color: var(--muted);
}

.linkage-path {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.linkage-path span {
  background: #ecfdf5;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  color: var(--teal-dark);
  font-weight: 700;
  padding: 8px 12px;
}

.linkage-path span:not(:last-child)::after {
  color: var(--teal);
  content: ">";
  margin-left: 10px;
}

.architecture-banner {
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.13), transparent 32%),
    linear-gradient(135deg, #f8fafc, #eef7f6);
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(15, 35, 52, 0.1);
  display: grid;
  gap: 18px;
  margin-top: 16px;
  padding: 24px;
}

.architecture-flow {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 auto;
  max-width: 430px;
  width: 100%;
}

.architecture-step {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(15, 35, 52, 0.09);
  color: var(--navy);
  display: grid;
  gap: 8px;
  font-weight: 700;
  justify-items: center;
  padding: 16px 20px;
  text-align: center;
  width: min(100%, 360px);
}

.architecture-step.platform {
  background: #f0fdfa;
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.14);
}

.architecture-icon {
  align-items: center;
  background: #ecfdf5;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 999px;
  display: inline-flex;
  font-size: 24px;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.architecture-arrow {
  color: var(--teal);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.architecture-banner p {
  color: var(--muted);
  margin: 0;
  text-align: center;
}

.audit-filters {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.audit-filter-actions {
  align-content: end;
  align-items: end;
}

.audit-summary {
  margin-top: 18px;
}

.table-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.table-head span {
  color: var(--muted);
}

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

.pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.subnav a {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(15, 35, 52, 0.05);
  color: var(--navy);
  font-weight: 700;
  padding: 8px 12px;
}

.fleet-map {
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.08) 1px, transparent 1px),
    #f8fafc;
  background-size: 36px 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  min-height: 260px;
  padding: 16px;
}

.fleet-map article {
  background: #ffffff;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-left: 5px solid var(--teal);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
  max-width: 360px;
  padding: 12px;
}

.brand-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding: 8px 2px 0;
}

.brand-footer strong,
.brand-footer span {
  display: inline-flex;
}

.login-panel {
  display: grid;
  gap: 18px;
  max-width: 520px;
}

.login-panel .logo-lockup,
.about-panel .logo-lockup {
  margin-bottom: 0;
}

.login-panel .logo-initials,
.about-panel .logo-initials {
  flex-basis: 68px;
  font-size: 22px;
  height: 68px;
  width: 68px;
}

.login-panel .logo-copy strong,
.about-panel .logo-copy strong {
  color: var(--text);
  font-size: 26px;
}

.login-panel .logo-copy span,
.about-panel .logo-copy span {
  color: var(--muted);
  font-size: 14px;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.login-form {
  max-width: 420px;
}

.alert-error {
  background: #fee4e2;
  border: 1px solid #fecdca;
  border-radius: 8px;
  color: var(--red);
  padding: 10px 12px;
}

.alert-success {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: var(--green);
  padding: 10px 12px;
}

.alert-error ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.form-link {
  font-weight: 700;
  justify-self: start;
  margin-top: 2px;
}

.demo-reset-card {
  border-left: 4px solid var(--amber);
}

.demo-reset-card a {
  overflow-wrap: anywhere;
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
  margin: -8px 0 16px;
}

.rssi-help {
  align-self: end;
  margin: 0;
}

.about-panel p {
  margin: 8px 0;
}

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

  .sidebar {
    position: static;
  }

  .content {
    padding: 22px;
  }

  .metrics,
  .grid.two,
  .grid.two.wide-left {
    grid-template-columns: 1fr;
  }

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

  .architecture-banner p {
    text-align: left;
  }
}
