:root {
  --bg: #06090f;
  --panel: #0e1520;
  --line: rgba(60, 153, 212, 0.28);
  --blue: #3c99d4;
  --text: #eef4fa;
  --mute: #8fa3b8;
  --danger: #ff6b7a;
  --ok: #3dcf8e;
  --font: "Sora", sans-serif;
  --display: "Chakra Petch", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 100% 0%, rgba(60, 153, 212, 0.16), transparent 50%),
    var(--bg);
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem;
  display: grid;
  gap: 0.75rem;
}

.auth-card img {
  width: 100%;
  border-radius: 12px;
}

.auth-card h1 {
  margin: 0;
  font-family: var(--display);
}

.auth-card p,
.muted,
.hint {
  color: var(--mute);
  font-size: 0.9rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #081018;
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

button,
.ghost {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: var(--blue);
  color: #041018;
  font-weight: 700;
  cursor: pointer;
}

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #080d15;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--display);
}

.sidebar .brand img {
  width: 36px;
}

.sidebar .brand span {
  color: var(--blue);
}

.sidebar nav {
  display: grid;
  gap: 0.4rem;
  flex: 1;
}

.sidebar nav button {
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  text-align: left;
  border-radius: 12px;
}

.sidebar nav button.active,
.sidebar nav button:hover {
  border-color: var(--line);
  background: rgba(60, 153, 212, 0.12);
}

.main {
  padding: 1rem clamp(1rem, 2vw, 1.75rem) 2rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.topbar h2 {
  margin: 0;
  font-family: var(--display);
}

.topbar p {
  margin: 0.2rem 0 0;
  color: var(--mute);
}

.panel {
  display: none;
}

.panel.active {
  display: grid;
  gap: 1rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.stat strong {
  display: block;
  font-size: 1.5rem;
  font-family: var(--display);
}

.stat span {
  color: var(--mute);
  font-size: 0.85rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.card h3 {
  margin: 0 0 0.8rem;
  font-family: var(--display);
}

.form {
  display: grid;
  gap: 0.65rem;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 0.65rem;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid rgba(60, 153, 212, 0.12);
  vertical-align: top;
}

th {
  color: var(--mute);
  font-weight: 500;
}

.toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  background: #122033;
  border: 1px solid var(--line);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  transition: transform 0.25s ease;
  z-index: 20;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow: auto;
    flex: initial;
  }

  .split,
  .stats,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}
