:root {
  --bg: #0a0c10;
  --bg-elev: #10141b;
  --panel: #12171f;
  --panel-2: #181e28;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #eef1f6;
  --muted: #8b95a8;
  --accent: #e879f9;
  --accent-2: #22d3ee;
  --accent-3: #facc15;
  --accent-ink: #1a0a22;
  --warn: #f0b429;
  --danger: #ff6b6b;
  --discord: #5865f2;
  --sidebar: 248px;
  --radius: 14px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Syne", "DM Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(232, 121, 249, 0.14), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(34, 211, 238, 0.08), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
}

button, input, select, a { font: inherit; }
.hidden { display: none !important; }
.mobile-only { display: none; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(400px, 100%);
  background: rgba(18, 23, 31, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: rise 0.45s var(--ease);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.login-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(232, 121, 249, 0.35));
}

.brand {
  margin: 0;
  color: var(--accent);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
}

.login-card h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.sub { margin: 8px 0 22px; color: var(--muted); line-height: 1.45; }

.login-card label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.login-card input,
.search {
  width: 100%;
  background: #0a0c10;
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 13px;
  outline: none;
}

.login-card input:focus,
.search:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

.login-card button {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  background: linear-gradient(135deg, var(--accent), #c026d3);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.login-card button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(232, 121, 249, 0.28);
}

.discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 12px;
  padding: 12px;
  background: var(--discord);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
}

.discord-btn.disabled { pointer-events: none; opacity: 0.45; }
.hint, .error { margin-top: 14px; font-size: 13px; line-height: 1.45; }
.hint { color: var(--muted); }
.hint code { color: var(--text); font-family: var(--mono); font-size: 12px; }
.error { color: var(--danger); }
.password-form { margin-top: 16px; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px;
  background: rgba(10, 12, 16, 0.88);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
  z-index: 20;
}

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

.side-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 4px;
  filter: drop-shadow(0 0 12px rgba(232, 121, 249, 0.25));
}

.side-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.side-brand small {
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 6px;
  flex: 1;
  align-content: start;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), transform 0.22s var(--ease);
}

.nav-btn .nav-ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-btn.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
}

.nav-btn.active .nav-ico {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0c10;
}

.nav-btn span {
  display: grid;
  gap: 2px;
}

.nav-btn strong {
  font-size: 14px;
  font-weight: 600;
}

.nav-btn em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.side-foot {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.user-box { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #243044;
}
.avatar-fallback { background: linear-gradient(145deg, #2a3444, #1a2230); }
.user-name { font-size: 13px; font-weight: 600; }
.user-rank { font-size: 11px; color: var(--accent); }

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: rgba(10, 12, 16, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: -0.03em;
}

.page-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search { width: min(320px, 42vw); }

.ghost, .icon-btn {
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 11px;
  padding: 9px 12px;
  cursor: pointer;
}

.icon-btn { padding: 8px 10px; }
.ghost:hover, .icon-btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.ghost.danger { color: #ff8d87; border-color: rgba(255, 107, 107, 0.35); }
.ghost:disabled { opacity: 0.55; cursor: default; }

.content {
  padding: 20px 24px 48px;
  flex: 1;
}

.view { animation: rise 0.4s var(--ease); }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.dash-hero {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.dash-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  min-height: 92px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.dash-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  pointer-events: none;
}

.dash-card:hover { transform: translateY(-2px); }
.dash-card.ok { border-color: rgba(34, 211, 238, 0.3); }
.dash-card.warn { border-color: rgba(250, 204, 21, 0.4); }

.dash-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.dash-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.1;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dash-metric {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.dash-metric-value {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
}

.dash-foot {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

.log-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c, #d5d8de);
}

.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active {
  color: #0a0c10;
  background: var(--c, #d5d8de);
  border-color: transparent;
  font-weight: 650;
}
.chip.active i { background: #0a0c10; }

.feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: 140px 120px 1fr;
  gap: 14px;
  align-items: start;
  background: rgba(18, 23, 31, 0.72);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 14px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.row:hover {
  border-color: var(--line);
  background: rgba(24, 30, 40, 0.9);
  transform: translateX(2px);
}

.time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding-top: 3px;
}

.badge {
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border-radius: 999px;
  padding: 5px 9px;
}

.msg { margin: 0; line-height: 1.45; }
.ids {
  margin: 5px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.empty {
  margin: 8px 0;
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  background: rgba(18, 23, 31, 0.65);
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.panel-head span { color: var(--muted); font-size: 12px; }

.devo-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: rgba(18, 23, 31, 0.8);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.devo-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.devo-form textarea {
  width: 100%;
  background: #0a0c10;
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 72px;
  font-family: var(--font);
}

.devo-form label small {
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

.upd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.upd-form .span-2 { grid-column: 1 / -1; }

.upd-form input,
.upd-form select,
.upd-form textarea {
  width: 100%;
  background: #0a0c10;
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.upd-form input:focus,
.upd-form select:focus,
.upd-form textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px rgba(232, 121, 249, 0.12);
}

.upd-form select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 11px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.upd-preview {
  min-width: 0;
}

.upd-preview-card {
  background:
    radial-gradient(500px 180px at 100% 0%, rgba(232, 121, 249, 0.12), transparent 55%),
    linear-gradient(180deg, #1a2030, #12171f);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 20px;
  position: sticky;
  top: 88px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  transition: border-color 0.25s var(--ease);
}

.upd-preview-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.upd-preview-head img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.upd-preview-head strong {
  display: block;
  font-size: 14px;
}

.upd-preview-head span {
  color: var(--muted);
  font-size: 12px;
}

.upd-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 10px;
}

.upd-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.upd-preview-card h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.upd-meta {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.upd-meta code {
  font-family: var(--mono);
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.1);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
}

.upd-sec {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-left: 3px solid var(--sec, var(--accent));
}

.upd-sec.added { --sec: #e879f9; }
.upd-sec.changed { --sec: #22d3ee; }
.upd-sec.fixed { --sec: #facc15; }
.upd-sec.removed { --sec: #ff6b6b; }
.upd-sec.notes { --sec: #a78bfa; }

.upd-sec strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.upd-sec ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.upd-sec li { margin: 4px 0; line-height: 1.45; }
.upd-sec p { margin: 0; color: var(--muted); line-height: 1.5; }
.upd-img {
  width: 100%;
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}
.muted { color: var(--muted); }

.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.org-card {
  background: rgba(18, 23, 31, 0.85);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.org-card-top {
  display: grid;
  gap: 4px;
}

.org-card-top strong {
  font-size: 15px;
}

.org-card-top code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.org-card-meta {
  color: var(--muted);
  font-size: 12px;
}

.org-card .org-dissolve {
  justify-self: start;
}

@media (max-width: 980px) {
  .upd-layout { grid-template-columns: 1fr; }
  .upd-preview-card { position: static; }
}

.devo-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  align-items: center;
}

.devo-actions button[type="submit"] {
  border: 0;
  border-radius: 11px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent), #c026d3);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.devo-actions button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(232, 121, 249, 0.25);
}

.devo-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  min-height: 1.2em;
}

.devo-status a {
  color: var(--accent-2);
  text-decoration: none;
}

.devo-status a:hover { text-decoration: underline; }

.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.logo-card {
  background: rgba(18, 23, 31, 0.85);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
}

.logo-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: #07090c;
}

.logo-preview img {
  max-width: 78%;
  max-height: 78%;
  object-fit: contain;
}

.logo-meta {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.logo-meta strong { font-size: 14px; }
.logo-meta span { color: var(--muted); font-size: 12px; }
.logo-meta a.ghost {
  display: inline-flex;
  width: fit-content;
  text-decoration: none;
}

.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 15;
}

@media (max-width: 1180px) {
  .dash-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.28s var(--ease);
    width: min(280px, 86vw);
    box-shadow: var(--shadow);
  }
  .shell.nav-open .sidebar { transform: none; }
  .mobile-only { display: inline-flex; }
  .dash-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .search { width: min(220px, 40vw); }
}

@media (max-width: 640px) {
  .content { padding: 16px; }
  .topbar { padding: 14px 16px; flex-wrap: wrap; }
  .dash-hero, .dash-grid, .devo-form { grid-template-columns: 1fr; }
  .dash-value { font-size: 22px; }
  .search { width: 100%; }
}
