/* ============================================================
  ADMIN CSS - WIBSO
   ============================================================ */

:root {
  --wb-primary: #BD1D28;
  --wb-primary-dark: #9B141F;
  --wb-sidebar-width: 260px;
  --wb-sidebar-bg: #1a1f2e;
  --wb-sidebar-text: #a0aec0;
  --wb-sidebar-active: #BD1D28;
  --wb-topbar-h: 64px;
  --wb-font: 'Sora', sans-serif;
  --wb-radius: .6rem;
  --wb-shadow: 0 2px 12px rgba(0,0,0,.07);
}

[data-bs-theme="dark"] {
  --wb-sidebar-bg: #111827;
  --bs-body-bg: #1f2937;
  --bs-body-color: #e5e7eb;
  --bs-card-bg: #2d3748;
  --bs-border-color: #374151;
}

* { box-sizing: border-box; }

body.admin-body, body.admin-login-page {
  font-family: var(--wb-font);
  background: #f0f2f7;
  margin: 0;
}

[data-bs-theme="dark"] body.admin-body { background: #111827; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--wb-sidebar-width);
  background: var(--wb-sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-brand {
  font-weight: 700;
  font-size: .95rem;
  color: #f1f5f9 !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  letter-spacing: -.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #4b5563;
  padding: .75rem 1.5rem .25rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 1.5rem;
  color: var(--wb-sidebar-text);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .15s ease;
  position: relative;
}

.sidebar-nav .nav-link:hover {
  color: #f1f5f9;
  background: rgba(255,255,255,.04);
}

.sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(189,29,40,.15);
  border-left-color: var(--wb-sidebar-active);
}

.sidebar-nav .nav-link i {
  font-size: 1.05rem;
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  background: #ef4444;
  color: white;
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 2rem;
  margin-left: auto;
  line-height: 1;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 1rem 1.25rem;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--wb-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  background: var(--wb-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: .7rem;
  flex-shrink: 0;
}

.user-name {
  font-weight: 600;
  font-size: .8rem;
  color: #e2e8f0;
  line-height: 1.2;
}

.user-role {
  font-size: .7rem;
  color: #6b7280;
}

/* ── MAIN LAYOUT ─────────────────────────────────────────── */
.admin-main {
  margin-left: var(--wb-sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ──────────────────────────────────────────────── */
.admin-topbar {
  height: var(--wb-topbar-h);
  background: white;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

[data-bs-theme="dark"] .admin-topbar {
  background: #1f2937;
  border-color: #374151;
}

.topbar-left, .topbar-right { display: flex; align-items: center; }

.breadcrumb { font-size: .82rem; margin: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: #9ca3af; }
.breadcrumb-item a { color: var(--wb-primary); text-decoration: none; }
.breadcrumb-item.active { color: #6b7280; }

/* ── PAGE CONTENT ────────────────────────────────────────── */
.admin-content {
  padding: 1.5rem;
  flex: 1;
}

.page-title {
  font-family: var(--wb-font);
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

[data-bs-theme="dark"] .page-title { color: #f1f5f9; }

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

/* ── STAT CARDS ──────────────────────────────────────────── */
.stat-card {
  background: white;
  border-radius: var(--wb-radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--wb-shadow);
  transition: transform .2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
  font-size: 1.75rem;
  opacity: .15;
  position: absolute;
  right: 1rem;
  top: 1rem;
}

.stat-card-primary .stat-icon { color: var(--wb-primary); }
.stat-card-info .stat-icon { color: #0ea5e9; }
.stat-card-success .stat-icon { color: #16a34a; }
.stat-card-warning .stat-icon { color: #d97706; }

.stat-value {
  font-family: var(--wb-font);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
}

.stat-card-primary .stat-value { color: var(--wb-primary); }
.stat-card-info .stat-value { color: #0ea5e9; }
.stat-card-success .stat-value { color: #16a34a; }
.stat-card-warning .stat-value { color: #d97706; }

.stat-label {
  font-size: .82rem;
  font-weight: 600;
  color: #64748b;
  margin-top: .35rem;
  margin-bottom: .25rem;
}

.stat-sub { font-size: .75rem; color: #94a3b8; }

/* ── CARDS ───────────────────────────────────────────────── */
.card { border-radius: var(--wb-radius) !important; }

[data-bs-theme="dark"] .card {
  background: #1f2937 !important;
  border-color: #374151 !important;
}

[data-bs-theme="dark"] .card-header, [data-bs-theme="dark"] .card-footer {
  background: #1f2937 !important;
  border-color: #374151 !important;
}

[data-bs-theme="dark"] .table-light { background: #111827; color: #9ca3af; }

/* ── MESSAGES (ADMIN) ────────────────────────────────────── */
.messages-container-admin {
  max-height: 550px;
  overflow-y: auto;
  padding: 1rem;
  scroll-behavior: smooth;
}

.msg-admin-row {
  margin-bottom: 1rem;
  border-radius: .75rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  position: relative;
}

.msg-from-reporter {
  border-left: 4px solid #0ea5e9;
  background: #f0f9ff;
}

.msg-from-staff {
  border-left: 4px solid var(--wb-primary);
  background: #f5f3ff;
}

.msg-internal {
  border-left: 4px solid #f59e0b !important;
  background: #fffbeb !important;
}

.internal-badge {
  font-size: .7rem;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  padding: .15rem .75rem;
  text-align: center;
}

.msg-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem .75rem;
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.msg-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--wb-primary);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: .4rem;
}

.msg-admin-body {
  padding: .75rem;
  font-size: .875rem;
  line-height: 1.6;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-ghost {
  background: transparent;
  border: none;
  color: #64748b;
  padding: .35rem .6rem;
  border-radius: .4rem;
  transition: background .15s;
}

.btn-ghost:hover {
  background: #f1f5f9;
  color: #334155;
}

/* ── LOGIN PAGE ──────────────────────────────────────────── */
.admin-login-page {
  background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrapper { width: 100%; max-width: 420px; padding: 1rem; }

.login-card {
  background: white;
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: 0 25px 50px rgba(0,0,0,.35);
}

.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--wb-primary), #7c3aed);
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.75rem;
}

/* ── BLOCKED PAGE ────────────────────────────────────────── */
.blocked-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff5f5;
}

/* ── OVERLAY ─────────────────────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
  display: none;
}

.sidebar-overlay.active { display: block; }

/* ── REPORT DESCRIPTION ──────────────────────────────────── */
.report-description {
  font-size: .9rem;
  line-height: 1.75;
  color: #334155;
  white-space: pre-wrap;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 991px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0,0,0,.5);
  }
  .admin-main {
    margin-left: 0;
  }
}

/* ── MISC ────────────────────────────────────────────────── */
.font-mono { font-family: 'Courier New', monospace; }
.table th { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.badge { font-weight: 600; }

.bg-primary-subtle { background: rgba(189,29,40,.1) !important; }
.bg-success-subtle { background: rgba(22,163,74,.1) !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.25); }
