
:root {
  color-scheme: dark;
  --bg: #050813;
  --bg-soft: #0b1220;
  --panel: rgba(12, 20, 36, .86);
  --panel-strong: rgba(16, 29, 52, .94);
  --text: #eef6ff;
  --muted: #95a8c6;
  --line: rgba(119, 158, 213, .22);
  --line-strong: rgba(128, 184, 255, .42);
  --blue: #5fa8ff;
  --blue-strong: #2f7dff;
  --cyan: #38d8ff;
  --accent: #48f0bd;
  --danger: #ff647c;
  --warn: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, .36);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font: 15px/1.5 Inter, Segoe UI, system-ui, sans-serif;
  background:
    linear-gradient(135deg, rgba(47,125,255,.20), transparent 30%),
    linear-gradient(315deg, rgba(72,240,189,.12), transparent 28%),
    var(--bg);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(119,158,213,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119,158,213,.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.95), transparent 82%);
  animation: gridMove 18s linear infinite;
}
a { color: inherit; }
button, .button {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(95,168,255,.15), rgba(12,20,36,.76));
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
button:hover, .button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 10px 28px rgba(47,125,255,.18);
}
button:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(56,216,255,.72);
  outline-offset: 2px;
}
.primary {
  border: 0;
  color: #03101f;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue), var(--accent));
  box-shadow: 0 14px 36px rgba(47,125,255,.28);
}
.danger { border-color: rgba(255,100,124,.42); color: #ffd1d8; }
.shell { position: relative; max-width: 1220px; margin: 0 auto; padding: 24px; }
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
  animation: fadeDown .45s ease both;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 950;
  text-decoration: none;
  letter-spacing: .01em;
}
.brand span {
  width: 15px;
  height: 15px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--cyan), var(--accent));
  box-shadow: 0 0 28px rgba(56,216,255,.85);
  animation: pulseMark 2.8s ease-in-out infinite;
}
nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
nav a, nav button {
  font-size: 13px;
  padding: 8px 10px;
  background: rgba(10, 18, 32, .68);
  backdrop-filter: blur(10px);
}
.hero {
  min-height: 300px;
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  gap: 28px;
  align-items: end;
  padding: 46px 0;
  animation: fadeUp .55s ease both;
}
.hero h1 {
  max-width: 760px;
  font-size: clamp(40px, 6vw, 76px);
  line-height: .92;
  margin: 8px 0 18px;
  letter-spacing: 0;
  text-wrap: balance;
}
.hero p { max-width: 700px; color: var(--muted); font-size: 17px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent) !important;
  font-weight: 850;
  font-size: 12px !important;
}
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.metric, .card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18,34,62,.88), rgba(8,14,27,.82));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: fadeUp .55s ease both;
}
.metric::before, .card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(255,255,255,.12);
  pointer-events: none;
}
.metric:hover, .card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  transition: transform .2s ease, border-color .2s ease;
}
.metric strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  color: #ffffff;
}
.metric span, .card p, .card small { color: var(--muted); }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-grid { display: grid; gap: 14px; }
.form-grid.inline { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; margin-bottom: 18px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(4, 9, 18, .82);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(56,216,255,.72);
  background: rgba(5, 12, 24, .96);
  box-shadow: 0 0 0 4px rgba(56,216,255,.10);
}
textarea { font-family: Consolas, monospace; }
.notice {
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, rgba(11, 24, 45, .92), rgba(7, 14, 27, .92));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.notice code, td code {
  font-family: Consolas, monospace;
  color: #b7f7df;
  word-break: break-all;
}
.qr {
  width: 196px;
  height: 196px;
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid #d7dee9;
  box-shadow: 0 18px 42px rgba(0,0,0,.25);
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 8px; vertical-align: top; }
tr { transition: background .16s ease; }
tbody tr:hover { background: rgba(95,168,255,.06); }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .08em; }
.badge {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: rgba(255,255,255,.035);
}
.badge.active, .badge.approved { border-color: rgba(72,240,189,.45); color: #7ff0c7; }
.badge.pending { border-color: rgba(255,209,102,.45); color: #ffe08a; }
.badge.disabled, .badge.deleted, .badge.rejected, .badge.detached, .badge.conflict { border-color: rgba(255,100,124,.45); color: #ff9cac; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { display: inline; }
.row-actions button { padding: 7px 9px; font-size: 12px; }
.ghost-button {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin: -2px 0 14px;
  padding: 8px 11px;
  font-size: 12px;
  color: #cfe5ff;
  background: rgba(95,168,255,.10);
}
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}
.server-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(30, 55, 98, .82), rgba(7, 14, 28, .92)),
    radial-gradient(circle at 20% 0%, rgba(56,216,255,.18), transparent 34%);
  box-shadow: var(--shadow);
  animation: fadeUp .55s ease both;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.server-card::after {
  content: "";
  position: absolute;
  inset: -40% auto auto -30%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(56,216,255,.22), transparent 68%);
  opacity: .65;
  transform: translate3d(0,0,0);
  transition: transform .35s ease, opacity .35s ease;
  pointer-events: none;
}
.server-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56,216,255,.52);
  box-shadow: 0 28px 95px rgba(0,0,0,.44), 0 0 50px rgba(47,125,255,.12);
}
.server-card:hover::after {
  transform: translate3d(36px, 24px, 0);
  opacity: .95;
}
.server-head {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  z-index: 1;
}
.server-head h2 { margin: 0; font-size: 20px; }
.server-head p { margin: 2px 0 0; color: var(--muted); }
.server-icon-wrap {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.16);
  background: #08101f;
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
}
.server-icon {
  width: 58px;
  height: 58px;
  max-width: 58px;
  max-height: 58px;
  min-width: 58px;
  min-height: 58px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
}
.server-metrics {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
  z-index: 1;
}
.mini-metric {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(119,158,213,.18);
  border-radius: 8px;
  background: rgba(5, 12, 24, .46);
}
.mini-metric strong { font-size: 22px; line-height: 1; color: #fff; }
.mini-metric span { color: var(--muted); font-size: 12px; }
.server-details {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid rgba(119,158,213,.16);
  border-radius: 8px;
  background: rgba(3, 8, 17, .38);
  z-index: 1;
}
.server-details span { color: var(--muted); }
.server-details strong { min-width: 0; overflow-wrap: anywhere; }
.server-log {
  position: relative;
  list-style: none;
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 14px 0;
  z-index: 1;
}
.log-title {
  position: relative;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  z-index: 1;
}
.server-log li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(119,158,213,.12);
  background: rgba(255,255,255,.028);
}
.server-log span { color: var(--muted); font-size: 12px; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 14, .72);
  backdrop-filter: blur(12px);
  animation: fadeIn .16s ease both;
}
.modal-backdrop[hidden] { display: none; }
.modal-panel {
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18,34,62,.98), rgba(7,14,28,.98));
  box-shadow: 0 32px 120px rgba(0,0,0,.62), 0 0 80px rgba(47,125,255,.16);
  animation: modalPop .18s ease both;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 2px 0 4px; font-size: 26px; }
.modal-head p { margin: 0; color: var(--muted); }
.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.modal-tools {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.025);
}
.modal-table {
  overflow: auto;
  padding: 0 18px 18px;
}
.modal-table table { min-width: 760px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseMark { 0%,100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.12); filter: brightness(1.22); } }
@keyframes gridMove { from { background-position: 0 0, 0 0; } to { background-position: 44px 44px, 44px 44px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media(max-width:800px) {
  .hero, .grid.two, .form-grid.inline { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .server-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .server-head { grid-template-columns: 52px 1fr; }
  .server-head .badge { grid-column: 1 / -1; justify-self: start; }
  .modal-tools { grid-template-columns: 1fr; }
  header { align-items: flex-start; flex-direction: column; }
}
