:root {
  color-scheme: dark;
  --color-aws: #ff9900;
  --color-azure: #2563eb;
  --color-gcp: #ea4335;
  --bg: #0a0e17;
  --surface: #0f172a;
  --surface-2: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --danger: #f87171;
  --ok: #34d399;
  --warning: #f59e0b;
  --critical: #fb7185;
  --unknown: #64748b;
  --accent: #8b7cf6;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #1f2937;
  border: 2px solid #0a0e17;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #374151;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeUp 0.4s ease-out both;
}

.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border: 1px solid rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(12px);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent 28%),
    var(--bg);
}

.sidebar {
  min-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(11, 17, 29, 0.98);
}

.sidebar-brand {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #303239;
  text-decoration: none;
}

.sidebar-brand img {
  width: 164px;
  max-height: 32px;
  object-fit: contain;
}

.sidebar-section {
  display: grid;
  gap: 12px;
}

.sidebar-section > span,
.sidebar-status span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav a {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #b6c9e7;
  text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #fff;
  background: rgba(77, 70, 229, 0.28);
  border-color: rgba(129, 140, 248, 0.28);
}

.sidebar-nav a.active::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--accent);
}

.sidebar-nav strong {
  font-size: 14px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  border: 1px solid #64748b;
  border-radius: 5px;
  display: inline-block;
  position: relative;
  flex: 0 0 18px;
}

.nav-icon.grid::before,
.nav-icon.grid::after,
.nav-icon.layers::before,
.nav-icon.layers::after,
.nav-icon.logs::before,
.nav-icon.settings::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid currentColor;
  opacity: 0.72;
}

.nav-icon.grid::after {
  inset: 8px 4px 4px 8px;
}

.nav-icon.layers::before {
  transform: translateY(-3px);
}

.nav-icon.layers::after {
  transform: translateY(3px);
}

.nav-icon.logs::before {
  inset: 3px 5px;
  border-left-width: 3px;
}

.nav-icon.settings {
  border-radius: 50%;
}

.category-stack {
  display: grid;
  gap: 8px;
}

.mini-pill {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b6c9e7;
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 800;
}

.category-stack span {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #b6c9e7;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-status {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
}

.sidebar-status strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  text-transform: uppercase;
}

.shell-main {
  min-width: 0;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 23, 0.86);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title strong,
.topbar-title span {
  display: block;
}

.topbar-title strong {
  color: #fff;
  font-size: 14px;
}

.topbar-title span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.content {
  width: min(1280px, calc(100% - 40px));
  margin: 24px auto 48px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: #fff;
  font-size: 1.55rem;
}

h2 {
  margin-bottom: 18px;
  color: #fff;
  font-size: 1rem;
}

small {
  color: var(--muted);
}

.userbar,
.toolbar,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-form label,
.login-language-form label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-form span,
.login-language-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.language-form select {
  min-height: 34px;
  width: auto;
  min-width: 92px;
}

.userbar span {
  color: #b6c9e7;
  font-size: 13px;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-strip span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}

.summary-strip strong {
  color: #fff;
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

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

.status-card {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 20px;
  border-radius: 8px;
}

.status-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.status-card strong {
  color: #fff;
  font-size: 2rem;
}

.panel {
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 8px;
}

.monitor-form,
.category-form,
.user-form,
.settings-form,
.resource-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
}

.monitor-form-balanced {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.monitor-form-balanced .wide {
  grid-column: span 2;
}

.category-form {
  grid-template-columns: minmax(220px, 1fr) auto;
  justify-content: start;
}

.user-form {
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(180px, 1fr) auto auto;
}

.split-forms,
.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}

.split-forms form,
.resource-grid form {
  align-content: end;
}

.split-forms h2,
.resource-grid h2 {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.resource-form {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.inline-resource-form {
  padding: 0;
  border: 0;
  background: transparent;
}

.settings-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.form-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.field-block {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

input,
select,
textarea {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.92);
  font: inherit;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.14);
}

textarea {
  resize: vertical;
}

select[multiple] {
  min-height: 82px;
}

.table-check {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--text);
}

.table-check input {
  min-height: 16px;
  width: 16px;
}

.dropdown-checklist {
  position: relative;
}

.dropdown-checklist summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.92);
  list-style: none;
  cursor: pointer;
}

.dropdown-checklist summary::-webkit-details-marker {
  display: none;
}

.dropdown-checklist summary::after {
  content: "⌄";
  color: var(--muted);
}

.dropdown-checklist[open] summary {
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.14);
}

.dropdown-checklist-menu {
  position: static;
  margin-top: 6px;
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #0f172a;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

.table-dropdown {
  min-width: 190px;
}

.table-dropdown .dropdown-checklist-menu {
  max-height: 160px;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
}

.check-row:hover {
  background: rgba(255, 255, 255, 0.055);
}

.check-row input {
  min-height: 16px;
  width: 16px;
}

.checkbox-label {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
}

.checkbox-label input {
  min-height: 16px;
  width: 16px;
}

.wide {
  grid-column: span 3;
}

button,
.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(129, 140, 248, 0.36);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(77, 70, 229, 0.52);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: rgba(77, 70, 229, 0.72);
}

button.ghost,
.button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

button.ghost:hover,
.button.ghost:hover {
  background: rgba(255, 255, 255, 0.07);
}

button.danger {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.22);
  color: var(--danger);
}

button.danger:hover {
  background: rgba(127, 29, 29, 0.34);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

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

th {
  color: #64748b;
  font-size: 0.74rem;
  text-transform: uppercase;
}

td strong,
td small {
  display: block;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
}

.badge {
  min-width: 78px;
  display: inline-flex;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
}

.severity-pill {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.severity-pill.critical {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.34);
}

.severity-pill.high {
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.34);
}

.severity-pill.medium {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.34);
}

.severity-pill.low {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.34);
}

.healthy {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--ok);
}

.warning {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.critical,
.expired,
.error {
  background: rgba(251, 113, 133, 0.16);
  border-color: rgba(251, 113, 133, 0.34);
  color: var(--critical);
}

.unknown {
  background: rgba(100, 116, 139, 0.18);
  border-color: rgba(100, 116, 139, 0.3);
  color: #cbd5e1;
}

.sent {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--ok);
}

.failed {
  background: rgba(251, 113, 133, 0.16);
  border-color: rgba(251, 113, 133, 0.34);
  color: var(--critical);
}

.skipped {
  background: rgba(100, 116, 139, 0.18);
  border-color: rgba(100, 116, 139, 0.3);
  color: #cbd5e1;
}

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

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(139, 124, 246, 0.13), transparent 32%),
    var(--bg);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 24px;
  padding: 28px;
  border-radius: 8px;
  justify-items: center;
  text-align: center;
}

.login-card img {
  width: 220px;
  max-width: 100%;
  justify-self: center;
  border-radius: 8px;
  background: #303239;
}

.login-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.login-card div {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.login-language-form {
  width: 100%;
  display: flex;
  justify-content: center;
}

.login-button {
  width: 100%;
}

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

  .sidebar {
    min-height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .category-stack {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .monitor-form,
  .category-form,
  .user-form,
  .settings-form,
  .resource-form,
  .filter-form,
  .status-grid,
  .split-forms,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .actions {
    min-width: 220px;
  }
}
