:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-soft: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: rgba(255, 255, 255, 0.08);
  --primary: #038db2;
  --primary-soft: rgba(3, 141, 178, 0.18);
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --neutral: #64748b;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(3, 141, 178, 0.22), transparent 32%),
    radial-gradient(circle at bottom right, rgba(32, 100, 145, 0.24), transparent 32%),
    var(--bg);
}

.app-shell {
  min-height: 100vh;
  padding: 22px;
}

.hero {
  background:
    linear-gradient(135deg, rgba(3, 141, 178, 0.22), rgba(17, 24, 39, 0.94)),
    rgba(17, 24, 39, 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  margin-bottom: 18px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(69, 170, 180, 0.12);
  filter: blur(8px);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.system-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  color: #7dd3fc;
  background: rgba(3, 141, 178, 0.18);
  border: 1px solid rgba(3, 141, 178, 0.35);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -1px;
}

.hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.5;
  margin: 12px 0 18px;
}

.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-meta span {
  color: var(--muted);
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.module-card {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.module-card.critical {
  border-color: rgba(239, 68, 68, 0.25);
}

.module-card:hover {
  border-color: rgba(3, 141, 178, 0.45);
  transform: translateY(-1px);
  transition: 0.18s ease;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.icon {
  min-width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: #7dd3fc;
  font-weight: 900;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.08);
}

.status-dot.neutral {
  background: var(--neutral);
  box-shadow: 0 0 0 5px rgba(100, 116, 139, 0.08);
}

.status-dot.danger {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.08);
}

.status-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.08);
}

.module-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.module-card p {
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
  flex: 1;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  color: white;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
}

.btn-primary {
  background: var(--primary);
}

.btn-secondary {
  background: var(--panel-soft);
}

.status-panel {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  padding: 16px;
}

.status-item {
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.status-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.status-item strong {
  font-size: 18px;
}

.raw-box {
  margin: 0 16px 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #020617;
  color: #cbd5e1;
  overflow: auto;
  max-height: 260px;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .status-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .cards-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

.small-btn {
  padding: 7px 10px;
  font-size: 12px;
}

.disabled-by-role {
  opacity: 0.45;
  cursor: not-allowed !important;
}