﻿:root {
  --portal-blue: #0c86df;
  --portal-blue-dark: #0a75c4;
  --portal-bg: #f3f4f6;
  --sidebar-bg: #ffffff;
  --content-bg: #f7f7f8;
  --panel-bg: #ffffff;
  --line: #d9dde3;
  --line-soft: #e8ebef;
  --text-main: #243240;
  --text-soft: #687888;
  --nav-hover: #eef5fb;
  --nav-active: #cfe4f7;
  --healthy: #2b8d4d;
  --healthy-bg: #e7f5ea;
  --degraded: #c58a12;
  --degraded-bg: #fff3d8;
  --unhealthy: #c44d4d;
  --unhealthy-bg: #fde5e5;
  --unknown: #7a8794;
  --unknown-bg: #eef1f4;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-size: 14px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--portal-bg);
  color: var(--text-main);
}

body {
  overflow-x: hidden;
}

.portal-shell {
  min-height: 100vh;
}

.portal-topbar {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 8px;
  background: linear-gradient(180deg, var(--portal-blue) 0%, var(--portal-blue-dark) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand-circle,
.topbar-user,
.topbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: var(--portal-blue);
  font-weight: 700;
  font-size: 15px;
  text-transform: lowercase;
}

.topbar-icon {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}

.topbar-appinfo {
  display: grid;
  line-height: 1.1;
}

.topbar-appinfo small {
  font-size: 11px;
  opacity: 0.85;
}

.topbar-appinfo strong {
  font-size: 12px;
  font-weight: 600;
}

.topbar-user {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #775d3a;
  font-size: 11px;
  font-weight: 700;
}

.portal-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 42px);
}

.portal-sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid #cfd5dc;
}

.side-nav {
  padding: 10px 8px 18px;
}

.nav-item,
.nav-group-label,
.nav-subitem {
  display: block;
  color: var(--text-main);
  text-decoration: none;
  border-radius: 4px;
}

.nav-item,
.nav-group-label {
  padding: 10px 14px;
  margin-bottom: 4px;
  font-size: 15px;
}

.nav-item:hover,
.nav-group-label:hover,
.nav-subitem:hover {
  background: var(--nav-hover);
}

.nav-group {
  margin-bottom: 4px;
}

.nav-group-label {
  position: relative;
}

.nav-group-label::after {
  content: "⌄";
  position: absolute;
  right: 12px;
  color: #6a7887;
}

.active-group {
  border-left: 3px solid var(--portal-blue);
  border-radius: 0 4px 4px 0;
  padding-left: 11px;
}

.nav-subitem {
  margin: 2px 0 2px 6px;
  padding: 8px 14px 8px 36px;
  font-size: 14px;
}

.nav-subitem.active {
  background: var(--nav-active);
}

.portal-content {
  background: var(--content-bg);
  padding: 8px 12px 16px;
}

.page-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 0 8px;
}

.toolbar-button,
.toolbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #c8d3df;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #eef2f5 100%);
  color: var(--text-main);
  text-decoration: none;
  font-size: 13px;
}

.toolbar-button:hover,
.toolbar-link:hover {
  background: linear-gradient(180deg, #ffffff 0%, #e5edf5 100%);
}

.page-panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 18px 16px;
}

.page-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 400;
}

.page-subtitle,
.panel-note,
.service-url,
.empty-state p {
  color: var(--text-soft);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.summary-box {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfcfd;
  padding: 10px 12px;
}

.summary-box .label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: 12px;
}

.summary-box .value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
}

.data-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fafbfc 0%, #eef1f4 100%);
  border-bottom: 1px solid var(--line);
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
}

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

.portal-table {
  width: 100%;
  border-collapse: collapse;
}

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

.portal-table th {
  background: #f8f9fb;
  color: #53606d;
  font-weight: 500;
  white-space: nowrap;
}

.portal-table tbody tr:hover {
  background: #fafcff;
}

.portal-table a {
  color: #0a73c9;
  text-decoration: none;
}

.portal-table a:hover {
  text-decoration: underline;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.healthy {
  background: var(--healthy-bg);
  color: var(--healthy);
}

.status-badge.degraded {
  background: var(--degraded-bg);
  color: var(--degraded);
}

.status-badge.unhealthy {
  background: var(--unhealthy-bg);
  color: var(--unhealthy);
}

.status-badge.unknown {
  background: var(--unknown-bg);
  color: var(--unknown);
}

.inline-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.empty-state {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.empty-state h1,
.empty-state h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 400;
}

.text-link {
  color: #0a73c9;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.table-footer {
  padding: 8px 12px;
  color: var(--text-soft);
  font-size: 12px;
  background: #fafbfc;
}

@media (max-width: 991.98px) {
  .portal-body {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    border-right: 0;
    border-bottom: 1px solid #cfd5dc;
  }
}

@media (max-width: 767.98px) {
  .topbar-appinfo {
    display: none;
  }

  .page-toolbar,
  .panel-header {
    flex-wrap: wrap;
  }

  .portal-content {
    padding: 8px;
  }
}

.compact-menu {
  padding-top: 16px;
}

.active-standalone {
  background: var(--nav-active);
  border-left: 3px solid var(--portal-blue);
  border-radius: 0 4px 4px 0;
  padding-left: 11px;
}
