/* Panel Admin — gaya TailwindAdmin (ThemeWagon, free, open source).
   Tailwind dipakai via CDN di template admin SAJA untuk utilitas
   (grid/spacing). File ini yang memegang layout inti — sidebar,
   topbar sticky, kartu statistik, tabel, dark mode — supaya panel
   tetap rapi walau CDN Tailwind gagal dimuat / offline. */
.admin-body { background: #f1f5f9; }
.admin-shell { display: flex; min-height: 100vh; align-items: stretch; }
.admin-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Sidebar kiri — gelap, seperti TailwindAdmin */
.admin-sidebar {
  width: 260px; flex: 0 0 260px; background: #0f172a; color: #e2e8f0;
  display: flex; flex-direction: column; position: sticky; top: 0;
  height: 100vh; z-index: 30;
}
.admin-brand { padding: 20px 18px 12px; border-bottom: 1px solid #1e293b; }
.admin-brand a { color: #fff; font-weight: 800; font-size: 1.05rem; text-decoration: none; display: block; }
.admin-brand-sub { color: #94a3b8; font-size: .8rem; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; }
.admin-nav a {
  color: #cbd5e1; text-decoration: none; padding: 12px 12px; border-radius: 10px;
  font-weight: 600; display: flex; align-items: center; gap: 10px; min-height: 48px;
}
.admin-nav a:hover { background: #1e293b; color: #fff; }
.admin-nav a.active { background: #0ea5e9; color: #fff; }
.admin-nav-icon { width: 22px; text-align: center; }
.admin-sidebar-foot { margin-top: auto; padding: 16px 18px; border-top: 1px solid #1e293b; color: #94a3b8; font-size: .9rem; }
.admin-sidebar-foot .muted { color: #64748b; }

/* Topbar sticky */
.admin-topbar {
  position: sticky; top: 0; z-index: 20; background: #fff;
  border-bottom: 1px solid #e2e8f0; display: flex; align-items: center;
  gap: 12px; padding: 12px 20px; min-height: 64px;
}
.admin-page-title { font-size: 1.25rem; margin: 0; flex: 1; min-width: 0; }
.admin-topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.admin-menu-btn {
  display: none; min-width: 48px; min-height: 48px; border: 1px solid #e2e8f0;
  background: #fff; border-radius: 10px; font-size: 1.3rem; cursor: pointer;
}
.admin-theme-btn {
  min-height: 44px; padding: 8px 14px; border: 1px solid #e2e8f0; background: #f8fafc;
  border-radius: 999px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.admin-topbar-link { white-space: nowrap; }

/* Konten utama */
.admin-main { padding: 20px; max-width: 1100px; width: 100%; margin: 0 auto; flex: 1; }
.admin-main .form-card, .admin-main form { max-width: none; }
.admin-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
  padding: 16px 18px; margin: 12px 0;
}
.admin-footer { padding: 20px; color: #64748b; font-size: .9rem; border-top: 1px solid #e2e8f0; }
.admin-footer .muted { color: #94a3b8; }

/* Kartu statistik (ala TailwindAdmin: angka besar + label) */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 12px 0; }
@media (min-width: 960px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px 18px; }
.stat-card .stat-label { color: #64748b; font-weight: 700; font-size: .9rem; margin: 0; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; margin: 4px 0 0; }
.stat-card.stat-pending .stat-value { color: #92400e; }
.stat-card.stat-confirmed .stat-value { color: #065f46; }
.stat-card.stat-cancelled .stat-value { color: #991b1b; }
.stat-card.stat-total .stat-value { color: #0f766e; }

/* Tabel admin: pakai .detail-table dari style.css, tambah bayangan kartu */
.admin-main .table-wrap { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 4px 8px; }
.admin-main .detail-table { margin: 8px 0; }

/* Dark mode — diaktifkan lewat html[data-theme="dark"], disimpan di localStorage */
html[data-theme="dark"] body.admin-body, html[data-theme="dark"] .admin-body { background: #0f172a; color: #e2e8f0; }
html[data-theme="dark"] .admin-topbar { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .admin-menu-btn, html[data-theme="dark"] .admin-theme-btn { background: #0f172a; color: #e2e8f0; border-color: #334155; }
html[data-theme="dark"] .admin-main { color: #e2e8f0; }
html[data-theme="dark"] .admin-card, html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .admin-main .table-wrap { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .admin-main .form-card, html[data-theme="dark"] .admin-main .item-card { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .admin-main .detail-table { background: #1e293b; color: #e2e8f0; }
html[data-theme="dark"] .admin-main .detail-table th, html[data-theme="dark"] .admin-main .detail-table td { border-color: #334155; }
html[data-theme="dark"] .admin-main input, html[data-theme="dark"] .admin-main textarea,
html[data-theme="dark"] .admin-main select { background: #0f172a; color: #e2e8f0; border-color: #475569; }
html[data-theme="dark"] .admin-main .muted, html[data-theme="dark"] .admin-footer .muted { color: #94a3b8; }
html[data-theme="dark"] .admin-main .alert-success { background: #064e3b; border-color: #059669; color: #d1fae5; }
html[data-theme="dark"] .admin-main .alert-error { background: #450a0a; border-color: #dc2626; color: #fee2e2; }
html[data-theme="dark"] .admin-footer { border-color: #334155; color: #94a3b8; }

/* Mobile: sidebar jadi laci yang bisa dibuka/tutup */
@media (max-width: 860px) {
  .admin-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .admin-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .admin-shell.sidebar-open .admin-sidebar { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .admin-topbar-link { display: none; }
  .admin-page-title { font-size: 1.05rem; }
  .admin-main { padding: 14px; }
}

/* Halaman login admin — kartu di tengah, gaya TailwindAdmin */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 16px; }
.login-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); padding: 28px 24px; width: 100%; max-width: 420px; }
.login-card h1 { font-size: 1.4rem; margin: 4px 0 12px; }
.login-brand { font-weight: 800; font-size: 1.15rem; margin: 0; }
.login-sub { color: #64748b; font-size: .9rem; margin: 0 0 8px; }
.login-card form { display: flex; flex-direction: column; gap: 6px; }
.login-foot { text-align: center; max-width: 420px; font-size: .85rem; }
html[data-theme="dark"] .login-card { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .login-card input { background: #0f172a; color: #e2e8f0; border-color: #475569; }
