/* ============================================================
   ADMIN THEME — CRIMSON / ROSE
   Struktur file:
   1. Root / Design Tokens
   2. Base & Reset
   3. Layout
   4. Sidebar
   5. Navbar
   6. Card & Content (metric, panel, chart, profile, auth, dll)
   7. Table
   8. Form & Buttons
   9. Utility (badge, alert, progress, dll)
   10. Responsive
   11. Dark Mode (penyesuaian non-token)
   ============================================================ */

/* ============================================================
   1. ROOT / DESIGN TOKENS
   ============================================================ */
:root {
  /* --- Layout --- */
  --sidebar-width: 240px;
  --sidebar-mini-width: 72px;

  /* --- Type scale (konsisten di seluruh file) --- */
  --fs-xs: 0.6875rem; /* 11px */
  --fs-sm: 0.75rem; /* 12px */
  --fs-base: 0.8125rem; /* 13px */
  --fs-md: 0.875rem; /* 14px */
  --fs-lg: 1rem; /* 16px */
  --fs-xl: 1.25rem; /* 20px */
  --fs-2xl: 1.75rem; /* 28px */
  --fs-3xl: 2rem; /* 32px */

  /* --- Surface & text (clean, senada dengan tema publik) --- */
  --admin-bg: #f5f5f3;
  --admin-surface: #ffffff;
  --admin-surface-soft: #f7f2ea;
  --admin-border: #deded9;
  --admin-text: #171716;
  --admin-muted: #676767;
  --admin-white: #ffffff;

  /* --- Brand (merah & gold, selaras dengan tema publik) --- */
  --admin-primary: #c90606;
  --admin-primary-dark: #770404;
  --admin-primary-light: #d69f0f;
  --admin-gradient: linear-gradient(135deg, #770404 0%, #c90606 100%);

  /* --- Semantic --- */
  --admin-success: #16a34a;
  --admin-warning: #b45309;
  --admin-danger: #dc2626;
  --admin-info: #fe5922;

  /* --- Pastel (untuk icon button, metric icon, dsb) --- */
  --admin-primary-pastel: #fde3da;
  --admin-success-pastel: #e3f8ec;
  --admin-warning-pastel: #fff2df;
  --admin-danger-pastel: #ffe4e4;
  --admin-info-pastel: #ffe3d9;

  /* --- Sidebar (selalu gelap, terang/gelap mode) --- */
  --admin-sidebar: #770404;
  --admin-sidebar-soft: #c90606;
  --admin-sidebar-border: rgba(255, 255, 255, 0.08);
  --admin-sidebar-text: #f0d8b8;
  --admin-sidebar-text-strong: #ffffff;
  --admin-sidebar-muted: #c7a06a;
  --admin-sidebar-icon-bg: rgba(255, 255, 255, 0.08);
  --admin-sidebar-icon: #ffd500;
  --admin-sidebar-scroll-thumb: rgba(255, 255, 255, 0.28);

  /* --- Shadow & ring --- */
  --admin-shadow-sm: 0 10px 24px rgba(201, 6, 6, 0.08);
  --admin-shadow: 0 18px 46px rgba(201, 6, 6, 0.12);
  --admin-shadow-lg: 0 26px 70px rgba(201, 6, 6, 0.16);
  --admin-ring: 0 0 0 4px rgba(201, 6, 6, 0.15);

  /* --- Sidebar accent tetap (dipakai untuk hover/active submenu, kontras di atas sidebar gelap) --- */
  --admin-sidebar-accent: rgba(255, 213, 0, 0.24);

  /* --- Remap variabel tema Bootstrap ke warna brand,
     supaya komponen bawaan (btn-outline-primary, nav-pills, <a>, form-check) ikut tema --- */
  --bs-primary: var(--admin-primary);
  --bs-primary-rgb: 201, 6, 6;
  --bs-link-color: var(--admin-primary);
  --bs-link-color-rgb: 201, 6, 6;
  --bs-link-hover-color: var(--admin-primary-dark);
  --bs-link-hover-color-rgb: 119, 4, 4;
  --bs-focus-ring-color: rgba(201, 6, 6, 0.25);

  color-scheme: light;
}

html[data-theme='dark'] {
  --admin-bg: #0d0d0c;
  --admin-surface: #1b1b1b;
  --admin-surface-soft: #222222;
  --admin-border: #2d2d2d;
  --admin-text: #f5f5f5;
  --admin-muted: #c8c8c8;

  --admin-primary: #c90606;
  --admin-primary-dark: #770404;
  --admin-primary-light: #d69f0f;
  --admin-gradient: linear-gradient(135deg, #770404 0%, #c90606 100%);

  --admin-success: #34d399;
  --admin-warning: #ffd500;
  --admin-danger: #f87171;
  --admin-info: #ff7d4f;

  --admin-primary-pastel: rgba(201, 6, 6, 0.16);
  --admin-success-pastel: rgba(52, 211, 153, 0.16);
  --admin-warning-pastel: rgba(255, 213, 0, 0.16);
  --admin-danger-pastel: rgba(248, 113, 113, 0.16);
  --admin-info-pastel: rgba(254, 89, 34, 0.16);

  --admin-sidebar: #150505;
  --admin-sidebar-soft: #2a0808;
  --admin-sidebar-border: rgba(255, 255, 255, 0.06);
  --admin-sidebar-text: #e8cf9a;
  --admin-sidebar-text-strong: #ffffff;
  --admin-sidebar-muted: #b89468;
  --admin-sidebar-icon-bg: rgba(255, 255, 255, 0.06);
  --admin-sidebar-icon: #ffd500;
  --admin-sidebar-scroll-thumb: rgba(255, 255, 255, 0.2);

  --admin-shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.28);
  --admin-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
  --admin-shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.46);
  --admin-ring: 0 0 0 4px rgba(214, 159, 15, 0.3);

  --admin-sidebar-accent: rgba(255, 213, 0, 0.28);

  --bs-primary: var(--admin-primary);
  --bs-primary-rgb: 201, 6, 6;
  --bs-link-color: var(--admin-primary);
  --bs-link-color-rgb: 201, 6, 6;
  --bs-link-hover-color: var(--admin-primary-dark);
  --bs-link-hover-color-rgb: 119, 4, 4;
  --bs-focus-ring-color: rgba(201, 6, 6, 0.3);

  color-scheme: dark;
}

/* ============================================================
   2. BASE & RESET
   ============================================================ */
* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(
    180deg,
    var(--admin-surface) 0%,
    var(--admin-bg) 42%,
    var(--admin-surface-soft) 100%
  );
  color: var(--admin-text);
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: var(--fs-base);
}

html[data-theme='dark'] body {
  background: linear-gradient(180deg, var(--admin-surface) 0%, var(--admin-bg) 48%, #0d0407 100%);
}

a {
  color: var(--admin-primary);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--admin-primary-dark);
}

:focus-visible {
  outline-color: var(--admin-primary);
}

/* Transisi halus saat ganti tema */
body,
.admin-navbar,
.admin-sidebar,
.admin-main,
.metric-card,
.panel,
.auth-card,
.error-card,
.dropdown-menu,
.modal-content,
.form-control,
.form-select {
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-nav .nav-link,
  .sidebar-toggle,
  .icon-button,
  .profile-button,
  .btn,
  .metric-card,
  .panel,
  .table tbody tr {
    transition: none;
  }

  .sidebar-nav .nav-link:hover,
  .sidebar-nav .nav-link:focus,
  .btn:hover,
  .btn:focus,
  .metric-card:hover {
    transform: none;
  }
}

/* ============================================================
   3. LAYOUT
   ============================================================ */
.admin-shell {
  min-height: 100vh;
}

.admin-main {
  width: auto;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.2s ease;
}

.btn.disabled {
  pointer-events: none;
}

.dashboard-content {
  min-height: calc(100vh - 132px);
}

.dashboard-content > .container-fluid {
  padding-top: 1.75rem !important;
  padding-bottom: 1.75rem !important;
}

.admin-footer {
  padding: 1.1rem 0 1.35rem;
  color: var(--admin-muted);
  font-size: var(--fs-md);
}

.admin-footer .container-fluid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1030;
  display: none;
  background: rgba(15, 5, 8, 0.5);
}

/* ============================================================
   4. SIDEBAR
   ============================================================ */
.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  border-right: 1px solid var(--admin-sidebar-border);
  background: linear-gradient(180deg, var(--admin-sidebar) 0%, var(--admin-sidebar-soft) 100%);
  color: var(--admin-sidebar-text-strong);
  box-shadow: 18px 0 42px rgba(0, 0, 0, 0.2);
  transform: translateX(0);
  transition:
    width 0.2s ease,
    transform 0.2s ease;
}

/* Scrollbar hanya muncul saat hover */
.admin-sidebar:hover {
  scrollbar-color: var(--admin-sidebar-scroll-thumb) transparent;
}

.admin-sidebar::-webkit-scrollbar {
  width: 6px;
}

.admin-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.admin-sidebar:hover::-webkit-scrollbar-thumb {
  background: var(--admin-sidebar-scroll-thumb);
}

.sidebar-header {
  padding: 1.1rem 1rem 0.95rem;
  margin-inline: 0;
  border-bottom: 1px solid var(--admin-sidebar-border);
}

.brand-mark,
.brand-mark:hover,
.brand-mark:focus {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: var(--admin-sidebar-text-strong);
}

.brand-icon,
.profile-avatar,
.metric-icon,
.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  font-weight: 800;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--admin-gradient);
  color: #ffffff;
  font-size: var(--fs-lg);
}

.brand-copy,
.brand-title,
.brand-subtitle,
.nav-text,
.sidebar-footer-text {
  min-width: 0;
  transition:
    opacity 0.16s ease,
    width 0.16s ease;
}

.brand-title,
.brand-subtitle {
  display: block;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-title {
  font-size: var(--fs-md);
  font-weight: 800;
}

.brand-subtitle {
  color: var(--admin-sidebar-muted);
  font-size: var(--fs-sm);
}

.sidebar-nav {
  display: grid;
  gap: 0.3rem;
  padding: 0.75rem 0.65rem;
}

body.sidebar-mini .sidebar-nav {
  display: grid;
  justify-items: center;
  padding: 12px 0;
  gap: 6px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 38px;
  padding: 0.5rem 0.65rem;
  border-radius: 7px;
  color: var(--admin-sidebar-text);
  font-weight: 600;
  font-size: var(--fs-sm);
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus,
.sidebar-nav .nav-link.active {
  background: var(--admin-sidebar-soft);
  color: var(--admin-sidebar-text-strong);
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus {
  transform: translateX(2px);
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--admin-sidebar-icon-bg);
  color: var(--admin-sidebar-icon);
  font-size: var(--fs-xs);
}

.sidebar-nav .nav-link:hover .nav-icon {
  background: var(--admin-sidebar-soft);
  color: #fff;
}

/* Active */
.sidebar-nav .nav-link.active .nav-icon {
  /* background: var(--admin-sidebar-text); */
  color: #fff;
}

body.sidebar-mini .nav-link {
  position: relative;
  overflow: visible;
}

body.sidebar-mini .nav-text {
  position: absolute;
  left: calc(var(--sidebar-mini-width) - 8px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);

  padding: 8px 12px;
  border-radius: 8px;

  background: var(--admin-surface);
  color: var(--admin-text);

  white-space: nowrap;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: all 0.18s ease;

  z-index: 9999;
}

body.sidebar-mini .nav-link:hover .nav-text {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* --- Nav item / chevron / submenu (L2 & L3) --- */
.nav-item {
  position: relative;
}

.nav-link[data-toggle='submenu'] {
  cursor: pointer;
  user-select: none;
}

.nav-chevron {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--admin-sidebar-muted);
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.18s;
  flex-shrink: 0;
}

.nav-link.open .nav-chevron,
.nav-link[aria-expanded='true'] .nav-chevron {
  transform: rotate(180deg);
}

.submenu {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease;
}

.submenu.open {
  max-height: 700px;
  opacity: 1;
  pointer-events: auto;
}

.submenu-l2 {
  padding: 4px 8px 6px 10px;
  margin: 0 8px 2px 8px;
  border-radius: 0 0 8px 8px;
  background: var(--admin-sidebar-soft);
  border-left: 2px solid var(--admin-sidebar-border);
}

.nav-link-l2 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  color: var(--admin-sidebar-text);
  transition:
    background 0.15s,
    color 0.15s;
}

.nav-link-l2:hover,
.nav-link-l2.open,
.nav-link-l2.active {
  background: var(--admin-sidebar-accent);
  color: var(--admin-sidebar-text-strong);
}

.bullet-l2 {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 2px solid var(--admin-sidebar-muted);
  flex-shrink: 0;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.nav-link-l2:hover .bullet-l2,
.nav-link-l2.active .bullet-l2 {
  border-color: var(--admin-primary-light);
  background: var(--admin-primary-light);
}

.nav-text-l2 {
  flex: 1;
}

.nav-chevron-sm {
  font-size: var(--fs-xs);
  color: var(--admin-sidebar-muted);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.nav-link-l2.open .nav-chevron-sm,
.nav-link-l2[aria-expanded='true'] .nav-chevron-sm {
  transform: rotate(180deg);
}

.submenu-l3 {
  padding: 3px 6px 4px 8px;
  margin: 0 4px 2px 12px;
  border-radius: 0 0 7px 7px;
  background: rgba(0, 0, 0, 0.12);
  border-left: 2px solid var(--admin-sidebar-border);
}

.nav-link-l3 {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: var(--fs-xs);
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  color: var(--admin-sidebar-muted);
  transition:
    background 0.13s,
    color 0.13s;
}

.nav-link-l3:hover,
.nav-link-l3.active {
  background: var(--admin-sidebar-accent);
  color: var(--admin-sidebar-text-strong);
}

.bullet-l3 {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1.5px solid var(--admin-sidebar-muted);
  flex-shrink: 0;
  transition:
    border-color 0.13s,
    background 0.13s;
}

.nav-link-l3:hover .bullet-l3,
.nav-link-l3.active .bullet-l3 {
  border-color: var(--admin-sidebar-text);
  background: var(--admin-sidebar-text);
}

.nav-text-l3 {
  flex: 1;
}

.nav-badge {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  line-height: 1.6;
  background: var(--admin-sidebar-accent);
  color: var(--admin-sidebar-text-strong);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
  margin-inline: 1rem;
  padding: 0.85rem 0;
  color: var(--admin-sidebar-text);
  border-top: 1px solid var(--admin-sidebar-border);
  font-size: var(--fs-md);
  white-space: nowrap;
}

.sidebar-user {
  margin: auto 0.85rem 0.85rem;
  padding: 0.75rem;
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  border: 1px solid var(--admin-sidebar-border);
  border-radius: 8px;
  background: var(--admin-sidebar-soft);
  text-align: center;
}

.sidebar-user-avatar {
  border: 3px solid var(--admin-primary-light);
}

.sidebar-user strong {
  color: var(--admin-sidebar-text-strong);
  font-size: var(--fs-md);
  line-height: 1.1;
}

.sidebar-user small {
  color: var(--admin-sidebar-muted);
  font-size: var(--fs-sm);
}

.status-dot,
.notification-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status-dot {
  flex: 0 0 auto;
  background: var(--admin-success);
}

/* --- Sidebar mini (icon-only) --- */
body.sidebar-mini .nav-text,
body.sidebar-mini .nav-text-l2,
body.sidebar-mini .nav-text-l3 {
  display: none !important;
}

body.sidebar-mini .nav-chevron,
body.sidebar-mini .nav-chevron-sm,
body.sidebar-mini .nav-badge {
  display: none !important;
}

body.sidebar-mini .submenu {
  max-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.sidebar-mini .sidebar-nav .nav-link {
  width: 44px;
  height: 44px;
  margin: 2px auto;
  padding: 0 !important;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;

  border-radius: 12px;
}

body.sidebar-mini .sidebar-nav .nav-link.active {
  background: var(--admin-sidebar-soft);
  color: var(--admin-sidebar-text-strong);
}

body.sidebar-mini .sidebar-nav .nav-link:hover {
  background: var(--admin-sidebar-soft);
}

/* body.sidebar-mini .nav-icon {
  display: inline-flex !important;
  justify-content: center;
  align-items: center;

  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: 0;

  font-size: var(--fs-sm);
} */

/* body.sidebar-mini .nav-icon i {
  font-size: inherit;
  line-height: 1;
} */

@media (min-width: 992px) {
  body.sidebar-mini .admin-sidebar {
    width: var(--sidebar-mini-width);
  }

  body.sidebar-mini .admin-main {
    margin-left: var(--sidebar-mini-width);
  }

  body.sidebar-mini .brand-copy,
  body.sidebar-mini .nav-text,
  body.sidebar-mini .sidebar-footer-text {
    width: 0;
    opacity: 0;
    overflow: hidden;
  }

  body.sidebar-mini .sidebar-header,
  body.sidebar-mini .sidebar-footer {
    margin-inline: 0.85rem;
    padding-inline: 0;
  }

  body.sidebar-mini .sidebar-nav .nav-link:hover,
  body.sidebar-mini .sidebar-nav .nav-link:focus {
    transform: none;
  }
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    width: min(var(--sidebar-width), calc(100vw - 48px));
    transform: translateX(-100%);
    box-shadow: 18px 0 48px rgba(0, 0, 0, 0.32);
  }

  .admin-main {
    margin-left: 0;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
}

/* ============================================================
   5. NAVBAR
   ============================================================ */
.admin-navbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  min-height: 66px;
  border-bottom: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
}

.admin-navbar.bg-white {
  background-color: var(--admin-surface) !important;
  backdrop-filter: blur(14px);
  color: var(--admin-text);
}

html[data-theme='dark'] .admin-navbar.bg-white {
  background-color: rgba(36, 16, 22, 0.92) !important;
}

.sidebar-toggle {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
  color: var(--admin-text);
  box-shadow: var(--admin-shadow-sm);
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus {
  border-color: var(--admin-primary-light);
  background: var(--admin-primary-pastel);
  box-shadow: var(--admin-ring);
}

.sidebar-toggle span {
  width: 18px;
  height: 2px;
  display: block;
  background: var(--admin-text);
  border-radius: 999px;
}

.search-input {
  max-width: 520px;
  min-height: 40px;
  border-color: var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface-soft);
  box-shadow: none;
}

.search-input:focus {
  border-color: var(--admin-primary-light);
  box-shadow: var(--admin-ring);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* --- Icon button & profile button: pastel background --- */
.icon-button,
.profile-button {
  border: 1px solid var(--admin-border);
  background: var(--admin-primary-pastel);
  color: var(--admin-primary-dark);
  box-shadow: var(--admin-shadow-sm);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.icon-button:hover,
.icon-button:focus,
.profile-button:hover,
.profile-button:focus {
  border-color: var(--admin-primary-light);
  box-shadow: var(--admin-ring);
}

.icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-weight: 800;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--admin-danger);
}

.notification-menu {
  width: min(320px, calc(100vw - 2rem));
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: var(--admin-shadow);
}

.notification-menu .dropdown-item {
  display: grid;
  gap: 0.2rem;
  padding-block: 0.65rem;
}

.notification-title {
  font-weight: 700;
  font-size: var(--fs-base);
}

.notification-time {
  color: var(--admin-muted);
  font-size: var(--fs-sm);
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  font-weight: 700;
  color: var(--admin-text);
  background: var(--admin-surface);
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--admin-primary-pastel);
  color: var(--admin-primary-dark);
  font-size: var(--fs-xs);
}

.avatar-img {
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.avatar-md {
  width: 54px;
  height: 54px;
  border-radius: 50%;
}

.avatar-xl {
  width: 76px;
  height: 76px;
  border-radius: 50%;
}

.profile-button .avatar-sm {
  border: 2px solid var(--admin-primary-light);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.theme-toggle i {
  font-size: var(--fs-lg);
}

.auth-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

@media (max-width: 767.98px) {
  .navbar-actions {
    gap: 0.5rem;
  }

  .icon-button,
  .profile-button,
  .sidebar-toggle {
    width: 38px;
    height: 38px;
  }

  .profile-button {
    padding: 0.3rem;
  }

  .page-heading-copy {
    align-items: flex-start;
  }
}

/* ============================================================
   6. CARD & CONTENT
   ============================================================ */
.page-heading,
.panel-header,
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-heading {
  margin-bottom: 1.25rem;
}

.page-heading h1 {
  font-weight: 800;
  letter-spacing: 0;
  font-size: var(--fs-xl);
}

.page-heading-copy {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  min-width: 0;
}

.eyebrow {
  color: var(--admin-primary);
  font-size: var(--fs-sm);
  font-weight: 800;
  text-transform: uppercase;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
}

.page-icon,
.section-title i {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--admin-primary-pastel);
  color: var(--admin-primary-dark);
}

.page-icon {
  width: 44px;
  height: 44px;
  font-size: var(--fs-xl);
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i {
  width: 32px;
  height: 32px;
  font-size: var(--fs-md);
}

/* --- Filter tabs (mis. "2 Overdue / 3 Working / All") --- */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--admin-border);
  border-radius: 9px;
  background: var(--admin-surface);
  color: var(--admin-muted);
  font-weight: 700;
  font-size: var(--fs-xs);
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

.filter-tab:hover {
  border-color: var(--admin-primary-light);
  color: var(--admin-text);
}

.filter-tab:focus-visible {
  outline: none;
  box-shadow: var(--admin-ring);
}

.filter-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--admin-surface-soft);
  color: var(--admin-muted);
  font-size: var(--fs-xs);
  font-weight: 800;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.filter-tab.active {
  border-color: var(--admin-primary);
  background-color: var(--admin-primary);
  color: var(--admin-surface);
  box-shadow: var(--admin-ring);
}

.filter-tab.active .filter-tab-count {
  background: var(--admin-gradient);
  color: #ffffff;
}

.filter-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  color: var(--admin-muted);
  font-weight: 700;
  font-size: var(--fs-sm);
}

.filter-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: color 0.16s ease;
}

.filter-sort:hover,
.filter-sort:focus-visible {
  color: var(--admin-primary);
}

.filter-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--admin-muted);
  cursor: pointer;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.filter-icon-btn:hover,
.filter-icon-btn:focus-visible {
  background: var(--admin-primary-pastel);
  color: var(--admin-primary-dark);
  outline: none;
}

.filter-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* area tab */
.filter-tabs-wrapper {
  flex-shrink: 0;
}

.filter-divider {
  height: 35px;

  width: 1px;

  background: var(--admin-border);
}

/* tanggal */
.filter-date-form {
  display: flex;

  align-items: flex-end;

  gap: 0.75rem;
}

.filter-date-form label {
  color: var(--admin-muted);
}

@media (max-width: 575.98px) {
  .filter-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-tabs {
    width: 100%;
  }

  .filter-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}

.metric-card,
.panel {
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow);
}

.metric-card {
  position: relative;
  min-height: 150px;
  padding: 1.2rem;
  overflow: hidden;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.metric-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--metric-color, var(--admin-primary));
}

.metric-card:hover,
.panel:hover {
  border-color: var(--admin-primary-light);
  box-shadow: var(--admin-shadow-lg);
  transform: translateY(-3px);
}

.metric-primary {
  --metric-color: var(--admin-primary);
}

.metric-success {
  --metric-color: var(--admin-success);
}

.metric-warning {
  --metric-color: var(--admin-warning);
}

.metric-danger {
  --metric-color: var(--admin-danger);
}

.metric-label {
  color: var(--admin-muted);
  font-size: var(--fs-sm);
  font-weight: 800;
  text-transform: uppercase;
}

.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--admin-primary-pastel);
  color: var(--metric-color, var(--admin-primary));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.metric-success .metric-icon {
  background: var(--admin-success-pastel);
}

.metric-warning .metric-icon {
  background: var(--admin-warning-pastel);
}

.metric-danger .metric-icon {
  background: var(--admin-danger-pastel);
}

.metric-value {
  margin-top: 0.9rem;
  color: var(--admin-text);
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: 1;
}

.metric-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.85rem;
  color: var(--admin-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.panel {
  padding: 1.2rem;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.panel-header {
  margin-bottom: 1.1rem;
}

.panel-header p {
  font-size: var(--fs-md);
}

.chart-bars {
  height: 280px;
  display: grid;
  grid-template-columns: repeat(6, minmax(38px, 1fr));
  align-items: end;
  gap: 1rem;
  padding: 1.1rem 0.4rem 0;
  border-radius: 8px;
  background: var(--admin-surface-soft);
}

.chart-column {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 0.55rem;
  color: var(--admin-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-align: center;
}

.chart-column span {
  width: 100%;
  height: var(--bar-size);
  min-height: 28px;
  display: block;
  border-radius: 8px 8px 3px 3px;
  background: var(--admin-gradient);
  box-shadow: 0 10px 20px rgba(190, 18, 60, 0.2);
}

.bar-42 {
  --bar-size: 42%;
}

.bar-58 {
  --bar-size: 58%;
}

.bar-51 {
  --bar-size: 51%;
}

.bar-72 {
  --bar-size: 72%;
}

.bar-66 {
  --bar-size: 66%;
}

.bar-83 {
  --bar-size: 83%;
}

.activity-list {
  display: grid;
  gap: 1.05rem;
}

.activity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--admin-border);
}

.activity-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.activity-dot {
  width: 12px;
  height: 12px;
  margin-top: 0.4rem;
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--admin-primary-pastel);
}

.profile-avatar-lg {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  font-size: var(--fs-2xl);
}

.profile-hero {
  display: grid;
  justify-items: center;
}

.profile-card {
  overflow: hidden;
}

.profile-cover {
  margin: -1.2rem -1.2rem 0.85rem;
  height: 92px;
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-gradient);
}

.profile-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.profile-photo {
  margin-top: -42px;
  border: 4px solid var(--admin-surface);
  box-shadow: var(--admin-shadow-sm);
}

.info-list,
.settings-list,
.legend-list {
  display: grid;
  gap: 0.8rem;
}

.info-list div,
.mini-card,
.settings-row,
.legend-list div {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface-soft);
}

.info-list div,
.legend-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem;
}

.info-list span,
.mini-card span,
.settings-row small {
  color: var(--admin-muted);
  font-size: var(--fs-sm);
}

.info-list strong,
.mini-card strong {
  text-align: right;
}

.mini-card {
  display: grid;
  gap: 0.3rem;
  min-height: 100px;
  align-content: center;
  padding: 1rem;
}

.mini-card strong {
  color: var(--admin-text);
  font-size: var(--fs-lg);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem;
  cursor: pointer;
}

.settings-row span {
  display: grid;
  gap: 0.2rem;
}

.donut-chart {
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--admin-primary) 0 42%,
    var(--admin-success) 42% 68%,
    var(--admin-warning) 68% 86%,
    var(--admin-danger) 86% 100%
  );
  box-shadow: var(--admin-shadow-sm);
}

.donut-chart span {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--admin-surface);
  color: var(--admin-text);
  font-size: var(--fs-2xl);
  font-weight: 800;
}

.legend-list div {
  padding: 0.7rem 0.8rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.legend-list strong {
  margin-left: auto;
}

.blank-panel {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
}

.blank-state {
  max-width: 440px;
  display: grid;
  justify-items: center;
}

.blank-visual {
  width: 84px;
  height: 84px;
  object-fit: contain;
  margin-bottom: 0.85rem;
}

/* --- Auth & Error pages --- */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(
    135deg,
    var(--admin-bg) 0%,
    var(--admin-primary-pastel) 44%,
    var(--admin-surface-soft) 100%
  );
}

html[data-theme='dark'] .auth-body {
  background: linear-gradient(135deg, var(--admin-bg) 0%, var(--admin-surface) 48%, #100609 100%);
}

.auth-page,
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card,
.error-card {
  width: min(100%, 460px);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow-lg);
}

.auth-card {
  padding: 1.5rem;
}

.auth-visual {
  margin-bottom: 1rem;
  height: 92px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow: hidden;
}

.auth-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.error-card {
  padding: 2rem;
  text-align: center;
}

.error-illustration {
  width: min(260px, 100%);
  max-height: 128px;
  object-fit: contain;
  margin: 0 auto 0.5rem;
}

.auth-brand,
.auth-brand:hover,
.auth-brand:focus {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
  color: var(--admin-text);
}

.auth-brand span:last-child {
  display: grid;
  line-height: 1.2;
}

.auth-brand small,
.auth-footer {
  color: var(--admin-muted);
}

.auth-footer {
  margin-top: 1.15rem;
  text-align: center;
  font-size: var(--fs-md);
}

.error-code {
  color: var(--admin-primary);
  font-size: clamp(5rem, 18vw, 8rem);
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 991.98px) {
  .dashboard-content > .container-fluid {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }
}

@media (max-width: 767.98px) {
  .panel-header {
    align-items: flex-start;
  }

  .panel-header > .d-flex {
    width: 100%;
  }

  .auth-page,
  .error-page {
    padding: 1rem;
  }

  .auth-card,
  .error-card {
    padding: 1.1rem;
  }
}

@media (max-width: 575.98px) {
  .page-heading,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading-copy {
    width: 100%;
  }

  .heading-actions {
    width: 100%;
    justify-content: stretch;
  }

  .heading-actions .btn {
    flex: 1 1 0;
  }

  .chart-bars {
    height: 210px;
    gap: 0.6rem;
    padding-inline: 0.25rem;
  }

  .metric-value {
    font-size: var(--fs-2xl);
  }

  .metric-card,
  .panel {
    padding: 1.05rem;
  }

  .page-icon {
    width: 42px;
    height: 42px;
  }

  .panel-header .d-flex,
  .panel-header .form-control,
  .panel-header .form-select {
    width: 100%;
  }

  .admin-footer .container-fluid {
    align-items: flex-start;
    flex-direction: column;
  }

  .avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .avatar-xl {
    width: 68px;
    height: 68px;
  }

  .profile-cover {
    height: 78px;
    margin-bottom: 0.7rem;
  }

  .profile-photo {
    margin-top: -36px;
  }

  .auth-visual {
    height: 78px;
  }

  .product-thumb {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 420px) {
  .heading-actions {
    width: 100%;
  }

  .heading-actions .btn {
    width: 100%;
  }

  .metric-card {
    min-height: 140px;
  }

  .profile-avatar-lg {
    width: 74px;
    height: 74px;
  }
}

/* ===========================
   SELECT2 DARK MODE
   =========================== */

html[data-theme='dark'] .select2-container--default .select2-selection--single {
  background: var(--admin-surface);
}

html[data-theme='dark']
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  color: var(--admin-text);
}

html[data-theme='dark']
  .select2-container--default
  .select2-selection--single
  .select2-selection__placeholder {
  color: var(--admin-muted);
}

html[data-theme='dark']
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow
  b {
  border-top-color: var(--admin-muted);
}

/* Dropdown */
html[data-theme='dark'] .select2-dropdown {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
}

/* Search */
html[data-theme='dark'] .select2-search--dropdown .select2-search__field {
  background: var(--admin-bg);
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
}

html[data-theme='dark'] .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--admin-primary);
  outline: none;
}

/* Item */
html[data-theme='dark'] .select2-results__option {
  background: var(--admin-surface);
  color: var(--admin-text);
}

/* Hover */
html[data-theme='dark'] .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--admin-primary);
  color: #fff;
}

/* Selected */
html[data-theme='dark'] .select2-results__option--selected {
  background: var(--admin-surface-soft);
  color: var(--admin-text);
}

/* Disabled */
html[data-theme='dark']
  .select2-container--default.select2-container--disabled
  .select2-selection--single {
  background: #2b2b2b;
  color: var(--admin-muted);
}

/* ============================================================
   7. TABLE
   ============================================================ */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--admin-text);
  --bs-table-border-color: var(--admin-border);
  color: var(--admin-text);
  font-size: var(--fs-sm);
  table-layout: fixed;
  width: 100% !important;
}

html[data-theme='dark'] .table {
  --bs-table-border-color: #1c1f22;
}

.table thead th {
  color: var(--admin-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
}

.table tbody td {
  /* min-width: 120px; */
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  white-space: normal;
  word-wrap: break-word;
}

.table thead {
  --bs-table-bg: var(--admin-surface-soft); /* warna background header */
}

html[data-theme='dark'] .table thead input,
.table thead select {
  background-color: var(--bs-dark);
}

html[data-theme='dark'] .table thead {
  --bs-table-bg: #1c1f22; /* warna background header */
}

.table thead input,
.table thead select {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 12px;
}

.table tbody tr {
  transition: background 0.16s ease;
}

.table tbody tr:hover {
  background: var(--admin-surface-soft);
}

.table-search {
  width: min(260px, 100%);
  border-color: var(--admin-border);
  border-radius: 8px;
}

.table-media {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* ============================================================
   Style global untuk SEMUA tabel DataTables di aplikasi.
   Cukup ditaruh sekali di file CSS utama (mis. admin.css),
   tidak perlu <style> lokal lagi di tiap halaman.

   CATATAN: table-layout:fixed SENGAJA TIDAK dipakai di sini karena
   akan mengganggu perhitungan lebar oleh extension Responsive
   DataTables (Responsive butuh mengukur lebar asli tiap kolom).
   ============================================================ */

table.dataTable tbody td {
  word-wrap: break-word;
}

/* Header rapi: teks rata kiri, judul kolom tidak melebihi lebar kolom
   (turun ke bawah jika perlu), ikon sort tetap di kanan */
table.dataTable thead th {
  text-align: left !important;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  vertical-align: middle;
  position: relative;
  padding-right: 22px !important;
}

/* Ikon sort DataTables 2.x — dipaksa selalu menempel di kanan header */
table.dataTable thead th .dt-column-order {
  position: absolute !important;
  right: 6px;
  top: 50%;
  left: auto !important;
  transform: translateY(-50%);
}

/* Fallback untuk versi DataTables lama (class sorting/sorting_asc/sorting_desc) */
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead th.sorting_desc::after {
  right: 6px !important;
  left: auto !important;
}

/* Tulisan tidak terlalu besar supaya data panjang tetap muat */
table.dataTable,
table.dataTable thead th,
table.dataTable tbody td {
  font-size: 0.8rem;
}

/* Baris detail yang dibuka lewat tombol "+" pada mode Responsive */
table.dataTable > tbody > tr.dtr-expanded td.dtr-control {
  background: transparent;
}

table.dataTable td.dtr-control {
  cursor: pointer;
}

table.dataTable td.dtr-control::before {
  color: var(--bs-primary, #dc3545);
}

.product-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--admin-border);
}

.page-link {
  border-color: var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-text);
  font-size: var(--fs-sm);
}

.page-link:hover,
.page-link:focus {
  border-color: var(--admin-primary);
  background: var(--admin-surface-soft);
  color: var(--admin-primary);
}

.page-item.active .page-link {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
  color: #ffffff;
}

.page-item.disabled .page-link {
  border-color: var(--admin-border);
  background: var(--admin-surface-soft);
  color: var(--admin-muted);
}

.select2-container--default .select2-selection--single {
  height: calc(2.25rem + 2px);
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--admin-border);
  border-radius: 0.375rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.5;
  padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: calc(2.25rem + 2px);
}

@media (max-width: 767.98px) {
  .table-search {
    width: 100%;
  }
}

/* ============================================================
   8. FORM & BUTTONS
   ============================================================ */
.form-control,
.form-select {
  border-color: var(--admin-border);
  background-color: var(--admin-surface);
  color: var(--admin-text);
  font-size: var(--fs-base);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--admin-primary-light);
  background-color: var(--admin-surface);
  color: var(--admin-text);
  box-shadow: var(--admin-ring);
}

.form-control::placeholder {
  color: var(--admin-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: var(--fs-sm);
  box-shadow: var(--admin-shadow-sm);
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.btn:hover,
.btn:focus {
  transform: translateY(-1px);
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--admin-primary);
  --bs-btn-border-color: var(--admin-primary);

  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--admin-primary-dark);
  --bs-btn-hover-border-color: var(--admin-primary-dark);

  --bs-btn-focus-shadow-rgb: 190, 18, 60;

  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--admin-primary-dark);
  --bs-btn-active-border-color: var(--admin-primary-dark);

  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--admin-primary);
  --bs-btn-disabled-border-color: var(--admin-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--admin-primary-dark);
  background: var(--admin-primary-dark);
}

.btn-light {
  border-color: var(--admin-border);
  background: var(--admin-surface-soft);
  color: var(--admin-text);
}

.btn-outline-secondary {
  border-color: var(--admin-border);
  color: var(--admin-text);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: var(--admin-primary);
  background: var(--admin-primary-pastel);
  color: var(--admin-primary-dark);
}

.btn-outline-primary {
  border-color: var(--admin-primary);
  color: var(--admin-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  border-color: var(--admin-primary-dark);
  background: var(--admin-primary);
  color: #ffffff;
}

/* Nav-pills generik (dipakai di luar sidebar) */
.nav-pills .nav-link {
  color: var(--admin-text);
}

.nav-pills .nav-link:hover {
  color: var(--admin-primary);
}

.nav-pills .nav-link.active {
  background: var(--admin-primary);
  border-color: var(--admin-primary);
  color: #ffffff;
}

/* Nav-tabs bergaya pill dengan badge count (mis. tab notifikasi/deadline) */
.nav-tabs {
  border-bottom: 0;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.nav-tabs .nav-item {
  margin-bottom: 0;
}

.nav-tabs .nav-link {
  border: 1.5px solid var(--admin-border) !important;
  border-radius: 9px !important;
  background: var(--admin-surface) !important;
  color: var(--admin-muted) !important;
  font-weight: 700;
  font-size: var(--fs-sm);
  line-height: 1;
  padding: 0.55rem 0.9rem;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus-visible {
  border-color: var(--admin-primary-light) !important;
  color: var(--admin-text) !important;
  outline: none;
}

.nav-tabs .nav-link.active {
  border-color: var(--admin-primary) !important;
  background: var(--admin-primary) !important;
  color: var(--admin-surface) !important;
  font-weight: 800;
  box-shadow: var(--admin-ring);
}

.nav-tabs .nav-link .badge {
  font-size: var(--fs-xs);
}

.form-check-input:checked {
  background-color: var(--admin-primary);
  border-color: var(--admin-primary);
}

.form-check-input:focus {
  box-shadow: var(--admin-ring);
}

.dropdown-menu,
.modal-content,
.accordion-item,
.accordion-button {
  border-color: var(--admin-border);
  background-color: var(--admin-surface);
  color: var(--admin-text);
}

.dropdown-item,
.accordion-body {
  color: var(--admin-text);
  font-size: var(--fs-sm);
}

.dropdown-item:hover,
.dropdown-item:focus,
.accordion-button:not(.collapsed) {
  background-color: var(--admin-surface-soft);
  color: var(--admin-text);
}

html[data-theme='dark'] .modal-header,
html[data-theme='dark'] .modal-footer,
html[data-theme='dark'] .accordion-item {
  border-color: var(--admin-border);
}

html[data-theme='dark'] .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%);
}

.alert {
  border-radius: 8px;
  font-size: var(--fs-sm);
}

html[data-theme='dark'] .alert-primary {
  border-color: var(--admin-primary-dark);
  background: var(--admin-primary-pastel);
  color: var(--admin-primary-light);
}

html[data-theme='dark'] .alert-success {
  border-color: var(--admin-success);
  background: var(--admin-success-pastel);
  color: var(--admin-success);
}

html[data-theme='dark'] .alert-warning {
  border-color: var(--admin-warning);
  background: var(--admin-warning-pastel);
  color: var(--admin-warning);
}

html[data-theme='dark'] .alert-danger {
  border-color: var(--admin-danger);
  background: var(--admin-danger-pastel);
  color: var(--admin-danger);
}

@media (max-width: 575.98px) {
  .panel-header .d-flex,
  .panel-header .form-control,
  .panel-header .form-select {
    width: 100%;
  }
}

/* ============================================================
   9. UTILITY (badge, progress, warna status)
   ============================================================ */

/* Badge dibuat lebih kontras: warna solid + teks putih */
.badge {
  border: none !important;
  border-radius: 999px;
  font-size: var(--fs-xs) !important;
  font-weight: 700;
  padding: 0.32rem 0.65rem;
}

.bg-primary,
.text-bg-primary {
  background: var(--admin-gradient) !important;
  color: #ffffff !important;
}

.bg-success,
.text-bg-success {
  background: var(--admin-success) !important;
  color: #ffffff !important;
}

.bg-warning,
.text-bg-warning {
  background: var(--admin-warning) !important;
  color: #ffffff !important;
}

.bg-danger,
.text-bg-danger {
  background: var(--admin-danger) !important;
  color: #ffffff !important;
}

.bg-info,
.text-bg-info {
  background: var(--admin-info) !important;
  color: #ffffff !important;
}

.text-bg-secondary {
  background-color: var(--admin-muted) !important;
  color: #ffffff !important;
}

.text-muted {
  color: var(--admin-muted) !important;
}

html[data-theme='dark'] .text-body {
  color: var(--admin-text) !important;
}

.progress {
  height: 1.1rem;
  border-radius: 8px;
  background: var(--admin-surface-soft);
}

.progress-bar {
  border-radius: 8px;
  font-size: var(--fs-xs);
  font-weight: 800;
  background: var(--admin-gradient);
}

.progress-42 {
  width: 42%;
}

.progress-58 {
  width: 58%;
}

.progress-72 {
  width: 72%;
}

/* ============================================================
   10. RESPONSIVE (tambahan lintas-section, global)
   ============================================================ */
@media (max-width: 991.98px) {
  .admin-sidebar {
    box-shadow: 18px 0 48px rgba(0, 0, 0, 0.28);
  }
}

/* ============================================================
   11. DARK MODE — penyesuaian yang tidak murni token
   ============================================================ */
html[data-theme='dark'] .table tbody tr:hover {
  background: var(--admin-surface-soft);
}
