/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:         #080808;
  --bg-card:    #111111;
  --bg-modal:   #161616;
  --gold:       #D4AF37;
  --gold-dim:   rgba(212, 175, 55, 0.5);
  --gold-faint: rgba(212, 175, 55, 0.12);
  --gold-hover: rgba(212, 175, 55, 0.22);
  --text:       #f0f0f0;
  --text-dim:   #888;
  --border:     rgba(212, 175, 55, 0.18);
  --border-hover: rgba(212, 175, 55, 0.6);
  --danger:     #c0392b;
  --danger-bg:  rgba(192, 57, 43, 0.12);
  --success:    #27ae60;
  --radius:     12px;
  --shadow:     0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font: inherit; }
input, select { font: inherit; }
img { display: block; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: rgba(8, 8, 8, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.nav-brand { display: flex; align-items: center; gap: .75rem; }
.nav-logo  { width: 36px; height: 36px; border-radius: 50%; }
.nav-title { font-size: 1rem; font-weight: 600; color: var(--gold); letter-spacing: .04em; }
.nav-user  { display: flex; align-items: center; gap: 1rem; }
.nav-username { font-size: .875rem; color: var(--text-dim); }
.btn-logout {
  padding: .35rem .9rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: .8rem;
  transition: all .2s;
}
.btn-logout:hover { border-color: var(--gold-dim); color: var(--text); }

.btn-icon-nav {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.btn-icon-nav:hover { border-color: var(--gold-dim); color: var(--gold); }

/* ── Modal Overlay (portal) ─────────────────────────────────── */
.portal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.portal-modal {
  background: #161616;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.portal-modal h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1.5rem;
}
.portal-modal .modal-actions {
  display: flex;
  gap: .75rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}
.portal-modal .btn-secondary {
  padding: .6rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: .875rem;
  cursor: pointer;
  transition: all .2s;
}
.portal-modal .btn-secondary:hover { border-color: var(--gold-dim); color: var(--text); }
.portal-modal .btn-primary {
  padding: .6rem 1.5rem;
  border-radius: 8px;
  border: none;
  background: var(--gold);
  color: #111;
  font-weight: 700;
  font-size: .875rem;
  cursor: pointer;
  transition: opacity .2s;
  margin-top: 0;
  width: auto;
}
.portal-modal .btn-primary:hover   { opacity: .88; }
.portal-modal .btn-primary:disabled { opacity: .5; cursor: not-allowed; }

/* ── Logo Pulse ─────────────────────────────────────────────── */
@keyframes pulse-ring {
  0%   { transform: scale(0.92); opacity: .7; }
  100% { transform: scale(1.7);  opacity: 0; }
}
.logo-pulse {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
}
/* Glow + perbesar logo landing — hanya saat hover, kembali normal saat keluar */
.landing .logo-pulse .logo-img {
  transition: filter 0.4s ease, transform 0.4s ease;
}
.landing .logo-pulse:hover .logo-img {
  transform: scale(1.09);
  filter:
    drop-shadow(0 0 14px rgba(212, 175, 55, 0.85))
    drop-shadow(0 0 36px rgba(212, 175, 55, 0.4));
}

.logo-pulse .ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  animation: pulse-ring 2.4s ease-out infinite;
  pointer-events: none;
}
.logo-pulse .ring:nth-child(2) { animation-delay: .8s; }
.logo-pulse .ring:nth-child(3) { animation-delay: 1.6s; }
.logo-pulse .logo-img { position: relative; z-index: 2; border-radius: 50%; }

/* ── Landing ─────────────────────────────────────────────────── */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1.25rem;
  text-align: center;
  padding: 2rem;
  background: radial-gradient(ellipse at center, rgba(212,175,55,.06) 0%, transparent 65%);
}
.landing .logo-img { width: 170px; height: 170px; }
.portal-title {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--gold);
  margin-top: .5rem;
}
.portal-subtitle { font-size: .95rem; color: var(--text-dim); letter-spacing: .05em; }
.btn-masuk {
  margin-top: .75rem;
  padding: .7rem 2rem;
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  color: var(--gold);
  font-size: .9rem;
  letter-spacing: .04em;
  transition: all .25s;
  background: var(--gold-faint);
}
.btn-masuk:hover { background: var(--gold-hover); border-color: var(--gold); }

/* ── App Grid ───────────────────────────────────────────────── */
.app-grid-section {
  padding: calc(60px + 3rem) 2rem 3rem;
  max-width: 1000px;
  margin: 0 auto;
}
.welcome-text { margin-bottom: 2rem; }
.welcome-text h2 { font-size: 1.5rem; font-weight: 600; }
.welcome-text h2 span { color: var(--gold); }
.welcome-text p  { color: var(--text-dim); margin-top: .3rem; font-size: .9rem; }
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem 1.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  outline: none;
}
.app-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 24px rgba(212,175,55,.14);
  transform: translateY(-5px);
}
.app-card:active  { transform: translateY(-2px) scale(.98); }
.app-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.app-icon { width: 52px; height: 52px; margin: 0 auto 1rem; color: var(--gold); }
.app-icon svg { width: 100%; height: 100%; }
.app-name { font-weight: 600; font-size: 1rem; margin-bottom: .3rem; }
.app-desc { font-size: .8rem; color: var(--text-dim); line-height: 1.4; }

/* ── Login Page ─────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: radial-gradient(ellipse at center, rgba(212,175,55,.05) 0%, transparent 60%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2.5rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.login-card .logo-pulse { display: inline-flex; margin-bottom: 1.75rem; }
.login-card .logo-img   { width: 80px; height: 80px; }
.login-card .ring { inset: -6px; }
.login-title    { font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.login-subtitle { font-size: .85rem; color: var(--text-dim); margin-top: .3rem; margin-bottom: 2rem; }
.login-form { text-align: left; }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: .82rem; color: var(--text-dim); margin-bottom: .4rem; }
.form-group input,
.form-group select {
  width: 100%;
  padding: .6rem .9rem;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  transition: border-color .2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--gold-dim); }
.form-group select option { background: var(--bg-card); }
.error-msg {
  background: var(--danger-bg);
  border: 1px solid rgba(192,57,43,.3);
  border-radius: 8px;
  padding: .7rem 1rem;
  font-size: .85rem;
  color: #e74c3c;
  margin-bottom: 1rem;
  text-align: left;
}
.success-msg {
  background: rgba(39,174,96,.1);
  border: 1px solid rgba(39,174,96,.3);
  border-radius: 8px;
  padding: .7rem 1rem;
  font-size: .85rem;
  color: var(--success);
  margin-bottom: 1rem;
  text-align: left;
}
.btn-primary {
  width: 100%;
  padding: .75rem;
  background: var(--gold);
  color: #111;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .03em;
  transition: opacity .2s, transform .1s;
  margin-top: .5rem;
}
.btn-primary:hover   { opacity: .9; }
.btn-primary:active  { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

/* ── Admin Page ─────────────────────────────────────────────── */
.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(60px + 2rem) 2rem 3rem;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; }
.page-header h1 span { color: var(--gold); }
.btn-add {
  padding: .55rem 1.25rem;
  background: var(--gold);
  color: #111;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: opacity .2s;
}
.btn-add:hover { opacity: .88; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.stat-label { font-size: .78rem; color: var(--text-dim); margin-bottom: .4rem; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--gold); }

/* Search bar */
.search-bar {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.search-bar input,
.search-bar select {
  padding: .55rem .9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .875rem;
  outline: none;
  transition: border-color .2s;
}
.search-bar input  { flex: 1; min-width: 200px; }
.search-bar input:focus,
.search-bar select:focus { border-color: var(--gold-dim); }
.search-bar select option { background: var(--bg-card); }

/* Table */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.user-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.user-table thead { background: rgba(212,175,55,.07); }
.user-table th {
  padding: .85rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--gold);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.user-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}
.user-table tbody tr:last-child td { border-bottom: none; }
.user-table tbody tr:hover { background: rgba(255,255,255,.025); }

/* Badges */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.badge--superadmin { background: rgba(212,175,55,.2);   color: #e8c84a; }
.badge--admin      { background: rgba(212,175,55,.12);  color: var(--gold); }
.badge--mentor     { background: rgba(139,92,246,.18);  color: #c4b5fd; }
.badge--user       { background: rgba(59,130,246,.15);  color: #93c5fd; }
.badge--orang_tua  { background: rgba(20,184,166,.15);  color: #5eead4; }
.badge--active     { background: rgba(39,174,96,.15);  color: #2ecc71; }
.badge--inactive   { background: rgba(192,57,43,.15);  color: #e74c3c; }

/* Action buttons */
.action-buttons { display: flex; gap: .4rem; }
.btn-icon {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.btn-icon:hover          { border-color: var(--gold-dim); color: var(--text); }
.btn-icon.btn-delete:hover { border-color: rgba(192,57,43,.5); background: var(--danger-bg); color: #e74c3c; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--gold); }
.modal-actions { display: flex; gap: .75rem; margin-top: 1.5rem; justify-content: flex-end; }
.btn-secondary {
  padding: .65rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: .875rem;
  transition: all .2s;
}
.btn-secondary:hover { border-color: var(--gold-dim); color: var(--text); }
.modal .btn-primary { width: auto; padding: .65rem 1.5rem; margin-top: 0; }

/* Loader */
.loader { text-align: center; padding: 3rem; color: var(--text-dim); font-size: .9rem; }

/* Confirm modal */
.confirm-msg { color: var(--text-dim); font-size: .9rem; line-height: 1.5; }
.confirm-msg strong { color: var(--text); }
.btn-danger {
  padding: .65rem 1.2rem;
  border-radius: 8px;
  border: none;
  background: var(--danger);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  transition: opacity .2s;
}
.btn-danger:hover { opacity: .85; }

/* ── Login extras ───────────────────────────────────────────── */
.login-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0 1rem;
  color: var(--text-dim);
  font-size: .78rem;
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.contact-section {
  text-align: center;
}
.contact-section p {
  font-size: .82rem;
  color: var(--text-dim);
  margin-bottom: .6rem;
}
.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--gold);
  font-size: .85rem;
  font-weight: 600;
  background: var(--gold-faint);
  transition: all .2s;
}
.btn-contact:hover { background: var(--gold-hover); border-color: var(--gold-dim); }
.btn-daftar {
  display: block;
  width: 100%;
  padding: .75rem;
  background: var(--gold);
  color: #111;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .03em;
  text-align: center;
  text-decoration: none;
  transition: opacity .2s, transform .1s;
  margin-top: 0;
}
.btn-daftar:hover  { opacity: .9; }
.btn-daftar:active { transform: scale(.98); }
.btn-secondary-sm {
  padding: .5rem .9rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-secondary-sm:hover { border-color: var(--gold-dim); color: var(--text); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .navbar { padding: 0 1rem; }
  .nav-title { display: none; }
  .app-grid-section { padding: calc(60px + 2rem) 1rem 2rem; }
  .app-grid { grid-template-columns: 1fr 1fr; }
  .page-wrapper { padding: calc(60px + 1.5rem) 1rem 2rem; }
  .user-table th:nth-child(5),
  .user-table td:nth-child(5) { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
