:root {
  --surface: #ffffff;
  --page: #f6f7f9;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d9dee7;
  --brand: #135f73;
  --brand-strong: #0f4d5d;
  --accent: #b7791f;
  --danger: #b42318;
  --ok: #087443;
}

body {
  background: var(--page);
  color: var(--ink);
  letter-spacing: 0;
}

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

.sidebar {
  background: var(--surface);
}

.content {
  min-width: 0;
  padding: 24px;
}

.nav-item-link {
  color: var(--ink);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.nav-item-link i {
  width: 20px;
  text-align: center;
}

.nav-item-link:hover,
.nav-item-link.active {
  background: #e7f1f3;
  color: var(--brand);
}

.topbar-user {
  max-width: 180px;
}

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

.page-heading h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
}

.page-heading p {
  color: var(--muted);
  margin: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card {
  padding: 18px;
  min-height: 120px;
}

.metric-card span {
  color: var(--muted);
  display: block;
  font-size: .92rem;
}

.metric-card strong {
  display: block;
  font-size: 2rem;
  margin-top: 12px;
}

.panel {
  padding: 18px;
}

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

.panel h2,
.panel-header h2 {
  font-size: 1rem;
  margin: 0;
}

.status-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: .8rem;
  font-weight: 600;
  min-height: 28px;
  padding: 4px 10px;
  text-transform: capitalize;
}

.status-online {
  background: #dcfae6;
  color: var(--ok);
}

.status-offline {
  background: #fee4e2;
  color: var(--danger);
}

.status-degraded,
.status-unknown {
  background: #fef0c7;
  color: var(--accent);
}

.activity-feed {
  display: grid;
  gap: 14px;
}

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

.activity-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
}

.activity-item p {
  color: var(--muted);
  margin: 2px 0;
}

.activity-item small {
  color: var(--muted);
}

.activity-dot {
  background: var(--brand);
  border-radius: 50%;
  height: 10px;
  margin-top: 7px;
  width: 10px;
}

.activity-dot.danger {
  background: var(--danger);
}

.icon-btn {
  min-width: 44px;
  min-height: 40px;
}

.action-group {
  gap: 6px;
}

.action-group form {
  display: inline-flex;
}

.action-group .btn {
  min-height: 36px;
  min-width: 38px;
}

.form-panel {
  max-width: 980px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.touch-switch {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-screen {
  align-items: center;
  background: linear-gradient(140deg, #eef6f8, #f8f4ec);
  display: flex;
  min-height: 100vh;
  padding: 20px;
}

.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: auto;
  max-width: 440px;
  padding: 32px;
  width: 100%;
}

.brand-mark {
  align-items: center;
  background: var(--brand);
  border-radius: 8px;
  color: #fff;
  display: flex;
  font-weight: 700;
  height: 44px;
  justify-content: center;
  width: 44px;
}

@media (max-width: 991.98px) {
  .app-shell {
    display: block;
  }

  .content {
    padding: 18px;
  }

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

@media (max-width: 575.98px) {
  .content {
    padding: 14px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading .btn,
  .form-actions .btn {
    width: 100%;
  }

  .metric-grid,
  .activity-feed.two-col {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
  }

  .responsive-table td {
    border: 0;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 7px 0;
    text-align: right;
  }

  .responsive-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-weight: 600;
    min-width: 42%;
    text-align: left;
  }

  .form-actions {
    flex-direction: column-reverse;
  }
}
