:root {
  --bg: #0c1226;
  --card: rgba(12, 22, 44, 0.88);
  --card-2: rgba(8, 15, 34, 0.92);
  --line: rgba(138, 174, 255, 0.25);
  --text: #f0f6ff;
  --muted: #98a9c9;
  --primary: #56b6ff;
  --accent: #88ffd4;
  --danger: #ff7f8f;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 20%, #1a2f5f, transparent 34%),
    radial-gradient(circle at 85% 15%, #114b5d, transparent 30%),
    linear-gradient(145deg, #080f22 0%, #0c142b 50%, #0a1326 100%);
  color: var(--text);
  font-family: "Space Grotesk", "Avenir Next", "PingFang SC", "Noto Sans SC", sans-serif;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: auto;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.24;
  pointer-events: none;
  animation: float 9s ease-in-out infinite;
}

.ambient-a {
  left: -80px;
  top: 22vh;
  background: #6ca5ff;
}

.ambient-b {
  right: -60px;
  top: 56vh;
  background: #77ffd5;
  animation-delay: -3s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-24px);
  }
}

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

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

.logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-weight: 700;
  border-radius: 12px;
  color: #081323;
  background: linear-gradient(140deg, var(--primary), var(--accent));
}

h1 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.session {
  font-size: 0.84rem;
  color: #d5e9ff;
  background: rgba(120, 170, 255, 0.14);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
}

.layout {
  max-width: 1200px;
  margin: 20px auto 32px;
  padding: 0 16px;
}

.card {
  background: linear-gradient(150deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 18px;
  padding: 20px;
}

h2,
h3 {
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
  margin: 0 0 12px;
}

.auth-grid,
.split {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  background: rgba(10, 19, 39, 0.8);
  border: 1px solid rgba(130, 165, 243, 0.2);
  border-radius: 14px;
  padding: 16px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.86rem;
  color: #d9e8ff;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  color: var(--text);
  background: rgba(7, 14, 30, 0.92);
  border: 1px solid rgba(130, 165, 243, 0.35);
  border-radius: 10px;
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(86, 182, 255, 0.18);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  color: #09162f;
  background: linear-gradient(140deg, #79cbff, #84ffd7);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

button.ghost {
  background: transparent;
  color: #d8e8ff;
  border: 1px solid rgba(130, 165, 243, 0.5);
}

.line {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: 8px;
}

.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.tabbar button {
  color: #d3eaff;
  background: rgba(14, 27, 52, 0.95);
  border: 1px solid rgba(138, 174, 255, 0.38);
}

.tabbar button.active {
  color: #0c1e40;
  border-color: transparent;
  background: linear-gradient(140deg, var(--primary), var(--accent));
}

.tab {
  display: none;
  animation: reveal 0.35s ease;
}

.tab.active {
  display: block;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.table-panel {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid rgba(130, 165, 243, 0.2);
  vertical-align: top;
}

th {
  color: #abd4ff;
  font-weight: 600;
}

.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline label {
  margin: 0;
}

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

.kpi {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(130, 165, 243, 0.3);
  background: linear-gradient(135deg, rgba(13, 27, 52, 0.95), rgba(11, 25, 47, 0.78));
}

.kpi span {
  color: var(--muted);
  font-size: 0.82rem;
}

.kpi strong {
  display: block;
  font-size: 1.5rem;
  margin-top: 5px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  background: rgba(5, 11, 24, 0.92);
  border: 1px solid rgba(138, 174, 255, 0.5);
  border-radius: 10px;
  padding: 10px 12px;
  color: #e6f2ff;
}

.toast.error {
  border-color: rgba(255, 127, 143, 0.75);
  color: #ffd9df;
}

.hidden {
  display: none;
}

code {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
}

@media (max-width: 960px) {
  .auth-grid,
  .split,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .layout {
    padding: 0 12px;
  }

  .card {
    padding: 14px;
  }
}
