:root {
  --bg: #0b1020;
  --bg2: #121935;
  --card: rgba(17, 24, 39, 0.82);
  --text: #eef2ff;
  --muted: #aab4d6;
  --line: rgba(255, 255, 255, 0.08);
  --primary: #7c5cff;
  --primary2: #c44bff;
  --danger: #d9534f;
}

body.light {
  --bg: #eef2ff;
  --bg2: #dbe5ff;
  --card: rgba(255, 255, 255, 0.92);
  --text: #111827;
  --muted: #52607a;
  --line: rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #24315e 0, #0b1020 45%, #060913 100%);
}

body.light {
  background: linear-gradient(180deg, var(--bg2), var(--bg));
}

/* nonaktifkan layer lama agar tidak bentrok */
.stars,
.stars::before,
.stars::after,
.galaxy-bg,
.stars-layer,
.moon-fall {
  display: none !important;
}

.login-page,
.dashboard-page {
  min-height: 100vh;
}

.login-card {
  max-width: 420px;
  margin: 8vh auto;
  padding: 28px;
}

.shell {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 14px 18px 24px;
  display: block;
}

.sidebar {
  display: none !important;
}

.content {
  display: grid;
  gap: 16px;
  width: 100%;
}

.hero h1,
.simple-card h3,
.login-card h1,
.sidebar h2 {
  margin: 0 0 8px;
}

.hero p,
.login-card p,
small,
.muted {
  color: var(--muted);
}

.hero {
  margin-top: 0;
}

.simple-card {
  width: 100%;
  background: linear-gradient(180deg, rgba(10, 20, 45, 0.84), rgba(8, 16, 35, 0.82));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 18px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(124, 92, 255, 0.04);
}

body.light .simple-card {
  background: rgba(255, 255, 255, 0.9);
}

.top-admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 18px 22px;
  border-radius: 20px;
}

.top-admin-left h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

body.light .top-admin-left h2 {
  color: var(--text);
}

.top-admin-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  color: #fff !important;
  background: linear-gradient(135deg, #1a2752, #0b1635);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.admin-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.18);
}

.admin-cta:active {
  transform: translateY(0);
}

.shiny-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -140%;
  width: 70%;
  height: 100%;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.15) 35%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.15) 65%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  animation: shinyMove 3s infinite linear;
  pointer-events: none;
}

@keyframes shinyMove {
  0% { left: -140%; }
  100% { left: 170%; }
}

.logout-btn {
  background: linear-gradient(135deg, #662244, #381122);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="date"],
input[type="time"],
select,
textarea,
input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 28, 0.55);
  color: var(--text);
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus,
input[type="file"]:focus {
  border-color: rgba(124, 92, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

body.light input,
body.light select,
body.light textarea,
body.light input[type="file"] {
  background: #fff;
}

textarea {
  resize: vertical;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.gap16 {
  gap: 16px;
}

.full {
  grid-column: 1 / -1;
}

.inline-end {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.stack {
  display: grid;
}

.mt16 {
  margin-top: 16px;
}

.time-select-row {
  display: flex;
  gap: 10px;
}

.time-select-row select {
  flex: 1;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(90deg, var(--primary), var(--primary2));
}

.btn.danger {
  background: var(--danger);
}

.btn.full {
  width: 100%;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
}

.alert.success {
  background: #114b2f;
}

.alert.error {
  background: #61282b;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

/* =========================================
   PREMIUM GALAXY ULTRA SMOOTH
========================================= */
body.dashboard-page {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(98, 70, 255, 0.14) 0%, rgba(98, 70, 255, 0) 26%),
    radial-gradient(circle at 80% 8%, rgba(0, 180, 255, 0.10) 0%, rgba(0, 180, 255, 0) 20%),
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 22%),
    linear-gradient(180deg, #060d1d 0%, #050b18 45%, #030711 100%);
}

.galaxy-premium-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.shell,
.content,
.simple-card,
.top-admin-bar,
.hero {
  position: relative;
  z-index: 2;
}

.galaxy-nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.22;
  animation: nebulaFloat 24s ease-in-out infinite alternate;
}

.nebula-1 {
  width: 340px;
  height: 340px;
  left: -60px;
  top: -40px;
  background: radial-gradient(circle, rgba(130, 84, 255, 0.45) 0%, rgba(130, 84, 255, 0) 70%);
}

.nebula-2 {
  width: 420px;
  height: 420px;
  right: -120px;
  top: -80px;
  background: radial-gradient(circle, rgba(43, 156, 255, 0.30) 0%, rgba(43, 156, 255, 0) 72%);
  animation-duration: 30s;
}

.nebula-3 {
  width: 280px;
  height: 280px;
  left: 30%;
  bottom: -120px;
  background: radial-gradient(circle, rgba(196, 75, 255, 0.18) 0%, rgba(196, 75, 255, 0) 72%);
  animation-duration: 28s;
}

@keyframes nebulaFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(20px, -10px, 0) scale(1.06); }
}

.stars-premium {
  position: absolute;
  inset: -10%;
  background-repeat: repeat;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}

.stars-layer-1 {
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,.95), transparent 60%),
    radial-gradient(1.5px 1.5px at 120px 80px, rgba(200,220,255,.9), transparent 60%),
    radial-gradient(2px 2px at 250px 60px, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1.5px 1.5px at 340px 150px, rgba(220,230,255,.8), transparent 60%),
    radial-gradient(2px 2px at 460px 110px, rgba(255,255,255,.88), transparent 60%);
  background-size: 520px 260px;
  opacity: 0.9;
  animation:
    starsDriftOne 90s linear infinite,
    starsTwinkleOne 6s ease-in-out infinite alternate;
}

.stars-layer-2 {
  background-image:
    radial-gradient(2px 2px at 50px 40px, rgba(255,255,255,.55), transparent 65%),
    radial-gradient(2.5px 2.5px at 180px 130px, rgba(173,216,255,.45), transparent 65%),
    radial-gradient(2px 2px at 300px 70px, rgba(255,255,255,.5), transparent 65%),
    radial-gradient(3px 3px at 450px 200px, rgba(173,216,255,.38), transparent 65%);
  background-size: 680px 340px;
  opacity: 0.42;
  animation:
    starsDriftTwo 130s linear infinite,
    starsTwinkleTwo 8s ease-in-out infinite alternate;
}

.stars-layer-3 {
  background-image:
    radial-gradient(3px 3px at 80px 60px, rgba(255,255,255,.26), transparent 70%),
    radial-gradient(4px 4px at 260px 160px, rgba(124,92,255,.18), transparent 70%),
    radial-gradient(3px 3px at 520px 120px, rgba(196,75,255,.16), transparent 70%);
  background-size: 900px 420px;
  opacity: 0.25;
  animation:
    starsDriftThree 180s linear infinite,
    starsTwinkleThree 10s ease-in-out infinite alternate;
}

@keyframes starsDriftOne {
  from { transform: translateY(0); }
  to   { transform: translateY(100px); }
}

@keyframes starsDriftTwo {
  from { transform: translateY(0) translateX(0); }
  to   { transform: translateY(140px) translateX(-30px); }
}

@keyframes starsDriftThree {
  from { transform: translateY(0) translateX(0) scale(1); }
  to   { transform: translateY(80px) translateX(24px) scale(1.03); }
}

@keyframes starsTwinkleOne {
  0%   { opacity: 0.72; }
  50%  { opacity: 0.95; }
  100% { opacity: 0.82; }
}

@keyframes starsTwinkleTwo {
  0%   { opacity: 0.28; }
  50%  { opacity: 0.48; }
  100% { opacity: 0.34; }
}

@keyframes starsTwinkleThree {
  0%   { opacity: 0.16; }
  50%  { opacity: 0.30; }
  100% { opacity: 0.20; }
}

.moon-drop {
  position: absolute;
  top: -90px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #fffef2 0%, #fff1a6 40%, #e0ba52 100%);
  box-shadow:
    0 0 10px rgba(255, 236, 170, 0.45),
    0 0 22px rgba(255, 220, 120, 0.20);
  opacity: 0;
}

.moon-drop::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -55px;
  width: 55px;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,240,180,0.42));
  filter: blur(1px);
  border-radius: 999px;
}

.moon-drop-1 {
  left: 10%;
  animation: moonFallOne 16s linear infinite;
  animation-delay: 0s;
}

.moon-drop-2 {
  left: 34%;
  width: 14px;
  height: 14px;
  animation: moonFallTwo 21s linear infinite;
  animation-delay: 4s;
}

.moon-drop-3 {
  left: 62%;
  width: 16px;
  height: 16px;
  animation: moonFallThree 18s linear infinite;
  animation-delay: 9s;
}

.moon-drop-4 {
  left: 84%;
  width: 12px;
  height: 12px;
  animation: moonFallFour 24s linear infinite;
  animation-delay: 2s;
}

@keyframes moonFallOne {
  0%   { transform: translate3d(0, -80px, 0) rotate(18deg); opacity: 0; }
  8%   { opacity: .9; }
  100% { transform: translate3d(42px, 115vh, 0) rotate(18deg); opacity: 0; }
}

@keyframes moonFallTwo {
  0%   { transform: translate3d(0, -120px, 0) rotate(-16deg); opacity: 0; }
  10%  { opacity: .75; }
  100% { transform: translate3d(-36px, 115vh, 0) rotate(-16deg); opacity: 0; }
}

@keyframes moonFallThree {
  0%   { transform: translate3d(0, -90px, 0) rotate(14deg); opacity: 0; }
  12%  { opacity: .8; }
  100% { transform: translate3d(28px, 115vh, 0) rotate(14deg); opacity: 0; }
}

@keyframes moonFallFour {
  0%   { transform: translate3d(0, -100px, 0) rotate(-12deg); opacity: 0; }
  10%  { opacity: .65; }
  100% { transform: translate3d(-22px, 115vh, 0) rotate(-12deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .galaxy-nebula,
  .stars-premium,
  .moon-drop,
  .shiny-btn::before {
    animation: none !important;
  }
}

@media (max-width: 900px) {
  .grid2,
  .grid3 {
    grid-template-columns: 1fr;
  }

  .inline-end {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-admin-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-admin-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .admin-cta {
    width: 100%;
    min-width: unset;
  }
}

@media (max-width: 768px) {
  .galaxy-nebula {
    filter: blur(40px);
    opacity: 0.16;
  }

  .moon-drop {
    transform: scale(0.85);
  }

  .stars-layer-3 {
    opacity: 0.16;
  }
}

@media (max-width: 640px) {
  .top-admin-nav {
    grid-template-columns: 1fr;
  }

  .time-select-row {
    flex-direction: column;
  }
}
