:root {
  --bg-0: #060c1b;
  --bg-1: #0f1a34;
  --bg-2: #152548;
  --line-1: #2f466d;
  --line-2: #38537f;
  --text-0: #f2f7ff;
  --text-1: #d7e6ff;
  --text-2: #a5badb;
  --accent: #52a7ff;
  --accent-2: #f9bc51;
  --danger: #d54848;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI Variable Display", "Bahnschrift", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text-0);
}
body { background: var(--bg-0); min-height: 100vh; }
.bg-layer {
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(84, 165, 255, 0.30), transparent 36%),
    radial-gradient(circle at 96% 16%, rgba(249, 188, 81, 0.22), transparent 30%),
    radial-gradient(circle at 40% 90%, rgba(61, 119, 255, 0.18), transparent 35%),
    linear-gradient(168deg, var(--bg-0), var(--bg-1) 55%, #1a2b51);
  z-index: -1;
}
.hidden { display: none !important; }
.page { min-height: 100vh; width: 100%; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: min(820px, 100%);
  border: 1px solid var(--line-1);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}
.auth-brand h1 { margin: 0; font-size: 2rem; letter-spacing: 0.03em; text-transform: uppercase; }
.auth-brand p { margin: 0.2rem 0 1rem; color: var(--text-2); }
.app-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex; justify-content: space-between; align-items: end;
  padding: 1.2rem 1.5rem 1rem; border-bottom: 1px solid var(--line-1);
  background: rgba(5, 10, 22, 0.80); backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand h1 { margin: 0; font-size: 1.5rem; letter-spacing: 0.04em; color: var(--text-0); text-transform: uppercase; }
.brand p { margin: 0.2rem 0 0; font-size: 0.9rem; color: var(--text-2); }
.session {
  font-size: 0.86rem;
  color: var(--text-1);
  border: 1px solid var(--line-1);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  background: rgba(12, 22, 46, 0.85);
}
.topbar-actions { display: flex; gap: 0.5rem; align-items: center; }
.app-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.8rem 1.1rem 0.2rem;
  max-width: 1800px;
  width: 100%;
  margin: 0 auto;
}
.nav-btn {
  background: linear-gradient(180deg, #162746, #101d38);
  border-color: #3f5a88;
  color: var(--text-1);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
}
.nav-btn.active {
  background: linear-gradient(180deg, #4d9dff, #2d75ef);
  border-color: #75b9ff;
  color: #f5fbff;
}
.view-stack {
  flex: 1;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0.9rem 1.1rem 1.2rem;
}
.view {
  width: 100%;
}
.dashboard-grid,
.mods-grid,
.users-grid {
  display: grid;
  gap: 1.1rem;
  width: 100%;
}
.dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}
.mods-grid { grid-template-columns: 1fr; }
.users-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.panel {
  background: linear-gradient(180deg, rgba(10, 18, 37, 0.88), rgba(12, 22, 46, 0.86));
  border: 1px solid var(--line-1);
  border-radius: 16px;
  padding: 1rem 1.05rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  min-width: 0;
}
.dashboard-main {
  grid-column: span 8;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}
.panel-overview { grid-column: span 8; }
.panel-updates { grid-column: span 4; }
.panel-stats { grid-column: span 8; }
.panel-mods { grid-column: span 1; }
.panel-players { grid-column: span 8; }
.panel-admins { grid-column: span 4; }
h2 {
  margin: 0.15rem 0 0.9rem;
  font-size: 1.14rem;
  color: var(--text-0);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
h3 {
  margin: 0.75rem 0 0.45rem;
  font-size: 0.84rem;
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
input, button {
  border-radius: 10px;
  border: 1px solid var(--line-2);
  padding: 0.56rem 0.72rem;
  background: #0f1b33;
  color: var(--text-0);
}
input { width: 100%; }
input::placeholder { color: #87a0c7; }
button {
  cursor: pointer;
  background: linear-gradient(180deg, #3a8fff, #2467eb);
  border-color: #5da9ff;
  color: #f4f9ff;
  font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
button:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 8px 18px rgba(32, 98, 236, 0.35); }
button:active { transform: translateY(0); }
button.ghost { background: linear-gradient(180deg, #1d2f50, #162640); border-color: #455f8d; }
button.danger { background: linear-gradient(180deg, #d54848, #b52b2b); border-color: #f06262; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.msg {
  margin-top: 0.5rem;
  min-height: 1.2rem;
  color: #ffd68f;
  border-left: 3px solid #ffd68f;
  padding-left: 0.45rem;
}
.code {
  white-space: pre-wrap;
  background: #0a1428;
  border: 1px solid #32486f;
  border-radius: 12px;
  padding: 0.65rem;
  font-size: 0.8rem;
  max-height: 240px;
  overflow: auto;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.55rem; }
.card {
  border: 1px solid #334d77;
  border-radius: 12px;
  background: linear-gradient(180deg, #142443, #101d37);
  padding: 0.62rem;
}
.panel-overview {
  padding: 0.75rem 0.85rem 0.65rem;
}
.panel-overview h2 {
  margin: 0.05rem 0 0.5rem;
}
.panel-overview #overview.cards {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.4rem;
}
.panel-overview .metric-card {
  min-height: 58px;
  padding: 0.45rem;
}
.panel-overview .row {
  margin-top: 0.4rem;
}
.panel-overview .msg {
  margin-top: 0.35rem;
  min-height: 0;
}
.panel-overview #maintResult.code {
  display: none;
  max-height: 120px;
  margin-top: 0.4rem;
  padding: 0.5rem;
  font-size: 0.76rem;
}
.panel-overview #maintResult.code.has-content {
  display: block;
}
.card strong {
  color: #9fc6ff;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.metric-card {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
  border-color: #416297;
}
.metric-value {
  font-size: 0.9rem;
  color: var(--text-0);
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  border: 1px solid #2a3f64;
  border-radius: 10px;
  overflow: hidden;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}
.table th {
  text-align: left;
  color: #98b9eb;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #0e1b35;
}
.table th, .table td {
  border-bottom: 1px solid #2f456d;
  padding: 0.42rem;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.table tr:nth-child(even) td { background: rgba(16, 29, 54, 0.45); }
.table td pre { margin: 0; white-space: pre-wrap; }
.panel-players .table {
  font-size: 0.79rem;
}
.badge { display: inline-block; border-radius: 999px; padding: 0.1rem 0.45rem; border: 1px solid #4a6698; font-size: 0.72rem; }
.badge.ok { background: #11381f; border-color: #27a45e; }
.badge.warn { background: #382b12; border-color: #caa037; }
.badge.err { background: #3d1717; border-color: #d65757; }
a { color: #8cc3ff; text-decoration: none; border-bottom: 1px dotted rgba(140,195,255,0.55); }
a:hover { color: #b9ddff; border-bottom-style: solid; }
img.mod-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid #30496f; }
.mod-cell { display: flex; gap: 0.5rem; align-items: flex-start; max-width: 420px; }
.muted { color: #9fb2d1; font-size: 0.78rem; }
.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}
.mod-grid-lg {
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
}
.mod-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 0.8rem;
  border: 1px solid #35527f;
  border-radius: 14px;
  background: linear-gradient(180deg, #12213f, #0e1a33);
  padding: 0.75rem;
}
.mod-card .mod-thumb {
  width: 112px;
  height: 112px;
  border-radius: 10px;
}
.mod-body { min-width: 0; }
.mod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.mod-head h4 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}
.mod-summary {
  margin: 0.38rem 0;
  color: var(--text-1);
  font-size: 0.88rem;
  line-height: 1.35;
}
.mod-health-reason {
  margin: 0.1rem 0 0.45rem;
  color: #9db6da;
  font-size: 0.78rem;
  line-height: 1.35;
}
.mod-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
  font-size: 0.78rem;
  color: var(--text-2);
}
.mod-actions {
  margin-top: 0.45rem;
}
.mod-actions a {
  border: 1px solid #3e5d90;
  border-radius: 9px;
  padding: 0.3rem 0.5rem;
  background: #10203c;
  font-size: 0.76rem;
}
.upload-progress {
  margin-top: 0.45rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}
.upload-progress-track {
  width: 100%;
  height: 14px;
  background: #11203d;
  border: 1px solid #35527f;
  border-radius: 999px;
  overflow: hidden;
}
.upload-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #3f8eff, #54c2ff);
  transition: width .18s ease;
}
.upload-progress-text {
  font-size: 0.78rem;
  color: #d0e3ff;
  min-width: 64px;
  text-align: right;
}
@media (max-width: 1200px) {
  .dashboard-grid,
  .users-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-main { grid-column: span 1; }
  .panel-overview, .panel-players, .panel-mods, .panel-updates, .panel-admins, .panel-stats { grid-column: span 1; }
  .panel-overview #overview.cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mod-grid-lg {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  }
}
@media (max-width: 700px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 0.7rem; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .app-nav {
    overflow-x: auto;
    padding-top: 0.7rem;
    padding-bottom: 0.1rem;
  }
  .nav-btn {
    white-space: nowrap;
  }
  .dashboard-grid,
  .users-grid { grid-template-columns: 1fr; }
  .dashboard-main { grid-column: span 1; }
  .panel-overview, .panel-players, .panel-mods, .panel-updates, .panel-admins, .panel-stats { grid-column: span 1; }
  .panel-overview #overview.cards {
    grid-template-columns: 1fr;
  }
  .mod-grid { grid-template-columns: 1fr; }
  .mod-card { grid-template-columns: 76px 1fr; }
  .mod-card .mod-thumb { width: 76px; height: 76px; }
  .upload-progress {
    grid-template-columns: 1fr;
  }
  .upload-progress-text {
    text-align: left;
  }
}

