:root {
  --bg: #060711;
  --bg-deep: #090a14;
  --bg-elev: #0e1120;
  --panel: rgba(15, 18, 34, 0.82);
  --panel-solid: #111528;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(190, 194, 255, 0.13);
  --line-strong: rgba(163, 132, 255, 0.35);
  --text: #f8f7ff;
  --muted: #9da2ba;
  --subtle: #6d728d;
  --accent: #8c52ff;
  --accent-strong: #b14cff;
  --accent-2: #3ed5ff;
  --danger: #ff5d7b;
  --ok: #49df91;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.24);
  --radius: 22px;
  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(900px 600px at 0% -10%, rgba(126, 57, 255, 0.23), transparent 60%),
    radial-gradient(800px 540px at 100% 0%, rgba(31, 194, 255, 0.13), transparent 58%),
    radial-gradient(700px 520px at 72% 110%, rgba(218, 42, 255, 0.08), transparent 62%),
    linear-gradient(180deg, #090a17 0%, #060711 100%);
  z-index: 0;
}
.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: .42;
}
.ambient::before {
  width: 420px;
  height: 420px;
  top: 20%;
  right: -180px;
  border: 1px solid rgba(65, 210, 255, .16);
  box-shadow: 0 0 0 40px rgba(65, 210, 255, .025), 0 0 0 80px rgba(65, 210, 255, .018);
}
.ambient::after {
  width: 300px;
  height: 300px;
  bottom: -180px;
  left: 22%;
  border: 1px solid rgba(170, 78, 255, .16);
  box-shadow: 0 0 0 40px rgba(170, 78, 255, .025), 0 0 0 80px rgba(170, 78, 255, .018);
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100vh;
  min-height: 560px;
  padding: 22px 16px 18px;
  overflow-y: auto;
  border-right: 1px solid rgba(186, 187, 255, .12);
  background: linear-gradient(180deg, rgba(10, 11, 24, .94), rgba(7, 8, 17, .88));
  box-shadow: 18px 0 60px rgba(0, 0, 0, .12);
  backdrop-filter: blur(26px);
  scrollbar-width: thin;
  scrollbar-color: rgba(154, 112, 255, .35) transparent;
  z-index: 30;
}
.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 40%;
  background: linear-gradient(180deg, rgba(173, 93, 255, .75), transparent);
}
.sidebar-close { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 8px 10px 17px;
  border-bottom: 1px solid rgba(190, 194, 255, .08);
}
.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(181, 145, 255, .28);
  border-radius: 16px;
  background: #0b0d1c;
  box-shadow: 0 12px 28px rgba(100, 43, 255, .28);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .16), transparent 42%);
  pointer-events: none;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.1;
  letter-spacing: -.035em;
}
.brand span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .73rem;
  letter-spacing: .02em;
}

.nav {
  display: grid;
  gap: 5px;
}
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: 12px;
  padding: 9px 12px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #9ea2b7;
  font-size: .88rem;
  font-weight: 600;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(154, 84, 255, .13), transparent 72%);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  border-color: rgba(190, 194, 255, .08);
  transform: translateX(2px);
}
.nav a:hover::after { opacity: 1; }
.nav a.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(125, 66, 255, .24), rgba(44, 202, 255, .07));
  border-color: rgba(147, 104, 255, .34);
  box-shadow: inset 3px 0 0 #9c61ff, 0 8px 24px rgba(95, 46, 255, .09);
}
.nav a.active::after { opacity: 1; }
.nav-icon {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(158, 121, 255, .16);
  border-radius: 9px;
  color: #cdbbff;
  background: rgba(139, 103, 255, .10);
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.nav-icon svg { width: 16px; height: 16px; stroke: currentColor; }
.nav a.active .nav-icon {
  color: #fff;
  background: linear-gradient(135deg, rgba(154, 87, 255, .72), rgba(52, 188, 255, .35));
  border-color: rgba(207, 182, 255, .36);
}
.nav-label { position: relative; z-index: 1; }

.sidebar-foot { display: grid; gap: 10px; margin-top: auto; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid rgba(190, 194, 255, .10);
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
}
.user-avatar {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #fff;
  font-size: .73rem;
  font-weight: 800;
  background: linear-gradient(135deg, #8d52ff, #32c9ff);
}
.user-chip strong { display: block; color: var(--text); font-size: .78rem; }
.user-chip small { display: block; margin-top: 2px; color: var(--subtle); font-size: .69rem; }

.main {
  width: 100%;
  max-width: 1600px;
  min-width: 0;
  padding: clamp(22px, 3.2vw, 48px) clamp(18px, 4vw, 64px) 56px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .19em;
  line-height: 1.2;
  text-transform: uppercase;
}
.topbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  letter-spacing: -.055em;
  line-height: 1.05;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 800;
  line-height: 1;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.btn:focus-visible,
.nav a:focus-visible,
.sidebar-close:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 3px solid rgba(62, 213, 255, .28); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #733dff, #a24dff 55%, #2d9fff);
  box-shadow: 0 12px 28px rgba(107, 55, 255, .27);
}
.btn.primary:hover { box-shadow: 0 15px 34px rgba(107, 55, 255, .37); }
.btn.soft { color: var(--text); background: rgba(255, 255, 255, .055); border-color: var(--line); }
.btn.soft:hover { background: rgba(255, 255, 255, .085); border-color: var(--line-strong); }
.btn.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
.btn.danger { color: #ff9aae; background: rgba(255, 77, 109, .12); border-color: rgba(255, 77, 109, .35); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 8px 12px; font-size: .78rem; }

.grid { display: grid; gap: 18px; }
.grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); }
.grid.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(20, 24, 45, .82), rgba(11, 14, 28, .82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: rgba(157, 126, 255, .26); }
.card h2, .card h3 { margin: 0 0 8px; font-family: var(--font-display); letter-spacing: -.035em; }
.card p.lead { margin: 0 0 18px; color: var(--muted); line-height: 1.6; }
.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid rgba(139, 103, 255, .27);
  border-radius: var(--radius);
  background:
    radial-gradient(260px 180px at 91% 20%, rgba(52, 198, 255, .13), transparent 70%),
    linear-gradient(110deg, rgba(124, 60, 255, .19), rgba(32, 200, 255, .045)),
    rgba(15, 18, 34, .84);
  box-shadow: var(--shadow);
}
.hero-card h2 { margin: 0 0 8px; font: 700 1.55rem/1.1 var(--font-display); letter-spacing: -.05em; }
.hero-card p:not(.eyebrow) { margin: 0; color: var(--muted); }
.stat { min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(151, 113, 255, .22);
  border-radius: 12px;
  color: #d8ccff;
  background: linear-gradient(135deg, rgba(124, 60, 255, .25), rgba(32, 200, 255, .12));
}
.stat-icon svg { width: 19px; height: 19px; stroke: currentColor; }
.stat .label { color: var(--muted); font-size: .86rem; }
.stat .value { font-family: var(--font-display); font-size: 2.35rem; letter-spacing: -.06em; }
.stat .hint { color: var(--accent-2); font-size: .78rem; }

.flash { margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; }
.flash.ok { background: rgba(61, 220, 132, .10); border-color: rgba(61, 220, 132, .3); }
.flash.error { background: rgba(255, 77, 109, .10); border-color: rgba(255, 77, 109, .3); }
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; gap: 8px; }
.form-row.inline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { color: var(--muted); font-size: .79rem; font-weight: 800; letter-spacing: .02em; }
input[type="text"], input[type="password"], input[type="url"], input[type="number"], input[type="file"], select, textarea {
  width: 100%;
  min-height: 47px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--text);
  background: rgba(3, 5, 14, .38);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input::placeholder, textarea::placeholder { color: #666b84; }
input:focus, select:focus, textarea:focus { border-color: rgba(139, 103, 255, .75); background: rgba(8, 9, 23, .68); box-shadow: 0 0 0 3px rgba(124, 60, 255, .16); }
.check { display: flex; align-items: center; gap: 10px; margin-top: 28px; color: var(--text); }
.table-wrap { overflow: auto; border: 1px solid rgba(190, 194, 255, .07); border-radius: 15px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .73rem; letter-spacing: .08em; text-transform: uppercase; }
td code { color: var(--accent-2); font-size: .82rem; }
.badge { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.badge.on { color: var(--ok); background: rgba(61, 220, 132, .15); }
.badge.off { color: var(--muted); background: rgba(255, 255, 255, .06); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.preview { position: relative; min-height: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #0a0e14; }
.preview img { width: 100%; height: 180px; object-fit: cover; }
.preview.logo img { padding: 24px; object-fit: contain; background: radial-gradient(circle at center, #151b26, #0a0e14); }
.preview .caption { position: absolute; left: 12px; bottom: 12px; padding: 6px 10px; border-radius: 999px; color: #fff; background: rgba(0, 0, 0, .55); font-size: .74rem; }
.preview.empty { display: grid; place-items: center; color: var(--muted); }
.asset-block { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(0, 0, 0, .18); }
.asset-block h3 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -.02em; }
.asset-current { color: var(--muted); word-break: break-all; }
.asset-current a { color: var(--accent-2); }
.color-preview { height: 72px; margin-top: 4px; border: 1px solid var(--line); border-radius: 16px; }
input[type="color"] { width: 100%; height: 48px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, .28); cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.api-box { padding: 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--accent-2); background: rgba(0, 0, 0, .35); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .83rem; word-break: break-all; }

.login-page {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 32px 22px;
}
.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .13;
  background: linear-gradient(115deg, rgba(6, 7, 17, .9), rgba(6, 7, 17, .55)), url("../../uploads/wallpaper_login_1786664675.jpg") center / cover;
  filter: saturate(1.1) blur(1px);
}
.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  align-items: center;
  gap: clamp(38px, 8vw, 110px);
  width: min(1050px, 100%);
}
.login-showcase { max-width: 500px; padding: 8px 0; }
.login-showcase .showcase-mark {
  width: 86px;
  height: 86px;
  margin-bottom: 26px;
  overflow: hidden;
  border: 1px solid rgba(181, 145, 255, .3);
  border-radius: 25px;
  box-shadow: 0 20px 48px rgba(92, 35, 255, .28);
}
.showcase-mark img { width: 100%; height: 100%; object-fit: cover; }
.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #c9baff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.login-badge::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--accent-2); box-shadow: 0 0 0 5px rgba(62, 213, 255, .1); }
.login-showcase h2 { margin: 0 0 18px; font-family: var(--font-display); font-size: clamp(2.7rem, 5vw, 4.6rem); letter-spacing: -.075em; line-height: .98; }
.login-showcase h2 span { color: #ae73ff; }
.login-showcase > p { max-width: 430px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.7; }
.login-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 470px; margin-top: 36px; }
.login-point { padding: 13px 12px; border: 1px solid rgba(190, 194, 255, .10); border-radius: 14px; background: rgba(255, 255, 255, .035); }
.login-point strong { display: block; color: var(--text); font-size: .75rem; }
.login-point span { display: block; margin-top: 4px; color: var(--subtle); font-size: .68rem; }
.login-card {
  width: 100%;
  padding: 30px;
  border: 1px solid rgba(173, 148, 255, .19);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(17, 20, 39, .96), rgba(10, 12, 25, .92));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  backdrop-filter: blur(20px);
}
.login-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 23px; color: var(--muted); font-size: .73rem; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--ok); box-shadow: 0 0 0 5px rgba(73, 223, 145, .1); }
.login-version { margin-left: auto; color: var(--subtle); font-size: .67rem; }
.login-brand { display: none; width: 74px; height: 74px; margin: 0 0 18px; overflow: hidden; border-radius: 21px; box-shadow: 0 16px 38px rgba(92, 35, 255, .28); }
.login-brand img { width: 100%; height: 100%; object-fit: cover; }
.login-card h1 { margin: 0 0 9px; font-family: var(--font-display); font-size: 2.1rem; letter-spacing: -.06em; line-height: 1; }
.login-card p { margin: 0 0 25px; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.login-card .eyebrow { margin-bottom: 8px; color: #a58cff; }
.login-card .form-grid { gap: 16px; }
.login-card .form-row { gap: 8px; }
.login-card input { min-height: 50px; padding-left: 15px; background: rgba(4, 5, 13, .46); }
.login-card .btn { min-height: 50px; margin-top: 4px; }
.login-foot { display: block; margin-top: 22px; color: #70758e; font-size: .7rem; text-align: center; }

.nav-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
  .main { padding-right: 30px; padding-left: 30px; }
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .grid.cards, .preview-grid { grid-template-columns: 1fr; }
  .login-layout { gap: 48px; }
}

@media (max-width: 860px) {
  .layout { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(318px, 88vw);
    min-height: 100dvh;
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.22, .8, .25, 1);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: inline-grid; place-items: center; position: absolute; top: 20px; right: 16px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: rgba(255, 255, 255, .04); cursor: pointer; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 20; border: 0; background: rgba(1, 2, 8, .68); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  body.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .nav-toggle { display: inline-flex; }
  .main { padding: 22px 18px 42px; }
  .topbar { align-items: flex-start; margin-bottom: 24px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .topbar-actions .btn { flex: 0 0 auto; }
  .hero-card { align-items: flex-start; flex-direction: column; padding: 23px; }
  .login-layout { grid-template-columns: 1fr; width: min(520px, 100%); }
  .login-showcase { display: none; }
  .login-brand { display: block; }
  .login-card { padding: 29px 26px; }
}

@media (max-width: 540px) {
  .main { padding: 18px 13px 34px; }
  .topbar { gap: 14px; }
  .topbar h1 { font-size: 1.75rem; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .btn { min-height: 42px; padding: 9px 12px; font-size: .77rem; }
  .grid.stats { grid-template-columns: 1fr; gap: 12px; }
  .card, .hero-card { padding: 18px; border-radius: 18px; }
  .hero-card h2 { font-size: 1.32rem; }
  .hero-card .btn { width: 100%; }
  .login-page { padding: 18px 13px; }
  .login-card { padding: 25px 19px; border-radius: 21px; }
  .login-card h1 { font-size: 1.9rem; }
  .form-row.inline { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
  .preview-grid { gap: 12px; }
  .table-wrap { margin-right: -2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
