:root {
  --bg: #050813;
  --shell: #080d19;
  --panel: #0d1424;
  --panel-2: #111c31;
  --panel-3: #16243d;
  --line: rgba(112, 165, 255, .16);
  --line-strong: rgba(104, 199, 255, .38);
  --blue: #58c7ff;
  --blue-2: #216dff;
  --text: #ecf5ff;
  --muted: #8ca4c2;
  --soft: #c9dcf4;
  --red: #ff5c7a;
  --green: #77d98b;
  --yellow: #ffcf70;
  --violet: #a78bfa;
  --shadow: 0 24px 80px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -8%, rgba(33,109,255,.28), transparent 34%),
    radial-gradient(circle at 94% 2%, rgba(88,199,255,.16), transparent 28%),
    linear-gradient(180deg, #050813, #070b14 42%, #050813);
  color: var(--text);
  font-family: Inter, ui-sans-serif, Segoe UI, Arial, sans-serif;
}

h1, h2, h3 { margin: 0; letter-spacing: 0; }
p { color: var(--muted); line-height: 1.55; }
button, input, textarea, select { font: inherit; }

.login {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
}

.login-logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  margin: 0 auto 8px;
  filter: drop-shadow(0 18px 50px rgba(88,199,255,.35));
}

.app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

aside {
  border-right: 1px solid var(--line);
  background: rgba(8, 13, 25, .86);
  backdrop-filter: blur(16px);
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

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

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand strong { display: block; font-size: 17px; }
.meta { color: var(--muted); font-size: 13px; }

.nav-section {
  margin: 18px 0 8px;
  padding: 0 10px;
  color: #5f789b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

nav button, .nav-toggle {
  width: 100%;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
  padding: 11px 12px;
  text-align: left;
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
}

nav button i, .nav-toggle i { width: 18px; text-align: center; }
nav button.active, nav button:hover, .nav-toggle:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(88,199,255,.08);
}

.nav-group.open .chev { transform: rotate(90deg); }
.subnav { display: none; padding-left: 18px; }
.nav-group.open .subnav { display: block; }
.chev { margin-left: auto; transition: transform .16s ease; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(5,8,19,.62);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 3;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13,20,36,.78);
}
.avatar { width: 42px; height: 42px; border-radius: 8px; image-rendering: pixelated; }
.skin { width: 92px; height: 184px; image-rendering: pixelated; object-fit: contain; }

.content { padding: 28px 30px 42px; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.columns { grid-template-columns: 390px minmax(0, 1fr); align-items: start; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: linear-gradient(180deg, rgba(17,28,49,.94), rgba(11,17,31,.94));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 14px 42px rgba(0,0,0,.18);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-title h2, .card-title h3 { display: flex; align-items: center; gap: 10px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-size: 31px; margin-top: 6px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #08111f;
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(88,199,255,.1); }

.button, button {
  border: 1px solid var(--line);
  background: #0c182c;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mini {
  padding: 6px 8px;
  min-width: 32px;
  min-height: 30px;
  justify-content: center;
  font-size: 13px;
}
.button:hover, button:hover { border-color: var(--line-strong); }
.primary { border-color: rgba(88,199,255,.72); background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #001224; font-weight: 850; }
.danger { border-color: rgba(255,92,122,.48); color: var(--red); }
.good { border-color: rgba(119,217,139,.45); color: var(--green); }
.ghost { background: transparent; }

.list { display: grid; gap: 8px; }
.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(29,51,89,.75);
  border-radius: 10px;
  background: rgba(8,17,31,.62);
  cursor: pointer;
}
.row:hover { border-color: var(--blue); background: rgba(88,199,255,.07); }
.row-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: rgba(88,199,255,.1); color: var(--blue); }

.badge {
  color: var(--blue);
  border: 1px solid rgba(88,199,255,.35);
  background: rgba(88,199,255,.08);
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.badge.red { color: var(--red); border-color: rgba(255,92,122,.4); background: rgba(255,92,122,.08); }
.badge.green { color: var(--green); border-color: rgba(119,217,139,.4); background: rgba(119,217,139,.08); }
.badge.yellow { color: var(--yellow); border-color: rgba(255,207,112,.42); background: rgba(255,207,112,.08); }
.badge.violet { color: var(--violet); border-color: rgba(167,139,250,.45); background: rgba(167,139,250,.08); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-hero { display: grid; grid-template-columns: 128px 1fr; gap: 20px; align-items: center; }
.profile-name { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.kv div { border: 1px solid var(--line); border-radius: 10px; padding: 11px; background: rgba(8,17,31,.45); }
.kv span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid rgba(29,51,89,.65); padding: 11px 10px; vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.68);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}
.modal.hidden { display: none; }
.dialog {
  width: min(780px, 100%);
  max-height: min(82vh, 860px);
  overflow: auto;
  background: linear-gradient(180deg, #111c31, #08111f);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.dialog form { display: grid; gap: 12px; margin-top: 16px; }
.dialog .footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  aside { position: static; height: auto; }
  .stats, .columns, .two, .three, .kv, .profile-hero { grid-template-columns: 1fr; }
  header { align-items: flex-start; gap: 12px; flex-direction: column; }
}
