@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&family=Urbanist:wght@700;800;900&display=swap');

:root {
  --bg:         #080d18;
  --bg2:        #0d1526;
  --bg3:        #111d35;
  --card:       rgba(13,21,38,0.95);
  --border:     rgba(255,255,255,0.06);
  --borderhi:   rgba(245,158,11,0.4);
  --gold:       #f59e0b;
  --gold-dim:   rgba(245,158,11,0.08);
  --gold-glow:  rgba(245,158,11,0.25);
  --green:      #10b981;
  --green-dim:  rgba(16,185,129,0.08);
  --red:        #ef4444;
  --red-dim:    rgba(239,68,68,0.08);
  --blue:       #3b82f6;
  --blue-dim:   rgba(59,130,246,0.08);
  --t1:         #f0f4ff;
  --t2:         #64748b;
  --t3:         #1e293b;
  --mono:       'IBM Plex Mono', monospace;
  --sans:       'Plus Jakarta Sans', sans-serif;
  --display:    'Urbanist', sans-serif;
  --sidebar-w:  240px;
  --topbar-h:   56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  font-family: var(--sans);
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
}

/* =====================
   SHELL
   ===================== */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

/* =====================
   SIDEBAR
   ===================== */
.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(8,13,24,0.98);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 400;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.admin-sidebar.collapsed {
  transform: translateX(-100%);
}

/* overlay mobile */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 399;
  backdrop-filter: blur(2px);
}

.admin-sidebar-overlay.show { display: none; }

.admin-sidebar-header {
  padding: 1.1rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 1rem;
  flex-shrink: 0;
}

.admin-brand-name {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--t1);
  letter-spacing: 0.06em;
}

.admin-brand-sub {
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--gold-dim);
  flex-shrink: 0;
}

.admin-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid rgba(245,158,11,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1rem;
  flex-shrink: 0;
}

.admin-user-name {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-role {
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-top: 0.1rem;
}

/* NAV */
.admin-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.admin-nav::-webkit-scrollbar {
  display: none;
}

.admin-nav-label {
  font-family: var(--mono);
  font-size: 0.48rem;
  font-weight: 600;
  color: var(--t2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.75rem 0.75rem 0.3rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.875rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--t2);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.18s;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.admin-nav-item i { font-size: 1rem; flex-shrink: 0; }

.admin-nav-item:hover {
  color: var(--gold);
  background: var(--gold-dim);
  border-color: rgba(245,158,11,0.15);
}

.admin-nav-item.active {
  color: var(--gold);
  background: var(--gold-dim);
  border-color: rgba(245,158,11,0.2);
  box-shadow: inset 3px 0 0 var(--gold);
}

.admin-nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.admin-sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex-shrink: 0;
}

.admin-logout { color: var(--red) !important; }
.admin-logout:hover {
  background: var(--red-dim) !important;
  border-color: rgba(239,68,68,0.2) !important;
  color: var(--red) !important;
}

/* =====================
   MAIN
   ===================== */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.28s cubic-bezier(0.4,0,0.2,1);
  min-width: 0;
}

.admin-main.full { margin-left: 0; }

/* TOPBAR */
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  height: var(--topbar-h);
  background: rgba(8,13,24,0.97);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 300;
  backdrop-filter: blur(20px);
}

.admin-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  color: var(--t2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.18s;
  flex-shrink: 0;
}

.admin-toggle:hover {
  color: var(--gold);
  border-color: var(--borderhi);
  background: var(--gold-dim);
}

.admin-topbar-title {
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: 0.04em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.admin-topbar-admin {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(245,158,11,0.15);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar-admin i { font-size: 0.85rem; flex-shrink: 0; }

/* ALERTS */
.admin-alert {
  margin: 1rem 1.25rem 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-alert-success {
  background: var(--green-dim);
  border: 1px solid rgba(16,185,129,0.25);
  color: var(--green);
}

.admin-alert-error {
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.25);
  color: var(--red);
}

/* CONTENT */
.admin-content {
  padding: 1.5rem;
  flex: 1;
}

/* =====================
   STAT CARDS
   ===================== */
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s;
}

.admin-stat-card:hover { border-color: rgba(255,255,255,0.1); }

.admin-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.admin-stat-icon.gold  { background: var(--gold-dim);  color: var(--gold);  border: 1px solid rgba(245,158,11,0.2); }
.admin-stat-icon.green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.admin-stat-icon.red   { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(239,68,68,0.2); }
.admin-stat-icon.blue  { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(59,130,246,0.2); }

.admin-stat-label {
  font-family: var(--sans);
  font-size: 0.63rem;
  font-weight: 600;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.admin-stat-val {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--t1);
}

/* =====================
   TABLE
   ===================== */
.admin-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.admin-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-table-title {
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--t1);
}

.admin-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.admin-table th {
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 600;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}

.admin-table td {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--t1);
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

/* =====================
   BADGES
   ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.badge-gold  { background: var(--gold-dim);  color: var(--gold);  border: 1px solid rgba(245,158,11,0.2); }
.badge-red   { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(239,68,68,0.2); }
.badge-blue  { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(59,130,246,0.2); }

/* =====================
   BUTTONS
   ===================== */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: none;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-btn-gold {
  background: linear-gradient(135deg, var(--gold), #d97706);
  color: #000;
  box-shadow: 0 4px 15px var(--gold-glow);
}

.admin-btn-gold:hover {
  box-shadow: 0 6px 25px var(--gold-glow);
  transform: translateY(-1px);
}

.admin-btn-green {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.2);
}

.admin-btn-green:hover { background: rgba(16,185,129,0.15); }

.admin-btn-red {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}

.admin-btn-red:hover { background: rgba(239,68,68,0.15); }

.admin-btn-ghost {
  background: none;
  color: var(--t2);
  border: 1px solid var(--border);
}

.admin-btn-ghost:hover { color: var(--t1); border-color: rgba(255,255,255,0.15); }

/* =====================
   FORM
   ===================== */
.admin-form-group { margin-bottom: 1.25rem; }

.admin-form-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.63rem;
  font-weight: 700;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.admin-form-input {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border-radius: 8px;
  background: rgba(13,21,38,0.8);
  border: 1px solid var(--border);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.admin-form-input:focus {
  border-color: var(--borderhi);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.admin-form-input option { background: var(--bg2); color: var(--t1); }

/* =====================
   CARD
   ===================== */
.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.admin-card:hover { border-color: rgba(255,255,255,0.1); }

/* =====================
   RESPONSIVE
   ===================== */

/* TABLET */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
}

/* MOBILE */
@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }

  /* sidebar hidden by default di mobile */
  .admin-sidebar {
    transform: translateX(-100%);
  }

  /* sidebar tampil saat open */
  .admin-sidebar.open {
    transform: translateX(0);
  }

  /* main full width di mobile */
  .admin-main {
    margin-left: 0 !important;
  }

  .admin-content {
    padding: 1rem;
  }

  /* topbar */
  .admin-topbar {
    padding: 0 1rem;
  }

  .admin-topbar-admin span {
    display: none;
  }

  .admin-topbar-admin {
    padding: 0.35rem 0.5rem;
    max-width: unset;
  }

  /* stat grid 2 kolom di mobile */
  .admin-stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }

  /* page header stack */
  .admin-page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .admin-page-header > div:last-child {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }

  .admin-page-header > div:last-child .admin-btn {
    flex: 1;
    justify-content: center;
  }

  /* table search full width */
  .admin-table-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-table-head > div:last-child {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }

  .admin-table-head > div:last-child .admin-form-input {
    flex: 1;
    width: 100% !important;
  }
}

/* SMALL MOBILE */
@media (max-width: 400px) {
  .admin-stat-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-content {
    padding: 0.75rem;
  }

  .admin-topbar-title {
    font-size: 0.8rem;
  }
}