:root {
  color-scheme: dark;
  --bg: #050914;
  --bg-soft: #08101d;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: #0f172a;
  --panel-muted: rgba(15, 23, 42, 0.58);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --muted: #94a3b8;
  --muted-strong: #c5d4ea;
  --primary: #22d3ee;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --accent-cyan: #22d3ee;
  --accent-teal: #14b8a6;
  --accent-orange: #fb923c;
  --accent-red: #ef4444;
  --accent-blue: #38bdf8;
  --chart-grid: rgba(148, 163, 184, 0.12);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.38);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.24);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.16);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --transition: 180ms ease;
}

body.theme-light {
  color-scheme: light;
  --bg: #edf3fb;
  --bg-soft: #dfe9f5;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: #ffffff;
  --panel-muted: rgba(238, 244, 252, 0.84);
  --border: rgba(71, 85, 105, 0.12);
  --text: #0f172a;
  --muted: #64748b;
  --muted-strong: #334155;
  --chart-grid: rgba(148, 163, 184, 0.16);
  --shadow-lg: 0 24px 80px rgba(15, 23, 42, 0.14);
  --shadow-md: 0 18px 48px rgba(15, 23, 42, 0.12);
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.1), transparent 22%),
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.08), transparent 18%),
    radial-gradient(circle at bottom left, rgba(34, 197, 94, 0.08), transparent 16%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  background: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 9, 20, 0.82);
  backdrop-filter: blur(22px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

body.theme-light .site-header {
  background: rgba(237, 243, 251, 0.8);
}

.site-header__inner {
  width: 100%;
  padding: 0 28px;
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
}

.site-header__brand,
.site-header__tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header__brand {
  min-width: 0;
}

.site-header__tools {
  justify-self: end;
  flex-wrap: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}

.brand-mark__icon {
  width: 42px;
  height: 42px;
  padding: 8px;
  border-radius: 14px;
  color: var(--primary);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.14), rgba(15, 23, 42, 0.28));
  border: 1px solid rgba(34, 211, 238, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark__text {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  white-space: nowrap;
}

.brand-mark__text em {
  font-style: normal;
  color: var(--primary);
}

.site-nav {
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  justify-self: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.94rem;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.nav-link__icon,
.drawer-nav__icon,
.icon-button__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link__icon svg,
.drawer-nav__icon svg,
.icon-button__glyph svg,
.metric-card__icon svg {
  width: 18px;
  height: 18px;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.2);
}

.nav-link.is-active {
  box-shadow: inset 0 -2px 0 var(--primary);
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 44px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.52);
  transition: width var(--transition), border-color var(--transition), background var(--transition);
  overflow: hidden;
}

.header-search.is-open,
.header-search:focus-within {
  width: 240px;
}

.header-search__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  flex: 0 0 44px;
}

.header-search__input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 0;
  border-radius: 0 14px 14px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.header-search.is-open .header-search__input,
.header-search:focus-within .header-search__input {
  opacity: 1;
}

body.theme-light .header-search__input {
  background: transparent;
}

.header-search__input::placeholder {
  color: var(--muted);
}

.icon-button,
.button,
.action-button {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.52);
  color: var(--text);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.icon-button:hover,
.button:hover,
.action-button:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.28);
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 13px;
}

.icon-button__glyph {
  color: var(--muted-strong);
  width: 18px;
  height: 18px;
}

.site-header__tools .icon-button__label {
  display: none;
}

.icon-button__label {
  color: var(--muted);
  font-weight: 700;
}

.icon-button__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.icon-button__badge.is-empty {
  opacity: 0.45;
}

.header-state {
  min-width: 118px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  position: relative;
}

.header-state::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 16px currentColor;
}

.header-state--ok {
  color: #b3ffd0;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.26);
}

.header-state--warning {
  color: #ffd998;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.26);
}

.header-state--danger {
  color: #ffc4c4;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.26);
}

.header-state--muted {
  color: var(--muted-strong);
  background: rgba(148, 163, 184, 0.1);
  border-color: var(--border);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 800;
}

.button--secondary {
  background: linear-gradient(135deg, var(--primary), #16a8c0);
  border-color: transparent;
  color: #03111a;
}

.button--ghost {
  background: rgba(15, 23, 42, 0.42);
  color: var(--text);
}

.menu-toggle {
  display: none;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.52);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
}

.site-main {
  flex: 1;
}

.page-shell {
  width: 100%;
  margin: 0;
  padding: 22px 28px 34px;
  max-width: none;
  align-self: stretch;
}

.page-content {
  display: grid;
  gap: 18px;
}

.page-hero,
.hero-card,
.panel,
.metric-card,
.stat-card,
.chart-card,
.service-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

.page-hero,
.hero-card {
  padding: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
}

.page-hero__copy,
.hero-card__copy {
  display: grid;
  gap: 10px;
}

.page-hero__title,
.hero-card__copy h1,
.panel h3,
.chart-card h3 {
  margin: 0;
  font-size: clamp(1.55rem, 2.1vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.page-hero__description,
.hero-card__copy p,
.panel__footnote,
.detail-list__item span,
.metric-card__meta,
.stat-card__meta,
.service-row__copy p,
.event-row__content p {
  color: var(--muted);
}

.page-hero__eyebrow,
.section__eyebrow,
.metric-card__label,
.stat-card__label,
.top-label {
  margin: 0 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
}

.hero-badges,
.hero-actions,
.toolbar__group,
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

.page-hero__side,
.hero-card__health {
  padding: 22px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.hero-card__health {
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero-card__health::after {
  content: "";
  position: absolute;
  inset: auto -18% -32% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.24), transparent 70%);
  opacity: 0.7;
  pointer-events: none;
}

.hero-card__health[data-tone="ok"] {
  border-color: rgba(34, 197, 94, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 0 1px rgba(34, 197, 94, 0.04), 0 22px 48px rgba(12, 33, 22, 0.34);
}

.hero-card__health[data-tone="warning"] {
  border-color: rgba(245, 158, 11, 0.18);
}

.hero-card__health[data-tone="warning"]::after {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.24), transparent 70%);
}

.hero-card__health[data-tone="danger"] {
  border-color: rgba(239, 68, 68, 0.18);
}

.hero-card__health[data-tone="danger"]::after {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.22), transparent 70%);
}

.page-hero__side-title {
  margin: 0 0 16px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
}

.hero-meta {
  display: grid;
  gap: 16px;
  margin: 0;
}

.hero-meta__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.hero-meta__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hero-meta__item dt {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-meta__item dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.dashboard-hero {
  display: grid;
  gap: 18px;
}

.hero-card--overview {
  align-items: stretch;
}

.hero-card__identity {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.hero-card__avatar {
  width: 116px;
  height: 116px;
  padding: 26px;
  border-radius: 50%;
  color: var(--primary);
  background:
    radial-gradient(circle at center, rgba(15, 23, 42, 0.92) 52%, rgba(15, 23, 42, 0.38) 53%, transparent 67%),
    radial-gradient(circle at top, rgba(34, 211, 238, 0.26), rgba(15, 23, 42, 0.68));
  border: 1px solid rgba(34, 211, 238, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 42px rgba(34, 211, 238, 0.24);
  flex: 0 0 auto;
}

.hero-wave {
  font-size: 0.8em;
}

.hero-card__copy {
  min-width: 0;
}

.hero-card__copy > p {
  margin: 8px 0 0;
}

.hero-card__facts {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hero-card__fact {
  padding-left: 14px;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
  min-width: 0;
}

.hero-card__fact span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.hero-card__fact strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.hero-card__health h3 {
  margin-top: 18px;
  font-size: 1.45rem;
}

.hero-card__health p {
  margin: 8px 0 0;
}

.health-sparkline {
  margin-top: 22px;
  height: 58px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.03)),
    linear-gradient(90deg, rgba(34, 197, 94, 0.08) 0%, transparent 100%);
  border: 1px solid rgba(34, 197, 94, 0.16);
  position: relative;
  overflow: hidden;
}

.health-sparkline span {
  position: absolute;
  inset: auto 0 14px 0;
  height: 16px;
  background: linear-gradient(90deg,
      transparent 0%,
      transparent 8%,
      rgba(34, 197, 94, 0.55) 12%,
      transparent 15%,
      rgba(34, 197, 94, 0.42) 26%,
      transparent 32%,
      rgba(34, 197, 94, 0.7) 44%,
      transparent 48%,
      rgba(34, 197, 94, 0.5) 62%,
      transparent 66%,
      rgba(34, 197, 94, 0.82) 78%,
      transparent 83%,
      rgba(34, 197, 94, 0.4) 92%,
      transparent 100%);
}

.dashboard-metrics,
.stat-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-grid--dashboard {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-grid--compact,
.stat-grid--gpu {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card,
.stat-card {
  padding: 20px 20px 18px;
  min-width: 0;
  min-height: 152px;
  position: relative;
  overflow: hidden;
}

.metric-card__header,
.panel__header,
.chart-card__header,
.service-card__header,
.event-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.metric-card__header {
  justify-content: flex-start;
  gap: 12px;
}

.metric-card__value,
.stat-card__value {
  display: block;
  margin: 6px 0 12px;
  font-size: clamp(1.9rem, 2.8vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.05em;
  position: relative;
  z-index: 1;
}

.metric-card__value--sm,
.stat-card__value--sm {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.metric-card__meta,
.stat-card__meta {
  margin: 12px 0 0;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
  color: var(--muted-strong);
}

.metric-card__icon {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.metric-card__spark {
  height: 34px;
  margin: 8px 0 10px;
  border-radius: 12px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: 0.95;
}

.metric-card__spark--cpu {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 36' fill='none'%3E%3Cpath d='M0 22C12 22 20 10 34 10C47 10 54 19 67 19C82 19 89 14 102 14C116 14 121 24 136 24C149 24 156 12 171 12C187 12 196 22 220 20' stroke='%2322d3ee' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.metric-card__spark--ram {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 36' fill='none'%3E%3Cpath d='M0 18C18 17 29 9 44 9C58 9 63 20 78 20C92 20 100 11 116 11C130 11 137 22 151 22C165 22 173 13 187 13C202 13 208 18 220 18' stroke='%238b5cf6' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.metric-card__spark--disk {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 36' fill='none'%3E%3Cpath d='M0 22C15 22 24 17 37 17C50 17 60 12 74 12C88 12 96 19 111 19C124 19 131 15 145 15C160 15 170 21 183 21C197 21 207 16 220 16' stroke='%2322c55e' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.metric-card__spark--network {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 36' fill='none'%3E%3Cpath d='M0 25C14 25 22 8 39 8C52 8 58 18 72 18C88 18 95 10 110 10C125 10 130 24 146 24C160 24 169 12 183 12C200 12 205 24 220 24' stroke='%2338bdf8' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.metric-card__spark--temp {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 36' fill='none'%3E%3Cpath d='M0 24C16 24 20 14 35 14C48 14 57 8 69 8C83 8 88 19 101 19C116 19 123 12 138 12C152 12 157 18 171 18C188 18 198 14 220 14' stroke='%23fb923c' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.metric-card__spark--uptime {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 36' fill='none'%3E%3Cpath d='M0 22C13 22 24 22 37 22C52 22 58 18 73 18C87 18 94 18 109 18C123 18 130 14 145 14C160 14 170 14 183 14C197 14 207 14 220 14' stroke='%23f59e0b' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.metric-card--cyan .metric-card__value {
  color: var(--primary);
}

.metric-card--cyan .metric-card__icon {
  color: var(--primary);
}

.metric-card--purple .metric-card__value {
  color: var(--purple);
}

.metric-card--purple .metric-card__icon {
  color: var(--purple);
}

.metric-card--green .metric-card__value {
  color: #4ade80;
}

.metric-card--green .metric-card__icon {
  color: #4ade80;
}

.metric-card--blue .metric-card__value {
  color: var(--accent-blue);
}

.metric-card--blue .metric-card__icon {
  color: var(--accent-blue);
}

.metric-card--orange .metric-card__value {
  color: var(--accent-orange);
}

.metric-card--orange .metric-card__icon {
  color: var(--accent-orange);
}

.metric-card--warning .metric-card__value {
  color: var(--warning);
}

.metric-card--warning .metric-card__icon {
  color: var(--warning);
}

.progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12);
  position: relative;
  z-index: 1;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 220ms ease;
}

.progress span.is-ok {
  background: linear-gradient(90deg, var(--primary), var(--success));
}

.progress span.is-warning {
  background: linear-gradient(90deg, var(--warning), #fb923c);
}

.progress span.is-danger {
  background: linear-gradient(90deg, #fb7185, var(--danger));
}

.progress span.is-idle {
  background: rgba(148, 163, 184, 0.22);
}

.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 1fr) minmax(480px, 2fr) minmax(280px, 1fr);
  align-items: start;
}

.dashboard-panel {
  padding: 22px;
}

.dashboard-side {
  display: grid;
  gap: 18px;
}

.dashboard-panel--services,
.dashboard-panel--monitoring,
.dashboard-panel--alerts,
.dashboard-panel--actions {
  min-width: 0;
}

.dashboard-panel--monitoring {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: start;
}

.panel {
  padding: 22px;
}

.panel__header h3,
.chart-card__header h3 {
  font-size: 1.35rem;
}

.panel__header,
.chart-card__header {
  margin-bottom: 18px;
}

.panel__footnote {
  margin: 16px 0 0;
}

.service-list,
.service-grid,
.detail-list,
.event-list {
  display: grid;
  gap: 12px;
}

.service-grid--dashboard {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.service-row,
.detail-list__item,
.service-card,
.event-row {
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 18px;
}

.service-row {
  padding: 18px 18px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.service-grid--dashboard .service-row {
  position: relative;
  min-height: 122px;
  padding: 16px 14px 16px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.service-grid--dashboard .service-row .status-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.68rem;
}

.service-grid--dashboard .service-row__icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 1rem;
}

.service-row__icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.15rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.service-row__icon--orange {
  color: #ffb86b;
  background: rgba(251, 146, 60, 0.14);
}

.service-row__icon--light {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
}

.service-row__icon--warning {
  color: #ffd37a;
  background: rgba(245, 158, 11, 0.14);
}

.service-row__icon--cyan {
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.14);
}

.service-row__icon--muted {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
}

.service-row__icon--success {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

.service-row__copy strong {
  display: block;
}

.service-row__copy p {
  margin: 4px 0 0;
}

.service-grid--dashboard .service-row__copy strong {
  font-size: 1rem;
  line-height: 1.2;
  padding-right: 86px;
}

.service-grid--dashboard .service-row__copy p {
  margin-top: 6px;
  max-width: 17ch;
  font-size: 0.88rem;
  line-height: 1.45;
}

.event-row {
  padding: 14px 14px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
}

.event-row__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.92rem;
}

.event-row__icon--ok {
  color: #b3ffd0;
  background: rgba(34, 197, 94, 0.14);
}

.event-row__icon--warning {
  color: #ffd998;
  background: rgba(245, 158, 11, 0.14);
}

.event-row__icon--danger {
  color: #ffc4c4;
  background: rgba(239, 68, 68, 0.14);
}

.event-row__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.event-row__top strong {
  font-size: 0.94rem;
  line-height: 1.35;
}

.event-row__top time {
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.84rem;
}

.event-row__content p {
  margin: 4px 0 0;
  font-size: 0.85rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.action-button {
  min-height: 58px;
  padding: 0 14px;
  font-weight: 800;
  text-align: left;
  color: var(--text);
  line-height: 1.25;
}

.chart-shell {
  height: 320px;
  margin-top: 18px;
}

.chart-shell--dashboard {
  height: 100%;
  min-height: 360px;
}

.monitoring-stage {
  position: relative;
  min-height: 360px;
  margin-top: 12px;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.01)),
    linear-gradient(90deg, rgba(34, 211, 238, 0.02), transparent 30%);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.monitoring-stage .chart-shell {
  margin-top: 0;
  padding: 18px 18px 10px;
}

.chart-shell canvas,
.chart-shell--dashboard canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-shell canvas.is-dimmed {
  opacity: 0.14;
}

.monitoring-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 26px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(9, 14, 25, 0.4), rgba(9, 14, 25, 0.72)),
    linear-gradient(0deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: auto, 100% 54px, 64px 100%;
}

.monitoring-empty.is-hidden {
  display: none;
}

.monitoring-empty__plot {
  position: relative;
  width: min(520px, 100%);
  height: 140px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.08);
  overflow: hidden;
}

.monitoring-empty__plot::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 100% 32px, 52px 100%;
}

.monitoring-empty__line {
  position: absolute;
  inset: auto 18px 18px 18px;
  height: 46px;
  border-radius: 999px;
  opacity: 0.75;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

.monitoring-empty__line--cpu {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 48' fill='none'%3E%3Cpath d='M0 31C18 32 24 14 43 15C67 17 67 36 93 35C115 34 122 11 147 12C170 13 176 29 198 28C224 27 227 12 249 12C278 12 289 28 320 25' stroke='%2322d3ee' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

.monitoring-empty__line--ram {
  bottom: 38px;
  opacity: 0.68;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 48' fill='none'%3E%3Cpath d='M0 27C21 23 35 16 54 18C75 20 84 35 104 34C123 33 134 17 154 18C174 19 186 32 207 31C226 30 241 17 259 18C283 19 296 31 320 28' stroke='%238b5cf6' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

.monitoring-empty__line--disk {
  bottom: 58px;
  opacity: 0.62;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 48' fill='none'%3E%3Cpath d='M0 26C20 26 37 29 54 28C76 28 89 20 108 20C128 20 139 28 157 29C180 30 192 23 210 23C233 23 246 28 267 28C290 28 302 25 320 25' stroke='%2322c55e' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

.monitoring-empty__copy {
  width: min(480px, 100%);
}

.monitoring-empty__copy strong {
  display: block;
  font-size: 1.05rem;
}

.monitoring-empty__copy p {
  margin: 8px 0 0;
  color: var(--muted);
}

.monitor-summary {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.monitor-summary__item {
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 16px;
}

.monitor-summary__copy {
  display: grid;
  gap: 4px;
}

.monitor-summary__copy strong {
  font-size: 1rem;
}

.monitor-summary__copy span {
  color: var(--muted);
  font-size: 0.88rem;
}

.monitor-gauge {
  --gauge-value: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at center, rgba(15, 23, 42, 0.96) 59%, transparent 60%),
    conic-gradient(currentColor calc(var(--gauge-value) * 1%), rgba(148, 163, 184, 0.12) 0);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

.monitor-gauge::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: rgba(9, 14, 25, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.monitor-gauge span {
  position: relative;
  z-index: 1;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.monitor-gauge.is-empty {
  color: var(--muted);
}

.monitor-gauge--cpu {
  color: var(--primary);
}

.monitor-gauge--ram {
  color: var(--purple);
}

.monitor-gauge--disk {
  color: #4ade80;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.toolbar__group--wrap {
  flex-wrap: wrap;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel-muted);
}

.status-strip__left,
.status-strip__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-strip__text {
  color: var(--muted);
  font-size: 0.92rem;
}

.period-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.46);
  color: var(--muted);
  font-weight: 800;
}

.period-button.is-active,
.period-button:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.24);
  background: rgba(34, 211, 238, 0.12);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.status-pill--ok {
  color: #b3ffd0;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.22);
}

.status-pill--warning {
  color: #ffd998;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.22);
}

.status-pill--danger {
  color: #ffc4c4;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.22);
}

.status-pill--accent {
  color: #9cf5ff;
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.22);
}

.status-pill--muted {
  color: var(--muted-strong);
  background: rgba(148, 163, 184, 0.1);
  border-color: var(--border);
}

.empty-state {
  padding: 22px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.18);
  text-align: center;
  color: var(--muted);
}

.empty-state.is-hidden {
  display: none;
}

.detail-list {
  gap: 14px;
}

.detail-list__item {
  padding: 16px 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.detail-list__item strong {
  text-align: right;
}

.chart-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-card {
  padding: 22px;
}

.chart-card--wide {
  grid-column: 1 / -1;
}

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

.service-card {
  padding: 18px;
}

.service-card__name {
  margin: 0 0 4px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
}

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

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

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.terminal-screen {
  margin: 18px 0 0;
  padding: 18px;
  min-height: 220px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.85);
  color: #c8f6d2;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-screen--compact {
  min-height: 88px;
  max-height: 160px;
}

.terminal-screen.is-idle {
  min-height: 74px;
  max-height: 74px;
  color: #b8c7dd;
}

.terminal-screen.is-busy {
  color: #9cf5ff;
}

.terminal-screen.is-error {
  color: #ffc4c4;
}

.stack-grid {
  display: grid;
  gap: 18px;
}

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

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

.form-field {
  display: grid;
  gap: 8px;
}

.form-field span {
  color: var(--muted);
  font-size: 0.92rem;
}

.form-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.46);
  color: var(--text);
}

.notice-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.notice-card--error {
  color: #ffc4c4;
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.1);
}

.site-footer {
  width: 100%;
  margin: 0;
  padding: 10px 28px 26px;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
  max-width: none;
  align-self: stretch;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(340px, calc(100% - 24px));
  height: 100vh;
  padding: 20px;
  transform: translateX(-110%);
  transition: transform var(--transition);
  z-index: 60;
  background: rgba(5, 9, 20, 0.96);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

body.theme-light .mobile-drawer {
  background: rgba(255, 255, 255, 0.96);
}

.mobile-drawer__header,
.mobile-drawer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-drawer__footer {
  margin-top: 22px;
}

.mobile-drawer__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.mobile-drawer__close {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

.drawer-nav {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}

.drawer-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
}

.drawer-nav__icon {
  display: inline-flex;
  color: var(--muted-strong);
}

.drawer-nav__item.is-active {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.22);
  background: rgba(34, 211, 238, 0.1);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  background: rgba(0, 0, 0, 0.48);
  z-index: 50;
}

body.menu-open .mobile-drawer {
  transform: translateX(0);
}

body.menu-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1320px) {
  .site-header__inner {
    padding: 0 22px;
    gap: 18px;
  }

  .brand-mark__text {
    font-size: 1.62rem;
  }

  .nav-link {
    gap: 8px;
    padding: 11px 11px;
    font-size: 0.88rem;
  }

  .header-search.is-open,
  .header-search:focus-within {
    width: 200px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.4fr) minmax(260px, 0.9fr);
  }

}

@media (max-width: 1120px) {
  .site-header__inner {
    grid-template-columns: auto 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-header__tools {
    margin-left: auto;
  }

  .page-hero,
  .hero-card {
    grid-template-columns: 1fr;
  }

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

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .dashboard-panel--services {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .dashboard-panel--monitoring {
    grid-column: 2;
    grid-row: 1;
  }

  .dashboard-side {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 920px) {
  .dashboard-metrics,
  .stat-grid,
  .stat-grid--compact,
  .stat-grid--gpu,
  .service-grid,
  .chart-grid,
  .stack-grid--two,
  .stack-grid--auth {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-panel--services,
  .dashboard-panel--monitoring,
  .dashboard-side {
    grid-column: auto;
    grid-row: auto;
  }

  .site-header__tools {
    gap: 8px;
  }

  .button--ghost,
  .button--secondary {
    min-height: 42px;
  }
}

@media (max-width: 760px) {
  body {
    padding: 0;
  }

  .site-shell {
    width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .site-header__inner,
  .page-shell,
  .site-footer {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-header__inner {
    gap: 14px;
    min-height: 74px;
  }

  .brand-mark__text {
    font-size: 1.32rem;
  }

  .header-search {
    display: none;
  }

  .icon-button__label {
    display: none;
  }

  .dashboard-metrics,
  .stat-grid,
  .stat-grid--dashboard,
  .stat-grid--compact,
  .stat-grid--gpu,
  .chart-grid,
  .stack-grid--two,
  .stack-grid--auth {
    grid-template-columns: 1fr;
  }

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

  .hero-card__identity {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-card__facts {
    grid-template-columns: 1fr;
  }

  .hero-card__fact {
    padding-left: 0;
    border-left: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
  }

  .monitor-summary,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .monitor-summary__item {
    align-items: flex-start;
  }

  .service-grid--dashboard .service-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .service-grid--dashboard .service-row .status-pill {
    grid-column: 2;
    justify-self: flex-start;
  }

  .chart-shell,
  .chart-shell--dashboard {
    height: 280px;
  }

  .panel,
  .metric-card,
  .stat-card,
  .chart-card,
  .page-hero,
  .hero-card {
    padding: 18px;
  }

  .event-row__top,
  .detail-list__item,
  .panel__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-actions--dashboard {
    grid-template-columns: 1fr;
  }

  .detail-list__item strong {
    text-align: left;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar__group {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .status-strip {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .data-table thead {
    display: none;
  }

  .data-table tr {
    padding: 12px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .data-table td {
    border-bottom: 0;
    padding: 6px 0;
  }

  .data-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 4px;
  }
}

@media (max-width: 640px) {
  .service-grid--dashboard {
    grid-template-columns: 1fr;
  }
}
