@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0");

:root {
  --color-primary: #e54d5e;
  --color-primary-hover: #c93d4e;
  --color-accent: #6366f1;
  --color-accent-hover: #8b5cf6;
  --color-accent-light: #a855f7;
  --color-error: #ef4444;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --grad-brand: linear-gradient(135deg, #e54d5e, #a855f7);
  --color-bg: #0b0e14;
  --color-bg-alt: #111520;
  --color-bg-subtle: #111520;
  --color-surface: #161b22;
  --color-card: #161b22;
  --color-sidebar: #10141e;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-text-main: #e6e6ef;
  --color-text-muted: #a1a1aa;
  --surface-2: #1c2230;
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 14px;
  --radius-control: 9px;
  --grid-line: rgba(255, 255, 255, 0.06);
  --grid-size: 32px;
  --sidebar-w: 220px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--color-bg);
  color: var(--color-text-main);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
}

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

button,
input {
  font: inherit;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 20px;
  line-height: 1;
  user-select: none;
}

.icon-fill {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

.hidden {
  display: none !important;
}

/* Login */
.login-shell {
  min-height: 100dvh;
  display: flex;
}

.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-form {
  width: 100%;
  max-width: 384px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(to bottom right, #e54d5e, #c93d4e);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.brand-word {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-form h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.login-sub {
  margin: 6px 0 28px;
  color: var(--color-text-muted);
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

input[type="password"],
input[type="text"],
input[type="search"],
textarea {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-main);
  padding: 0 12px;
  outline: none;
}

textarea {
  height: 140px;
  padding: 12px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.hint {
  font-size: 12px;
  color: rgba(161, 161, 170, 0.6);
  margin-top: 6px;
}

.error {
  color: #ef4444;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-control);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.btn-primary {
  width: 100%;
  color: #fff;
  background: var(--grad-brand);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  color: var(--color-primary);
}

.forgot {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: 14px;
  color: var(--color-text-muted);
}

.forgot:hover {
  color: var(--color-primary);
}

.login-right {
  display: none;
  width: 50%;
  background: linear-gradient(to bottom right, rgba(229, 77, 94, 0.05), rgba(229, 77, 94, 0.03), transparent);
  align-items: center;
  justify-content: center;
  padding: 48px;
}

@media (min-width: 1024px) {
  .login-right {
    display: flex;
  }
}

.login-right-inner {
  max-width: 448px;
}

.login-right h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.login-right p.lead {
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0 0 32px;
}

.feat {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(22, 27, 34, 0.5);
  border: 1px solid var(--color-border);
  margin-bottom: 16px;
}

.feat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(229, 77, 94, 0.1);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feat h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 500;
}

.feat p {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

/* App shell */
.app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--color-sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.traffic {
  display: flex;
  gap: 8px;
  padding: 12px 14px 4px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-r {
  background: #ff5f56;
}
.dot-y {
  background: #ffbd2e;
}
.dot-g {
  background: #27c93f;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 12px;
}

.side-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(to bottom right, #e54d5e, #c93d4e);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.side-title {
  font-size: 14px;
  font-weight: 600;
}

.side-ver {
  font-size: 10px;
  color: var(--color-text-muted);
}

.side-search {
  margin: 0 12px 10px;
  height: 30px;
  font-size: 12px;
  padding-left: 28px;
}

.side-search-wrap {
  position: relative;
  margin: 0 12px 10px;
}

.side-search-wrap .material-symbols-outlined {
  position: absolute;
  left: 8px;
  top: 7px;
  font-size: 16px;
  color: var(--color-text-muted);
}

.nav {
  overflow: auto;
  flex: 1;
  padding: 0 8px 16px;
}

.nav-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(161, 161, 170, 0.6);
  padding: 10px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(22, 27, 34, 0.5);
  color: var(--color-text-main);
}

.nav-item.active {
  background: rgba(229, 77, 94, 0.1);
  color: var(--color-primary);
}

.nav-item .material-symbols-outlined {
  font-size: 18px;
}

.nav-sub {
  font-size: 10px;
  color: rgba(161, 161, 170, 0.6);
  margin-left: auto;
}

.side-foot {
  border-top: 1px solid var(--color-border);
  padding: 8px;
  display: flex;
  gap: 8px;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--color-bg);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(229, 77, 94, 0.1);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header p {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
}

.chip kbd {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

.content {
  overflow: auto;
  padding: 24px 40px 48px;
  max-width: 1400px;
  width: 100%;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.card h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.muted {
  color: var(--color-text-muted);
  font-size: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-21 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.tile {
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  border-radius: 8px;
  padding: 16px;
}

.tile .n {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.tile h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.tile p {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.stat {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: 10px;
  border-bottom: 1px solid var(--color-border);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.badge-warn {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.badge-off {
  background: rgba(161, 161, 170, 0.12);
  color: #a1a1aa;
}

.legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lg i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.topo {
  height: 280px;
  position: relative;
  overflow: hidden;
}

.node {
  position: absolute;
  width: 88px;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-muted);
}

.node span {
  display: flex;
  width: 36px;
  height: 36px;
  margin: 0 auto 6px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--color-border);
}

@media (max-width: 1100px) {
  .grid-2,
  .grid-21,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}
