:root {
  --ink: #eef3fb;
  --muted: #93a0b8;
  --paper: #070b14;
  --card: rgba(18, 26, 42, .78);
  --line: rgba(120, 160, 220, .16);
  --accent: #4d8dff;
  --accent-2: #3b6cff;
  --cyan: #3ee0c6;
  --violet: #8b7cff;
  --ok: #3dd68c;
  --warn: #ffb020;
  --bad: #ff5d73;
  --silver: #d5deea;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --radius: 18px;
  --sidebar: 268px;
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 480px at -10% -20%, rgba(77, 141, 255, .28), transparent 50%),
    radial-gradient(700px 420px at 110% 0%, rgba(62, 224, 198, .12), transparent 46%),
    radial-gradient(600px 400px at 80% 110%, rgba(139, 124, 255, .1), transparent 50%),
    linear-gradient(180deg, #0b1220 0%, #070b14 40%, #060910 100%);
  background-attachment: fixed;
  display: flex;
}

body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 30% 20%, #000 20%, transparent 75%);
}

a { color: var(--accent); }
h2 { font-size: 15px; margin: 0 0 14px; color: #f3f7ff; font-weight: 600; letter-spacing: .01em; }

.sidebar, .main { position: relative; z-index: 1; }

.sidebar {
  width: var(--sidebar);
  background: linear-gradient(180deg, rgba(14, 22, 38, .92) 0%, rgba(8, 12, 22, .94) 100%);
  backdrop-filter: blur(22px);
  color: #e8eef5;
  min-height: 100vh;
  position: sticky;
  top: 0;
  padding: 20px 16px 24px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 40px rgba(0, 0, 0, .25);
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 8px; }
.brand-logo {
  width: min(100%, 220px);
  height: auto;
  display: block;
  background: transparent !important;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
  mix-blend-mode: normal;
  filter: drop-shadow(0 8px 24px rgba(61, 120, 255, .25));
}
.sidebar .brand-logo { max-height: 168px; }
.login-hero .brand-logo, .login-card .brand-logo { max-height: 240px; width: min(280px, 100%); }
.brand-text { text-align: center; }
.brand-text strong {
  display: none;
}
.wh-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(77, 141, 255, .12);
  border: 1px solid rgba(77, 141, 255, .28);
  color: #cfe0ff; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
}
.wh-chip::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
}
.brand-slogan {
  margin: 4px 0 22px;
  color: #7d8ca6;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-align: center;
}
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar nav a {
  color: #c3cede; text-decoration: none; padding: 10px 12px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  transition: background .15s, color .15s, transform .15s;
}
.sidebar nav a svg { width: 18px; height: 18px; opacity: .8; flex-shrink: 0; }
.sidebar nav a:hover { background: rgba(77, 141, 255, .1); color: #fff; transform: translateX(2px); }
.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(77, 141, 255, .28), rgba(62, 224, 198, .08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(77, 141, 255, .35);
}
.sidebar nav a.active svg { opacity: 1; color: var(--cyan); }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  margin: 16px 18px 0; padding: 12px 16px;
  background: rgba(12, 18, 32, .65);
  border: 1px solid var(--line);
  border-radius: 16px;
  position: sticky; top: 12px; z-index: 5;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.quicksearch { display: flex; flex: 1; max-width: 640px; }
.quicksearch input {
  flex: 1; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px;
  padding: 11px 14px; font-size: 15px; background: rgba(7, 12, 22, .7); color: var(--ink);
}
.quicksearch input:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: rgba(77, 141, 255, .55); box-shadow: 0 0 0 3px rgba(77, 141, 255, .15);
}
.quicksearch button {
  border: 0; background: linear-gradient(135deg, #5a9bff, #3b6cff); color: #fff;
  padding: 0 18px; border-radius: 0 12px 12px 0; cursor: pointer; font-weight: 600;
}
.who { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
.who a { color: #cfe0ff; text-decoration: none; font-weight: 600; }
.who a:hover { color: #fff; }
.wh-switch label { flex-direction: row; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.wh-switch select { min-width: 160px; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: linear-gradient(135deg, #4d8dff, #3ee0c6); color: #071018;
}

.content { padding: 22px 24px 36px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow {
  margin: 0 0 6px; color: var(--cyan); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; font-weight: 600;
}
h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.03em; color: #f7faff; font-weight: 700; }
.lead { color: var(--muted); margin: 0 0 8px; }

.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.stat {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center;
}
.stat::after {
  content: ""; position: absolute; right: -30px; top: -40px; width: 120px; height: 120px;
  border-radius: 50%; background: radial-gradient(circle, rgba(77,141,255,.22), transparent 70%);
}
.stat-icon {
  grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #4d8dff, #2f5bff);
  box-shadow: 0 8px 18px rgba(47, 91, 255, .3);
}
.stat.tone-cyan .stat-icon { background: linear-gradient(135deg, #3ee0c6, #1aa58f); box-shadow: 0 8px 18px rgba(62,224,198,.25); }
.stat.tone-warn .stat-icon { background: linear-gradient(135deg, #ffb020, #e08900); box-shadow: 0 8px 18px rgba(255,176,32,.25); }
.stat.tone-violet .stat-icon { background: linear-gradient(135deg, #8b7cff, #5b4de0); box-shadow: 0 8px 18px rgba(139,124,255,.25); }
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 700; color: #eaf3fb; letter-spacing: -.03em; }
.stat.warn .v { color: var(--warn); }
.stat.bad .v { color: var(--bad); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
tr:hover td { background: rgba(77, 141, 255, .07); }
.thumb { width: 48px; height: 48px; object-fit: contain; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; }
.sku { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; font-weight: 700; color: #8eb6ff; }

.btn, button.btn, input[type=submit] {
  display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #5a9bff, #3b6cff); color: #fff;
  padding: 10px 16px; border-radius: 12px; text-decoration: none; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 22px rgba(59, 108, 255, .28);
  transition: transform .12s, filter .12s;
}
.btn:hover, button.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn.secondary { background: rgba(255,255,255,.05); color: var(--silver); border: 1px solid var(--line); box-shadow: none; }
.btn.danger { background: var(--bad); }
.btn.ok { background: linear-gradient(135deg, #3dd68c, #1f9d5c); box-shadow: 0 8px 18px rgba(61, 214, 140, .22); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }

.form { display: grid; gap: 12px; max-width: 820px; }
.form.two { grid-template-columns: 1fr 1fr; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.check-row { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--ink); }
.check-row input { width: auto; margin-top: 3px; }
input, select, textarea {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit;
  color: var(--ink); background: rgba(7, 12, 22, .65);
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { min-width: 160px; }

.badge { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.low { background: rgba(255, 176, 32, .16); color: #ffb020; }
.badge.ok { background: rgba(61, 214, 140, .16); color: #3dd68c; }
.badge.empty { background: rgba(255, 93, 115, .16); color: #ff8a9a; }
.badge.kit { background: rgba(77, 141, 255, .16); color: #9bb8ff; }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; }
.flash-ok { background: rgba(61, 214, 140, .16); color: #b8f5d4; }
.flash-err { background: rgba(255, 93, 115, .16); color: #ffc1c8; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a { padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); background: rgba(18,26,42,.7); }
.pager a.active { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }

.login-wrap {
  min-height: 100vh; width: 100%; display: grid; place-items: center;
  grid-template-columns: 1fr 1fr; gap: 0;
  background:
    radial-gradient(800px 500px at 15% 20%, rgba(77, 141, 255, .28), transparent 55%),
    radial-gradient(700px 400px at 90% 80%, rgba(62, 224, 198, .12), transparent 50%),
    #070b14;
}
.login-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 32px; min-height: 100vh; text-align: center;
}
.login-hero h2 { font-size: 28px; margin: 12px 0 6px; }
.login-card {
  width: min(440px, 92vw); background: rgba(14, 22, 38, .82); border: 1px solid var(--line);
  border-radius: 22px; padding: 32px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 60px rgba(59, 108, 255, .12);
  backdrop-filter: blur(18px);
  margin: 40px auto;
}
.login-card .brand { margin-bottom: 8px; }
.login-card h1 { margin-bottom: 4px; font-size: 26px; }
.hero-img { width: 120px; height: 120px; object-fit: contain; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 16px; }

.split { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.muted { color: var(--muted); }
.install ol { line-height: 1.6; }

@media (max-width: 1100px) {
  .grid.stats, .split, .form.two, .login-wrap { grid-template-columns: 1fr; }
  body { flex-direction: column; }
  .sidebar { width: 100%; min-height: auto; position: relative; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .brand { max-width: 280px; margin: 0 auto; }
  .login-hero { min-height: auto; padding: 28px 20px 0; }
}
