:root {
  --king-bg: #050506;
  --king-surface: #15171c;
  --king-surface-alt: #1d2027;
  --king-green: #b7ff5a;
  --king-purple: #c2a6ff;
  --king-text: #f4f7ef;
  --king-muted: #a4aaad;
  --king-border: rgba(194, 166, 255, 0.24);
}

html,
html body {
  background: var(--king-bg) !important;
  color: var(--king-text) !important;
}

html body,
html body #root,
html body .app,
html body .page-wrapper,
html body .main-content,
html body .content-wrapper {
  min-width: 0;
  max-width: 100%;
}

html body .card,
html body .panel,
html body .panel-card,
html body .modal-content,
html body .featured-box,
html body .featured-box-login,
html body .loginInner1,
html body .dropdown-menu {
  background: var(--king-surface) !important;
  color: var(--king-text) !important;
  border-color: var(--king-border) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34) !important;
}

html body input,
html body select,
html body textarea,
html body .form-control,
html body .form-select {
  background: var(--king-surface-alt) !important;
  color: var(--king-text) !important;
  border-color: var(--king-border) !important;
}

html body input::placeholder,
html body textarea::placeholder {
  color: var(--king-muted) !important;
}

html body .btn-primary,
html body .btn-success,
html body .btn-theme,
html body .btn-submit,
html body .btn-login,
html body .login-btn,
html body .signup-btn {
  background: var(--king-green) !important;
  color: #101114 !important;
  border-color: var(--king-green) !important;
}

html body .rules-btn,
html body .theme-option.active,
html body .theme-switcher__trigger,
html body .nav-tab.active,
html body .btn-secondary,
html body .btn-warning,
html body .btn-outline-primary,
html body .btn-outline-secondary {
  background: var(--king-purple) !important;
  color: #101114 !important;
  border-color: var(--king-purple) !important;
}

html body .bg-green,
html body .btn.bg-green {
  background: var(--king-green) !important;
  color: #101114 !important;
  border-color: var(--king-green) !important;
}

html body .bg-red,
html body .btn.bg-red {
  background: var(--king-purple) !important;
  color: #101114 !important;
  border-color: var(--king-purple) !important;
}

html body a,
html body .text-primary,
html body .link-primary {
  color: var(--king-green) !important;
}

html body .text-muted,
html body small,
html body .muted {
  color: var(--king-muted) !important;
}

html body .table,
html body .table th,
html body .table td {
  color: var(--king-text) !important;
  border-color: var(--king-border) !important;
}

html body .table thead,
html body .table thead th {
  background: var(--king-surface-alt) !important;
  color: var(--king-green) !important;
}

/* Admin shell: keep the navigation and content frame aligned at laptop widths. */
html body .sidebar,
html body .side-bar,
html body .left-sidebar,
html body .admin-sidebar,
html body aside {
  background: var(--king-surface) !important;
  border-color: var(--king-border) !important;
  color: var(--king-text) !important;
  box-sizing: border-box;
}

html body .sidebar a,
html body .side-bar a,
html body .left-sidebar a,
html body .admin-sidebar a,
html body aside a,
html body .sidebar .nav-link,
html body .side-bar .nav-link,
html body .left-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--king-text) !important;
  border-color: var(--king-border) !important;
}

html body .sidebar a:hover,
html body .side-bar a:hover,
html body .left-sidebar a:hover,
html body .admin-sidebar a:hover,
html body aside a:hover,
html body .sidebar a.active,
html body .side-bar a.active,
html body .left-sidebar a.active {
  background: var(--king-purple) !important;
  color: #101114 !important;
}

html body .sidebar a.active svg,
html body .sidebar a.active i,
html body .side-bar a.active svg,
html body .side-bar a.active i,

html body .admin-sidebar .nav-icon,
html body .admin-sidebar .nav-icon svg,
html body .admin-sidebar .nav-icon i {
  color: var(--king-green) !important;
}

html body .admin-sidebar .dropdown-header,
html body .admin-sidebar .dropdown-header svg,
html body .admin-sidebar .dropdown-header i {
  color: var(--king-purple) !important;
}
html body aside a.active svg,
html body aside a.active i {
  color: #101114 !important;
}

html body .main-content,
html body .content-wrapper,
html body .page-wrapper,
html body .admin-content,
html body .admin-main {
  width: auto;
  max-width: 100%;
  min-width: 0;
  background: var(--king-bg) !important;
  color: var(--king-text) !important;
}

html body .table-responsive,
html body [class*="table-responsive-"] {
  max-width: 100%;
  scrollbar-color: var(--king-purple) var(--king-surface);
}

html body .table-responsive::-webkit-scrollbar,
html body [class*="table-responsive-"]::-webkit-scrollbar {
  height: 8px;
}

html body .table-responsive::-webkit-scrollbar-thumb,
html body [class*="table-responsive-"]::-webkit-scrollbar-thumb {
  background: var(--king-purple);
}

@media (min-width: 769px) {
  html body .admin {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0 !important;
    overflow-x: hidden;
  }

  html body .admin > .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px !important;
    max-width: 280px;
    height: 100vh;
    transform: translateX(0) !important;
    overflow-y: auto;
    z-index: 1000;
  }

  html body .admin > .admin-sidebar.hidden {
    transform: translateX(-100%) !important;
  }

  html body .admin > .main,
  html body .admin > .main + div,
  html body .admin > footer {
    width: calc(100% - 280px) !important;
    max-width: calc(100% - 280px) !important;
    margin-left: 280px !important;
    min-width: 0;
    transition: margin-left .2s ease, width .2s ease;
  }

  html body .admin > .admin-sidebar {
    transition: transform .2s ease;
  }

  html body .admin > .desktop-menu-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    background: var(--king-purple) !important;
    color: #101114 !important;
    cursor: pointer;
  }

  html body .admin:has(> .admin-sidebar.hidden) > .main,
  html body .admin:has(> .admin-sidebar.hidden) > .main + div,
  html body .admin:has(> .admin-sidebar.hidden) > footer {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }
}

@media (max-width: 768px) {
  html body {
    overflow-x: hidden !important;
  }

  html body .container,
  html body .container-fluid,
  html body .row,
  html body .card,
  html body .panel,
  html body .featured-box,
  html body .main-content,
  html body .content-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  html body .table-responsive,
  html body [class*="table-responsive-"] {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  html body table {
    min-width: 620px;
  }

  html body .navbar,
  html body .navbar-nav,
  html body .nav-tabs,
  html body .toolbar,
  html body .button-group {
    flex-wrap: wrap;
  }

  html body button,
  html body .btn,
  html body input,
  html body select,
  html body textarea {
    max-width: 100%;
  }

  html body .sidebar,
  html body .side-bar,
  html body .left-sidebar,
  html body .admin-sidebar,
  html body aside {
    position: relative;
    width: 100% !important;
    max-width: 100%;
    min-height: auto;
  }

  html body .admin > .admin-sidebar {
    width: 280px !important;
    max-width: 280px;
    transform: translateX(-100%);
  }

  html body .admin > .admin-sidebar:not(.hidden) {
    transform: translateX(0) !important;
  }

  html body .mobile-menu-btn,
  html body .desktop-menu-btn {
    cursor: pointer;
    z-index: 1100;
  }

  html body .admin > .main,
  html body .admin > .main + div,
  html body .admin > footer {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }


/* Keep the React sidebar state authoritative after legacy styles load. */
html body .admin > .admin-sidebar.hidden {
  transform: translateX(-100%) !important;
}

@media (min-width: 769px) {
  html body .admin > .admin-sidebar:not(.hidden) {
    transform: translateX(0) !important;
  }
}
  html body .sidebar a,
  html body .side-bar a,
  html body .left-sidebar a,
  html body .admin-sidebar a,
  html body aside a {
    min-height: 40px;
  }

  html body .main-content,
  html body .content-wrapper,
  html body .page-wrapper,
  html body .admin-content,
  html body .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

.role-badge{display:inline-block;min-width:22px;padding:1px 6px;margin-right:6px;border-radius:4px;background:#ffd447;color:#111;font-size:11px;font-weight:800;line-height:16px;text-align:center;letter-spacing:.3px;vertical-align:middle}
.role-badge.role-user{background:#2f7d32;color:#fff}
.role-badge.role-super_admin{background:#c0392b;color:#fff}

