:root {
  --bg: #f3f6fb;
  --paper: rgba(255, 255, 255, 0.86);
  --paper-strong: rgba(255, 255, 255, 0.97);
  --paper-tint: rgba(244, 248, 255, 0.92);
  --font-ui: "Segoe UI Variable", "Bahnschrift", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Trebuchet MS", sans-serif;
  --ink: #162235;
  --muted: #66758c;
  --line: rgba(23, 47, 89, 0.11);
  --accent: #2557b7;
  --accent-strong: #173a7a;
  --accent-soft: rgba(37, 87, 183, 0.1);
  --teal: #0d8d92;
  --teal-soft: rgba(13, 141, 146, 0.11);
  --amber: #df9128;
  --amber-soft: rgba(223, 145, 40, 0.12);
  --shadow: 0 24px 60px rgba(14, 31, 62, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(80, 136, 228, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(13, 141, 146, 0.08), transparent 26%),
    radial-gradient(circle at bottom left, rgba(223, 145, 40, 0.08), transparent 24%),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
  filter: blur(10px);
}

body::before {
  top: -12vw;
  right: -10vw;
  width: 38vw;
  height: 38vw;
  background: radial-gradient(circle, rgba(64, 124, 224, 0.14) 0%, rgba(64, 124, 224, 0) 70%);
}

body::after {
  left: -12vw;
  bottom: -14vw;
  width: 34vw;
  height: 34vw;
  background: radial-gradient(circle, rgba(223, 145, 40, 0.12) 0%, rgba(223, 145, 40, 0) 72%);
}

button,
input,
select {
  font: inherit;
}

body[data-page="monitoring"] #monitoring-load,
body[data-page="nas"] #nas-load {
  display: none;
}

.picker-proxy {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
}

.body--blocking-open {
  overflow: hidden;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(13, 24, 46, 0.34);
  backdrop-filter: blur(6px);
}

.loading-overlay[hidden] {
  display: none;
}

.loading-overlay__panel {
  width: min(420px, 100%);
  padding: 28px 24px;
  border: 1px solid rgba(23, 47, 89, 0.12);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 248, 255, 0.96));
  box-shadow: 0 30px 80px rgba(14, 31, 62, 0.24);
  text-align: center;
}

.loading-overlay__spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border: 4px solid rgba(37, 87, 183, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-overlay-spin 0.9s linear infinite;
}

.loading-overlay__panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.loading-overlay__message {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.export-picker {
  position: relative;
  display: inline-flex;
}

.export-picker__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 240px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.96));
  box-shadow: 0 20px 40px rgba(16, 34, 66, 0.14);
}

.export-picker__panel label {
  min-width: 0;
}

.export-picker__actions {
  justify-content: flex-end;
  margin-top: 10px;
}

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

.page-login {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(1380px, 100%);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 24px;
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px 18px 24px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.app-topbar,
.panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--paper-strong), var(--paper-tint));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel {
  padding: 24px;
}

.page-protected {
  background:
    radial-gradient(circle at top left, rgba(80, 136, 228, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(13, 141, 146, 0.08), transparent 26%),
    radial-gradient(circle at bottom left, rgba(223, 145, 40, 0.08), transparent 24%),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
}

.page-protected::before,
.page-protected::after {
  display: block;
}

.page-protected .panel {
  background: linear-gradient(180deg, var(--paper-strong), var(--paper-tint));
  border-color: var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.page-protected .panel::before {
  height: 3px;
  opacity: 0.75;
  background: linear-gradient(90deg, rgba(37, 87, 183, 0.68), rgba(13, 141, 146, 0.45), rgba(223, 145, 40, 0.55));
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, rgba(37, 87, 183, 0.68), rgba(13, 141, 146, 0.45), rgba(223, 145, 40, 0.55));
  opacity: 0.75;
  pointer-events: none;
  z-index: 0;
}

.app-topbar > *,
.login-hero > *,
.panel > * {
  position: relative;
  z-index: 1;
}

.login-hero,
.login-panel {
  min-height: 100%;
}

.login-hero {
  display: grid;
  align-content: space-between;
  gap: 24px;
}

.login-panel {
  max-width: 460px;
  justify-self: end;
}

.login-hero,
.app-topbar {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(135deg, #102749 0%, #1b447e 55%, #235890 100%);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 64px rgba(13, 29, 57, 0.22);
}

.login-hero {
  background: linear-gradient(180deg, #162033 0%, #0f1727 100%);
  border-color: rgba(15, 23, 42, 0.75);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
}

.login-hero::before,
.app-topbar::before {
  background: linear-gradient(90deg, rgba(255, 214, 156, 0.85), rgba(126, 214, 255, 0.7), rgba(255, 255, 255, 0.5));
}

.login-hero::after,
.app-topbar::after {
  content: "";
  position: absolute;
  right: -56px;
  bottom: -64px;
  width: 220px;
  height: 220px;
  border-radius: 42px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  transform: rotate(22deg);
  pointer-events: none;
}

.login-hero::before,
.app-topbar::before {
  pointer-events: none;
}

.app-topbar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px;
  margin-bottom: 0;
  min-height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  position: sticky;
  top: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  align-self: start;
}

.page-protected .app-topbar {
  background: linear-gradient(180deg, #162033 0%, #0f1727 100%);
  border-color: rgba(15, 23, 42, 0.75);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
}

.page-protected .app-topbar::after {
  display: none;
}

.app-brand {
  display: grid;
  gap: 12px;
}

.app-brand h1,
.login-hero h1,
.panel__head h2,
.panel h3 {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.app-brand h1,
.login-hero h1 {
  font-size: clamp(1.9rem, 2.8vw, 2.8rem);
}

.hero-copy,
.muted {
  color: var(--muted);
}

.login-hero .hero-copy,
.login-hero .muted,
.app-topbar .muted {
  color: rgba(237, 244, 255, 0.8);
}

.hero-copy {
  margin: 0;
  max-width: 54ch;
  line-height: 1.7;
}

.eyebrow,
.panel__eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.login-hero .eyebrow,
.app-topbar .eyebrow {
  color: rgba(255, 219, 167, 0.9);
}

.login-hero h1,
.app-topbar h1,
.app-topbar h2,
.app-topbar h3,
.login-hero .status-card strong,
.app-topbar .status-inline strong,
.app-topbar .pill,
.app-topbar .app-nav__link.is-active,
.app-topbar .button--ghost {
  color: #f8fbff;
}

.page-grid {
  display: grid;
  gap: 20px;
  min-width: 0;
  align-content: start;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.dashboard-grid > .panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.app-nav {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.app-nav__link {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(23, 47, 89, 0.1);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.app-nav__link.is-active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-color: transparent;
  color: #fff7f1;
}

.app-topbar .app-nav__link {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(243, 248, 255, 0.84);
  box-shadow: none;
}

.app-topbar .app-nav__link:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.app-topbar .app-nav__link.is-active {
  background: linear-gradient(180deg, #4d79ff 0%, #305bda 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(32, 73, 184, 0.28);
}


.app-meta {
  display: grid;
  gap: 12px;
  justify-items: stretch;
  margin-top: auto;
}

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

.status-card,
.status-inline {
  border-radius: 18px;
  border: 1px solid rgba(23, 47, 89, 0.09);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.status-card {
  padding: 18px;
}

.status-inline {
  width: 100%;
  padding: 14px 16px;
}

.page-protected .status-inline {
  border-color: rgba(124, 143, 179, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.page-protected .app-topbar .status-inline {
  display: none;
}

.app-meta .auth-meta {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.app-meta .auth-meta .button {
  width: 100%;
}

.login-hero .status-card,
.app-topbar .status-inline {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(7, 20, 41, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.status-card__label,
.status-inline__label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.login-hero .status-card__label,
.app-topbar .status-inline__label {
  color: rgba(255, 214, 156, 0.9);
}

.login-hero .status-card small,
.app-topbar .status-inline small {
  color: rgba(237, 244, 255, 0.72);
}

.status-card strong,
.status-inline strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.status-card small,
.status-inline small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

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

.panel__head--stacked {
  align-items: stretch;
}

.toolbar,
.button-row,
.auth-form,
.auth-meta,
.split,
.inline-form {
  display: flex;
  gap: 12px;
}

.toolbar,
.auth-form,
.inline-form,
.button-row,
.auth-meta {
  flex-wrap: wrap;
}

.auth-meta {
  align-items: center;
}

.auth-meta--stacked {
  align-items: flex-start;
}

.dashboard-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.dashboard-link-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  min-height: 156px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid rgba(23, 47, 89, 0.08);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.dashboard-link-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #4f86de);
}

.dashboard-link-card:nth-child(2) {
  background: #ffffff;
}

.dashboard-link-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--teal), #26a7a2);
}

.dashboard-link-card:nth-child(3) {
  background: #ffffff;
}

.dashboard-link-card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--amber), #c56918);
}

.dashboard-link-card:hover {
  border-color: rgba(23, 47, 89, 0.14);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.page-protected .dashboard-link-card {
  border-color: rgba(23, 47, 89, 0.08);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.page-protected .dashboard-link-card:hover {
  border-color: rgba(23, 47, 89, 0.14);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.dashboard-link-card strong {
  font-size: 1.15rem;
  line-height: 1.4;
}

.dashboard-link-card__tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  width: fit-content;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-link-card:nth-child(2) .dashboard-link-card__tag {
  background: var(--teal-soft);
  color: #0b6c73;
}

.dashboard-link-card:nth-child(3) .dashboard-link-card__tag {
  background: var(--amber-soft);
  color: #9a5b14;
}

.page-protected .dashboard-link-card__meta,
.page-protected .panel-link {
  color: var(--muted);
}

.page-protected .dashboard-link-card__tag {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.page-protected .dashboard-link-card:nth-child(2) .dashboard-link-card__tag {
  background: var(--teal-soft);
  color: #0b6c73;
}

.page-protected .dashboard-link-card:nth-child(3) .dashboard-link-card__tag {
  background: var(--amber-soft);
  color: #9a5b14;
}

.dashboard-link-card__meta,
.panel-link {
  color: var(--muted);
}

.dashboard-link-card__meta {
  line-height: 1.6;
}

.dashboard-panel--wide {
  grid-column: 1 / -1;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 0;
}

.dashboard-grid .dashboard-metrics {
  flex: 1 1 auto;
}

.metric-card {
  position: relative;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(23, 47, 89, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.dashboard-grid .metric-card {
  display: flex;
  flex-direction: column;
  min-height: 136px;
  height: 100%;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, rgba(37, 87, 183, 0.78), rgba(13, 141, 146, 0.45));
}

.dashboard-metrics .metric-card:nth-child(3n) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 241, 0.96));
}

.dashboard-metrics .metric-card:nth-child(3n)::before {
  background: linear-gradient(90deg, rgba(223, 145, 40, 0.82), rgba(197, 105, 24, 0.5));
}

.page-protected .metric-card {
  border-color: rgba(23, 47, 89, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.page-protected .metric-card::before {
  background: linear-gradient(90deg, rgba(37, 87, 183, 0.78), rgba(13, 141, 146, 0.45));
}

.page-protected .dashboard-metrics .metric-card:nth-child(3n)::before {
  background: linear-gradient(90deg, rgba(223, 145, 40, 0.82), rgba(197, 105, 24, 0.5));
}

.metric-card__label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.page-protected .metric-card__label {
  color: var(--accent-strong);
}

.metric-card__value {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  font-weight: 700;
}

.metric-card__meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.dashboard-grid .metric-card__meta {
  margin-top: auto;
  padding-top: 10px;
}

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

.panel-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(23, 47, 89, 0.1);
  background: rgba(243, 247, 252, 0.92);
}

.auth-form {
  margin-top: 8px;
}

.auth-form--stacked {
  display: grid;
  gap: 14px;
}

.auth-form label,
.toolbar label {
  display: grid;
  gap: 6px;
  min-width: 140px;
}

.button-row {
  align-items: center;
}

.toolbar {
  margin-bottom: 16px;
}

.toolbar__wide {
  flex: 1 1 320px;
}

.checkbox {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  min-width: auto !important;
  padding-top: 22px;
}

.checkbox input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

input,
select {
  min-height: 42px;
  border: 1px solid rgba(23, 47, 89, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  padding: 0 14px;
  color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input:hover,
select:hover {
  border-color: rgba(37, 87, 183, 0.22);
}

input:focus,
select:focus {
  outline: 2px solid rgba(37, 87, 183, 0.14);
  border-color: rgba(37, 87, 183, 0.42);
  box-shadow: 0 0 0 4px rgba(37, 87, 183, 0.08);
}

.button {
  min-height: 42px;
  border: none;
  border-radius: 999px;
  padding: 0 18px;
  color: #f8fbff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 10px 24px rgba(37, 87, 183, 0.2);
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(37, 87, 183, 0.24);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button--ghost {
  color: var(--ink);
  border: 1px solid rgba(23, 47, 89, 0.1);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.app-topbar .button--ghost {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
}

.page-protected input,
.page-protected select {
  border-color: rgba(23, 47, 89, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.page-protected .button {
  box-shadow: 0 12px 24px rgba(32, 73, 184, 0.24);
}

.page-protected .button--ghost {
  color: var(--ink);
  border-color: rgba(23, 47, 89, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

.button--wide {
  width: 100%;
  justify-content: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(23, 47, 89, 0.08);
}

.app-topbar .pill {
  background: rgba(255, 255, 255, 0.14);
}

.split {
  align-items: flex-start;
}

.split > * {
  flex: 1 1 0;
  min-width: 0;
}

.list-card,
.summary-card,
.table-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.page-protected .list-card,
.page-protected .summary-card,
.page-protected .table-shell {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.summary-card {
  min-height: 64px;
  padding: 14px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.list-card {
  min-height: 160px;
  max-height: 520px;
  overflow: auto;
}

.list-card--compact {
  min-height: 240px;
}

.list-group__empty {
  margin: 0;
  padding: 0 16px 16px;
}

.list-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item.is-active {
  background: rgba(37, 87, 183, 0.1);
}

.page-protected .list-item.is-active {
  background: rgba(37, 87, 183, 0.1);
}

.list-item__meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.body--modal-open {
  overflow: hidden;
}

.nas-root-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 16px;
}

.nas-root-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.nas-root-card__header .metric-card__value {
  margin-top: 6px;
}

.nas-root-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nas-root-card__stat {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(37, 87, 183, 0.08);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 600;
}

.nas-root-card__stat--warning {
  background: rgba(223, 145, 40, 0.18);
  color: #7a4a09;
}

.nas-root-card__stat--danger {
  background: rgba(194, 58, 58, 0.16);
  color: #a12a2a;
}

.nas-root-card__list {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.nas-result-item {
  transition: background 120ms ease, transform 120ms ease;
}

.nas-result-item:hover {
  background: rgba(236, 243, 255, 0.78);
}

.nas-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(13, 24, 44, 0.38);
  backdrop-filter: blur(8px);
}

.nas-modal[hidden] {
  display: none;
}

.nas-modal__panel:not(.monitoring-preview__panel) {
  width: min(1420px, calc(100vw - 40px));
  height: min(860px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nas-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 12px;
}

.nas-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nas-modal__filter {
  min-height: 36px;
  padding-top: 0;
  padding-inline: 12px;
  border-radius: 999px;
  border: 1px solid rgba(23, 47, 89, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

.nas-modal__body {
  padding: 0 22px 22px;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

.nas-modal__table {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 0 0 1px rgba(23, 47, 89, 0.03);
  scrollbar-gutter: stable;
  contain: paint;
}

.nas-preview-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 10px;
  min-height: 42px;
}

.nas-preview-pager[hidden] {
  display: none;
}

.nas-preview-pager .button {
  min-height: 36px;
  padding: 0 14px;
}

.nas-preview-pager__info {
  min-width: 190px;
  text-align: center;
  font-size: 0.92rem;
}

.table-shell {
  overflow: auto;
}

.nas-preview-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.nas-preview-grid__header,
.nas-preview-grid__cell {
  min-width: 150px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.nas-preview-grid__header {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(233, 240, 252, 0.99), rgba(225, 235, 249, 0.99));
  color: var(--accent-strong);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  z-index: 2;
}

.nas-preview-grid__body tr:nth-child(even) .nas-preview-grid__cell {
  background: rgba(246, 249, 255, 0.9);
}

.nas-preview-grid__body tr:hover .nas-preview-grid__cell {
  background: rgba(233, 242, 255, 0.96);
}

.nas-preview-grid__body .nas-preview-grid__cell:first-child {
  min-width: 180px;
  font-weight: 600;
}

.nas-preview-grid__body tr.nas-preview-grid__row--danger .nas-preview-grid__cell {
  background: rgba(196, 42, 63, 0.14);
  color: #7f1d1d;
}

.nas-preview-grid__body tr.nas-preview-grid__row--danger:hover .nas-preview-grid__cell {
  background: rgba(196, 42, 63, 0.18);
}

.nas-preview-grid__body tr.nas-preview-grid__row--warning .nas-preview-grid__cell {
  background: rgba(223, 145, 40, 0.18);
  color: #6d430b;
}

.nas-preview-grid__body tr.nas-preview-grid__row--warning:hover .nas-preview-grid__cell {
  background: rgba(223, 145, 40, 0.22);
}

.nas-preview-grid__body tr.nas-preview-grid__row--danger .nas-preview-grid__cell--status,
.nas-preview-grid__body tr.nas-preview-grid__row--warning .nas-preview-grid__cell--status {
  font-weight: 700;
}

.nas-preview-grid__cell--status-danger {
  color: #b42318;
}

.nas-preview-grid__cell--status-warning {
  color: #9a6700;
}

.nas-preview-grid__cell {
  color: #20304a;
  font-size: 0.94rem;
  line-height: 1.55;
}

.monitoring-group-shell {
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.monitoring-preview__panel {
  width: min(980px, calc(100vw - 40px));
}

.monitoring-preview__table {
  overflow: auto;
  max-height: min(62vh, 720px);
}

.monitoring-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.monitoring-root-card__list {
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.monitoring-root-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.monitoring-root-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.monitoring-root-card__button {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.monitoring-result-item {
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}

.monitoring-result-item:hover {
  background: rgba(236, 243, 255, 0.78);
}

.monitoring-result-item--warning {
  background: rgba(223, 145, 40, 0.18);
}

.monitoring-result-item--warning .list-item__meta:last-child {
  color: #6d430b;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

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

.table-row--warning td {
  background: rgba(223, 145, 40, 0.18);
  color: #6d430b;
}

.table-row--warning td:last-child {
  font-weight: 700;
}

th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.98), rgba(238, 244, 253, 0.98));
  color: var(--accent-strong);
  z-index: 1;
}

.page-protected th {
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.98), rgba(238, 244, 253, 0.98));
  color: var(--accent-strong);
}

.page-protected td {
  color: inherit;
}

.inline-form {
  margin-bottom: 12px;
}

.inline-form input {
  flex: 1 1 140px;
}

.login-hint {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  color: #f8fbff;
  background: rgba(18, 31, 57, 0.96);
  box-shadow: var(--shadow);
}

@keyframes loading-overlay-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .login-shell,
  .dashboard-menu,
  .dashboard-grid,
  .dashboard-preview-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-topbar {
    position: static;
    min-height: auto;
    max-height: none;
  }

  .login-panel {
    max-width: none;
    justify-self: stretch;
  }

  .dashboard-panel--wide {
    grid-column: auto;
  }

  .app-meta {
    margin-top: 0;
  }

  .status-inline {
    width: 100%;
  }

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

  .split {
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .nas-root-grid {
    grid-template-columns: 1fr;
  }

  .nas-root-card__list {
    min-height: 0;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .page-login {
    padding: 16px;
  }

  .app-shell {
    padding: 16px 12px 28px;
  }

  .app-nav {
    grid-template-columns: 1fr;
  }

  .nas-modal {
    padding: 12px;
  }

  .nas-modal__panel:not(.monitoring-preview__panel) {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
  }

  .nas-modal__head,
  .nas-modal__body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .nas-modal__actions {
    width: 100%;
  }

  .nas-modal__actions .button {
    flex: 1 1 0;
  }

  .nas-preview-pager {
    justify-content: center;
    flex-wrap: wrap;
  }

  .nas-preview-pager__info {
    width: auto;
    text-align: center;
  }

  .app-shell {
    padding: 16px 12px 32px;
  }

  .panel,
  .app-topbar {
    padding: 18px;
  }

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

  .panel__head {
    flex-direction: column;
  }

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

  .auth-meta,
  .button-row {
    align-items: stretch;
  }
}
