/**
 * NR.RAD Modern Enterprise Dark ISP & Billing Theme
 * High-Contrast, Sleek & Ultra-Fast Dark Modern Dashboard Theme
 */

:root {
  /* Brand Primary Colors (Electric Blue / Modern Indigo) */
  --app-primary: #3b82f6;
  --app-primary-hover: #60a5fa;
  --app-primary-gradient: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  --app-primary-soft: rgba(59, 130, 246, 0.15);
  --app-primary-border: rgba(59, 130, 246, 0.35);

  /* Modern Vibrant Accents for Dark Mode */
  --app-cyan: #06b6d4;
  --app-cyan-soft: rgba(6, 182, 212, 0.15);
  --app-emerald: #10b981;
  --app-emerald-soft: rgba(16, 185, 129, 0.15);
  --app-amber: #f59e0b;
  --app-amber-soft: rgba(245, 158, 11, 0.15);
  --app-rose: #f43f5e;
  --app-rose-soft: rgba(244, 63, 94, 0.15);
  --app-indigo: #6366f1;
  --app-indigo-soft: rgba(99, 102, 241, 0.15);

  /* Dark Modern Obsidian & Slate Palette */
  --app-dark: #f8fafc; /* Inverted for readability: elements using var(--app-dark) render crystal white */
  --app-slate: #cbd5e1;
  --app-gray: #94a3b8;
  --app-border: #1e293b;
  --app-border-light: #25334d;
  --app-bg: #0b0f19;
  --app-card-bg: #131b2e;
  --app-surface: #162036;

  /* Backward Compatibility Mapping */
  --allur-pink: var(--app-primary);
  --allur-pink-gradient: var(--app-primary-gradient);
  --allur-pink-soft: var(--app-primary-soft);
  --allur-blue: var(--app-primary);
  --allur-blue-soft: var(--app-primary-soft);
  --allur-cyan: var(--app-emerald);
  --allur-cyan-soft: var(--app-emerald-soft);
  --allur-teal: var(--app-cyan);
  --allur-teal-soft: var(--app-cyan-soft);
  --allur-yellow: var(--app-amber);
  --allur-yellow-soft: var(--app-amber-soft);
  --allur-purple: var(--app-indigo);
  --allur-purple-soft: var(--app-indigo-soft);
  --allur-dark: var(--app-dark);
  --allur-slate: var(--app-slate);
  --allur-gray: var(--app-gray);
  --allur-border: var(--app-border);
  --allur-bg: var(--app-bg);
  --allur-card-bg: var(--app-card-bg);

  /* Bootstrap 5 & AdminLTE 4 Native Variables Override */
  --bs-body-bg: #0b0f19 !important;
  --bs-body-bg-rgb: 11, 15, 25 !important;
  --bs-body-color: #cbd5e1 !important;
  --bs-body-color-rgb: 203, 213, 225 !important;
  --bs-emphasis-color: #f8fafc !important;
  --bs-emphasis-color-rgb: 248, 250, 252 !important;
  --bs-secondary-color: #94a3b8 !important;
  --bs-secondary-color-rgb: 148, 163, 184 !important;
  --bs-secondary-bg: #162036 !important;
  --bs-secondary-bg-rgb: 22, 32, 54 !important;
  --bs-tertiary-color: #64748b !important;
  --bs-tertiary-color-rgb: 100, 116, 139 !important;
  --bs-tertiary-bg: #131b2e !important;
  --bs-tertiary-bg-rgb: 19, 27, 46 !important;
  --bs-heading-color: #f8fafc !important;
  --bs-link-color: #3b82f6 !important;
  --bs-link-hover-color: #60a5fa !important;
  --bs-border-color: #1e293b !important;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.08) !important;
  --bs-card-bg: #131b2e !important;
  --bs-card-color: #cbd5e1 !important;
  --bs-card-border-color: #1e293b !important;
  --bs-card-cap-bg: #162036 !important;
  --bs-card-cap-color: #f8fafc !important;
  --bs-modal-bg: #131b2e !important;
  --bs-modal-color: #cbd5e1 !important;
  --bs-modal-border-color: #1e293b !important;
  --bs-dropdown-bg: #131b2e !important;
  --bs-dropdown-color: #cbd5e1 !important;
  --bs-dropdown-border-color: #1e293b !important;
  --bs-dropdown-link-color: #cbd5e1 !important;
  --bs-dropdown-link-hover-color: #f8fafc !important;
  --bs-dropdown-link-hover-bg: #1a2642 !important;
  --bs-light-rgb: 22, 32, 54 !important;
  --bs-dark-rgb: 248, 250, 252 !important;
}

[data-bs-theme="dark"],
[data-bs-theme="light"],
html, body {
  color-scheme: dark !important;
  --bs-body-bg: #0b0f19 !important;
  --bs-body-bg-rgb: 11, 15, 25 !important;
  --bs-body-color: #cbd5e1 !important;
  --bs-body-color-rgb: 203, 213, 225 !important;
  --bs-emphasis-color: #f8fafc !important;
  --bs-emphasis-color-rgb: 248, 250, 252 !important;
  --bs-secondary-color: #94a3b8 !important;
  --bs-secondary-color-rgb: 148, 163, 184 !important;
  --bs-secondary-bg: #162036 !important;
  --bs-secondary-bg-rgb: 22, 32, 54 !important;
  --bs-tertiary-color: #64748b !important;
  --bs-tertiary-color-rgb: 100, 116, 139 !important;
  --bs-tertiary-bg: #131b2e !important;
  --bs-tertiary-bg-rgb: 19, 27, 46 !important;
  --bs-heading-color: #f8fafc !important;
  --bs-border-color: #1e293b !important;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.08) !important;
  --bs-card-bg: #131b2e !important;
  --bs-card-color: #cbd5e1 !important;
  --bs-modal-bg: #131b2e !important;
  --bs-dropdown-bg: #131b2e !important;
}

html, body {
  height: 100% !important;
  min-height: 100% !important;
  background-color: #0b0f19 !important;
  color: #cbd5e1 !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  background-color: #0b0f19 !important;
  color: #cbd5e1 !important;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  display: flex !important;
  flex-direction: column !important;
}

.app-wrapper,
.wrapper,
body.layout-fixed .app-wrapper {
  background-color: #0b0f19 !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 0 auto !important;
}

.app-main,
.content-wrapper,
.app-content {
  background-color: #0b0f19 !important;
  color: #cbd5e1 !important;
  flex: 1 0 auto !important;
}

/* ========================================================
   GLOBAL TEXT & ICON VISIBILITY GUARANTEES (DARK MODERN)
   ======================================================== */
.text-dark {
  color: #f8fafc !important;
}

.text-body {
  color: #cbd5e1 !important;
}

.text-muted {
  color: #94a3b8 !important;
}

.text-secondary {
  color: #94a3b8 !important;
}

.text-black {
  color: #f8fafc !important;
}

.text-primary {
  color: #60a5fa !important;
}

.text-success {
  color: #34d399 !important;
}

.text-danger {
  color: #f87171 !important;
}

.text-warning {
  color: #fbbf24 !important;
}

.text-info {
  color: #38bdf8 !important;
}

.text-white-50 {
  color: rgba(248, 250, 252, 0.65) !important;
}

/* Ensure text on yellow / warning backgrounds is ALWAYS dark obsidian for 100% legibility */
.btn-warning,
.btn-warning *,
.badge.bg-warning,
.badge.bg-warning *,
.bg-warning,
.bg-warning *,
.badge-warning,
.badge-warning *,
.badge-allur-yellow,
.badge-allur-yellow * {
  color: #0b0f19 !important;
}

.btn-warning .text-dark,
.badge.bg-warning .text-dark,
.bg-warning .text-dark,
.bg-warning-subtle .text-dark {
  color: #0b0f19 !important;
}

h1, h2, h3, h4, h5, h6 {
  color: #f8fafc !important;
}

/* Code & pre styling for dark mode */
code {
  background-color: #1a2642 !important;
  color: #38bdf8 !important;
  border: 1px solid #25334d !important;
  padding: 0.15rem 0.4rem !important;
  border-radius: 6px !important;
  font-size: 0.85em !important;
}

pre {
  background-color: #131b2e !important;
  border: 1px solid #1e293b !important;
  color: #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 1rem !important;
}

/* Subtle background overrides for dark modern */
.bg-white {
  background-color: #131b2e !important;
  color: #cbd5e1 !important;
}

.bg-light,
.bg-light-subtle,
.bg-body,
.bg-body-tertiary {
  background-color: #162036 !important;
  color: #cbd5e1 !important;
}

.bg-secondary-subtle,
.bg-body-secondary {
  background-color: #1a2642 !important;
  color: #cbd5e1 !important;
  border: 1px solid #25334d !important;
}

.border {
  border-color: #1e293b !important;
}

.border-top,
.border-bottom,
.border-start,
.border-end {
  border-color: #1e293b !important;
}

hr {
  border-color: #1e293b !important;
  opacity: 0.6;
}

/* ========================================================
   TOP HEADER / NAVBAR (Dark Sleek Glassmorphism)
   ======================================================== */
.app-header.navbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1020 !important;
  background-color: rgba(13, 19, 33, 0.94) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--app-border) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
  height: 64px;
  padding: 0 1.5rem;
}

/* ========================================================
   SIDEBAR TOGGLE BUTTON (Dark Modern)
   ======================================================== */
.btn-sidebar-toggle {
  position: relative !important;
  background-color: #162036 !important;
  color: #94a3b8 !important;
  border: 1px solid #25334d !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  padding: 0 !important;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.btn-sidebar-toggle:hover {
  background-color: #1e293b !important;
  color: var(--app-primary-hover) !important;
  border-color: var(--app-primary) !important;
  transform: translateY(-1px);
}

.btn-sidebar-toggle .btn-glow-ring {
  display: none !important;
}

/* Arrow SVG Styling */
.arrow-icon-svg {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
  transition: transform 0.25s ease;
}

html.sidebar-icon-only .arrow-icon-svg,
body.sidebar-icon-only .arrow-icon-svg {
  transform: rotate(0deg);
}

html:not(.sidebar-icon-only) .arrow-icon-svg,
body:not(.sidebar-icon-only) .arrow-icon-svg {
  transform: rotate(180deg);
}

.arrow-base-path {
  stroke: #94a3b8;
  transition: stroke 0.2s ease;
}

.btn-sidebar-toggle:hover .arrow-base-path {
  stroke: #60a5fa;
}

.arrow-glow-path {
  display: none !important;
}

/* Header Search (Dark Minimalist) */
.allur-search-input {
  background-color: #162036 !important;
  border: 1px solid #25334d !important;
  border-radius: 8px;
  padding: 0.42rem 1rem 0.42rem 2.2rem;
  font-size: 0.84rem;
  color: #f8fafc !important;
  width: 240px;
  transition: all 0.2s ease;
}

.allur-search-input::placeholder {
  color: #64748b !important;
}

.allur-search-input:focus {
  background-color: #1a2642 !important;
  border-color: var(--app-primary) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
  width: 280px;
}

.allur-search-wrap {
  position: relative;
  display: inline-block;
}

.allur-search-wrap i {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.82rem;
  pointer-events: none;
}

/* Header Actions */
.header-action-icon {
  color: #94a3b8 !important;
  font-size: 1rem;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.header-action-icon:hover {
  background-color: #162036 !important;
  color: #60a5fa !important;
}

.header-action-icon .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background-color: var(--app-primary);
  border-radius: 50%;
  border: 1.5px solid #131b2e;
}

.user-nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #25334d;
}

/* ========================================================
   SIDEBAR (Dark Sleek Obsidian)
   ======================================================== */
.app-sidebar {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  height: 100vh !important;
  max-height: 100vh !important;
  background-color: #0c1222 !important;
  border-right: 1px solid var(--app-border) !important;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.35) !important;
  color: var(--app-slate) !important;
  z-index: 1038 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.sidebar-wrapper {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.sidebar-brand {
  height: 64px;
  padding: 1rem 1.25rem !important;
  border-bottom: 1px solid var(--app-border) !important;
  display: flex;
  align-items: center;
  background-color: #0c1222 !important;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none !important;
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.brand-link:hover .brand-logo-img {
  transform: scale(1.05);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f8fafc !important;
  letter-spacing: -0.5px;
}

.brand-rad-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.brand-rad-text .text-pink {
  color: var(--app-primary) !important;
}

.brand-rad-text .text-blue {
  color: #f8fafc !important;
}

.brand-collapse-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
}

.brand-collapse-btn:hover {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
}

/* Sidebar Company Identity Badge */
.sidebar-user-card {
  position: relative;
  margin: 12px 14px 14px;
  padding: 1.1rem 1rem 1rem;
  text-align: center;
  background: #131b2e !important;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  transition: all 0.2s ease;
}

.sidebar-user-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--app-primary-gradient);
  border-radius: 12px 12px 0 0;
}

.sidebar-user-card:hover {
  background: #162036 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  border-color: rgba(59, 130, 246, 0.3);
}

.sidebar-company-logo-wrap {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-company-logo {
  max-width: 130px;
  max-height: 52px;
  width: auto;
  height: auto;
  min-width: 38px;
  min-height: 38px;
  object-fit: contain;
  border-radius: 8px;
  padding: 4px 6px;
  background: #162036;
  border: 1px solid #25334d;
}

.sidebar-company-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #f8fafc !important;
  margin-bottom: 0.1rem;
  line-height: 1.3;
}

.sidebar-company-slogan {
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8 !important;
  margin-bottom: 0;
}

/* Sidebar Navigation Items */
.nav-header {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #64748b !important;
  padding: 1rem 1.4rem 0.35rem !important;
}

.sidebar-menu .nav-item {
  margin-bottom: 2px;
}

.sidebar-menu .nav-link {
  color: #94a3b8 !important;
  font-size: 0.84rem !important;
  font-weight: 500 !important;
  padding: 0.58rem 0.95rem !important;
  margin: 0 0.75rem !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  transition: all 0.15s ease !important;
}

.sidebar-menu .nav-link i.nav-icon {
  width: 20px !important;
  font-size: 0.95rem !important;
  color: #60a5fa !important;
  margin-right: 0.75rem !important;
  text-align: center !important;
  transition: color 0.15s ease !important;
}

.sidebar-menu .nav-link:hover:not(.active) {
  background-color: #162036 !important;
  color: #ffffff !important;
}

.sidebar-menu .nav-link:hover:not(.active) i.nav-icon {
  color: #93c5fd !important;
}

/* SIGNATURE ACTIVE NAV PILL */
.sidebar-menu .nav-link.active {
  background: var(--app-primary-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4) !important;
  font-weight: 600 !important;
}

.sidebar-menu .nav-link.active i.nav-icon {
  color: #ffffff !important;
}

.sidebar-menu .nav-link .nav-chevron {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.5;
}

.sidebar-menu .nav-link.active .nav-chevron {
  opacity: 0.9;
  color: #ffffff;
}

/* ========================================================
   CARDS & CONTAINERS (DARK MODERN)
   ======================================================== */
.card {
  background-color: #131b2e !important;
  border: 1px solid var(--app-border) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  margin-bottom: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: var(--app-slate) !important;
}

.card-header {
  background-color: #162036 !important;
  border-bottom: 1px solid var(--app-border) !important;
  padding: 1rem 1.25rem !important;
  color: #f8fafc !important;
}

.card-title {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  margin-bottom: 0 !important;
}

.card-subtitle {
  font-size: 0.78rem !important;
  color: #94a3b8 !important;
  margin-top: 0.2rem;
}

.card-body {
  padding: 1.25rem !important;
  color: var(--app-slate) !important;
}

.card-footer {
  background-color: #162036 !important;
  border-top: 1px solid var(--app-border) !important;
  padding: 1rem 1.25rem !important;
  color: #94a3b8 !important;
}

/* KPI / STAT CARDS */
.kpi-card {
  background: #131b2e !important;
  border: 1px solid var(--app-border) !important;
  border-radius: 12px;
  padding: 1.2rem 1.3rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: #25334d !important;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4) !important;
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.kpi-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc !important;
  margin-bottom: 0;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: #94a3b8 !important;
  margin-bottom: 0.85rem;
}

.kpi-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.85rem;
}

.kpi-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background-color: #1a2642 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #60a5fa !important;
  flex-shrink: 0;
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: #f8fafc !important;
  letter-spacing: -0.5px;
  margin-bottom: 0;
}

.kpi-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: #60a5fa !important;
  text-decoration: none;
  transition: color 0.15s;
}

.kpi-link:hover {
  color: #93c5fd !important;
  text-decoration: underline;
}

/* ========================================================
   BADGES (High-Contrast, Luminous & Crisp)
   ======================================================== */
.badge {
  font-weight: 600 !important;
  font-size: 0.74rem !important;
  padding: 0.35rem 0.7rem !important;
  border-radius: 6px !important;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.badge.bg-primary, .badge-allur-blue {
  background: var(--app-primary-gradient) !important;
  color: #ffffff !important;
  border: none !important;
}

.badge.bg-success, .badge-allur-green, .badge-allur-cyan {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border: none !important;
}

.badge.bg-danger, .badge-allur-pink {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%) !important;
  color: #ffffff !important;
  border: none !important;
}

.badge.bg-warning, .badge-allur-yellow, .badge-warning {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
  color: #0b0f19 !important;
  font-weight: 700 !important;
  border: none !important;
}

.badge.bg-secondary, .badge-allur-gray {
  background: #334155 !important;
  color: #f8fafc !important;
  border: none !important;
}

/* Standalone badge-allur-* */
.badge-allur-pink,
.badge-allur-cyan,
.badge-allur-green,
.badge-allur-blue,
.badge-allur-gray,
.badge-allur-yellow {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.74rem;
  padding: 0.32rem 0.65rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.badge.bg-info {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%) !important;
  color: #ffffff !important;
  border: none !important;
}

.badge.bg-light,
.badge.bg-light-subtle,
.badge.bg-white {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
}

.badge.bg-light:not([class*="text-"]),
.badge.bg-white:not([class*="text-"]) {
  color: #cbd5e1 !important;
}

/* Subtly tinted badges in Dark Modern */
.bg-primary-subtle {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
}

.bg-success-subtle {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

.bg-danger-subtle {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.bg-warning-subtle {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

.bg-info-subtle {
  background-color: rgba(6, 182, 212, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(6, 182, 212, 0.35) !important;
}

/* ========================================================
   TABLES (Clean, Readable & High Performance Dark Mode)
   ======================================================== */
.table {
  --bs-table-bg: transparent !important;
  --bs-table-color: #cbd5e1 !important;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
  --bs-table-striped-color: #cbd5e1 !important;
  --bs-table-active-bg: rgba(59, 130, 246, 0.12) !important;
  --bs-table-active-color: #f8fafc !important;
  --bs-table-hover-bg: rgba(255, 255, 255, 0.04) !important;
  --bs-table-hover-color: #f8fafc !important;
  --bs-table-border-color: #1e293b !important;
  background-color: transparent !important;
  color: #cbd5e1 !important;
  margin-bottom: 0 !important;
  border-color: #1e293b !important;
}

.table > :not(caption) > * > * {
  box-shadow: none !important;
  background-color: transparent !important;
  color: inherit !important;
  border-bottom: 1px solid #1e293b !important;
}

.table thead th,
.table thead.table-light th,
.table-light,
.table-light > th,
.table-light > td,
.table > :not(caption) > .table-light > * {
  background-color: #162036 !important;
  border-bottom: 1px solid #25334d !important;
  color: #f1f5f9 !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 0.85rem 1rem !important;
  white-space: nowrap;
}

.table tbody td {
  padding: 0.85rem 1rem !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #1e293b !important;
  font-size: 0.84rem !important;
  color: #cbd5e1 !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.02) !important;
  color: #cbd5e1 !important;
}

/* Base Table Hover in Dark Mode */
.table-hover > tbody > tr:hover > *,
.table-hover > tbody > tr:hover {
  background-color: rgba(255, 255, 255, 0.055) !important;
  color: #f8fafc !important;
  box-shadow: none !important;
}

.table-hover > tbody > tr:hover .text-dark,
.table-hover > tbody > tr:hover strong {
  color: #ffffff !important;
}

.table-hover > tbody > tr:hover .text-muted,
.table-hover > tbody > tr:hover small.text-muted {
  color: #94a3b8 !important;
}

/* Contextual Table States in Dark Mode (No Light Overlays) */
.table-success,
.table > :not(caption) > .table-success > *,
.table-success > *,
tr.row-online,
.table > :not(caption) > tr.row-online > *,
tr.row-online > * {
  --bs-table-bg: rgba(16, 185, 129, 0.08) !important;
  --bs-table-hover-bg: rgba(16, 185, 129, 0.16) !important;
  --bs-table-color: #f8fafc !important;
  --bs-table-hover-color: #ffffff !important;
  background-color: rgba(16, 185, 129, 0.08) !important;
  color: #f8fafc !important;
  box-shadow: none !important;
}

.table-hover > tbody > tr.table-success:hover > *,
.table-hover > tbody > tr.table-success:hover,
.table-success:hover > *,
.table-hover > tbody > tr.row-online:hover > *,
.table-hover > tbody > tr.row-online:hover,
tr.row-online:hover > * {
  background-color: rgba(16, 185, 129, 0.16) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.table-danger,
.table > :not(caption) > .table-danger > *,
.table-danger > * {
  --bs-table-bg: rgba(239, 68, 68, 0.08) !important;
  --bs-table-hover-bg: rgba(239, 68, 68, 0.16) !important;
  --bs-table-color: #f8fafc !important;
  --bs-table-hover-color: #ffffff !important;
  background-color: rgba(239, 68, 68, 0.08) !important;
  color: #f8fafc !important;
  box-shadow: none !important;
}

.table-hover > tbody > tr.table-danger:hover > *,
.table-hover > tbody > tr.table-danger:hover,
.table-danger:hover > * {
  background-color: rgba(239, 68, 68, 0.16) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.table-warning,
.table > :not(caption) > .table-warning > *,
.table-warning > * {
  --bs-table-bg: rgba(245, 158, 11, 0.08) !important;
  --bs-table-hover-bg: rgba(245, 158, 11, 0.16) !important;
  --bs-table-color: #f8fafc !important;
  --bs-table-hover-color: #ffffff !important;
  background-color: rgba(245, 158, 11, 0.08) !important;
  color: #f8fafc !important;
  box-shadow: none !important;
}

.table-hover > tbody > tr.table-warning:hover > *,
.table-hover > tbody > tr.table-warning:hover,
.table-warning:hover > * {
  background-color: rgba(245, 158, 11, 0.16) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.table-info,
.table > :not(caption) > .table-info > *,
.table-info > * {
  --bs-table-bg: rgba(6, 182, 212, 0.08) !important;
  --bs-table-hover-bg: rgba(6, 182, 212, 0.16) !important;
  --bs-table-color: #f8fafc !important;
  --bs-table-hover-color: #ffffff !important;
  background-color: rgba(6, 182, 212, 0.08) !important;
  color: #f8fafc !important;
  box-shadow: none !important;
}

.table-hover > tbody > tr.table-info:hover > *,
.table-hover > tbody > tr.table-info:hover,
.table-info:hover > * {
  background-color: rgba(6, 182, 212, 0.16) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

/* ========================================================
   FORMS & BUTTONS (DARK MODERN)
   ======================================================== */
.form-control, .form-select {
  border-radius: 8px !important;
  background-color: #162036 !important;
  border: 1px solid #25334d !important;
  font-size: 0.85rem !important;
  padding: 0.52rem 0.85rem !important;
  color: #f8fafc !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

select option,
.form-select option {
  background-color: #131b2e !important;
  color: #f8fafc !important;
  padding: 6px 10px !important;
}

.form-control::placeholder {
  color: #64748b !important;
}

.form-control:focus, .form-select:focus {
  background-color: #1a2642 !important;
  border-color: var(--app-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
  background-color: #0e1526 !important;
  color: #94a3b8 !important;
  border-color: #1e293b !important;
  opacity: 0.85;
}

.input-group-text {
  background-color: #1a2642 !important;
  border: 1px solid #25334d !important;
  color: #94a3b8 !important;
  border-radius: 8px !important;
}

.form-check-input {
  background-color: #162036 !important;
  border-color: #25334d !important;
}

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

.btn {
  border-radius: 8px !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--app-primary-gradient) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3) !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45) !important;
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.45) !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary.active {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

.btn-secondary {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #475569 !important;
  border-color: #64748b !important;
  color: #ffffff !important;
}

.btn-outline-secondary {
  color: #cbd5e1 !important;
  border-color: #334155 !important;
  background-color: rgba(255, 255, 255, 0.04) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary.active {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border-color: #475569 !important;
}

.btn-dark {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

.btn-dark:hover,
.btn-dark:focus,
.btn-dark.active {
  background-color: #2563eb !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}

.btn-outline-dark {
  background-color: transparent !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-outline-dark.active {
  background-color: #1e293b !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

.btn-light {
  background-color: #1a2642 !important;
  color: #f8fafc !important;
  border: 1px solid #25334d !important;
}

.btn-light:hover,
.btn-light:focus,
.btn-light.active {
  background-color: #223254 !important;
  color: #ffffff !important;
}

.btn-outline-light {
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  background-color: #1e293b !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

.btn-warning {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
  border-color: #d97706 !important;
  color: #0b0f19 !important;
  font-weight: 700 !important;
}

.btn-warning:hover,
.btn-warning:focus {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important;
  border-color: #b45309 !important;
  color: #000000 !important;
}

.btn-outline-warning {
  border-color: rgba(245, 158, 11, 0.5) !important;
  color: #fbbf24 !important;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning.active {
  background-color: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #0b0f19 !important;
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

.btn-success:hover,
.btn-success:focus {
  background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
  border-color: #047857 !important;
  color: #ffffff !important;
}

.btn-outline-success {
  border-color: rgba(16, 185, 129, 0.45) !important;
  color: #34d399 !important;
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success.active {
  background-color: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%) !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
}

.btn-danger:hover,
.btn-danger:focus {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%) !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}

.btn-outline-danger {
  border-color: rgba(239, 68, 68, 0.45) !important;
  color: #f87171 !important;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger.active {
  background-color: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
}

.btn-info {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%) !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}

.btn-outline-info {
  border-color: rgba(14, 165, 233, 0.45) !important;
  color: #38bdf8 !important;
}

.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info.active {
  background-color: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}

/* Nav Tabs Customization */
.nav-tabs {
  border-bottom: 1px solid #1e293b !important;
}

.nav-tabs .nav-link {
  color: #94a3b8 !important;
  border: 1px solid transparent !important;
  font-weight: 600 !important;
  border-radius: 8px 8px 0 0 !important;
  transition: all 0.15s ease;
}

.nav-tabs .nav-link:hover {
  color: #f8fafc !important;
  border-color: #25334d #25334d transparent !important;
  background-color: rgba(255, 255, 255, 0.03) !important;
}

.nav-tabs .nav-link.active {
  color: #60a5fa !important;
  background-color: #131b2e !important;
  border-color: #1e293b #1e293b transparent !important;
}

/* Accordion Dark Modern */
.accordion {
  --bs-accordion-bg: #131b2e !important;
  --bs-accordion-color: #cbd5e1 !important;
  --bs-accordion-border-color: #1e293b !important;
  --bs-accordion-btn-bg: #162036 !important;
  --bs-accordion-btn-color: #f8fafc !important;
  --bs-accordion-active-bg: #1a2642 !important;
  --bs-accordion-active-color: #60a5fa !important;
}

.accordion-item {
  background-color: #131b2e !important;
  border: 1px solid #1e293b !important;
  color: #cbd5e1 !important;
}

.accordion-button {
  background-color: #162036 !important;
  color: #f8fafc !important;
}

.accordion-button:not(.collapsed) {
  background-color: #1a2642 !important;
  color: #60a5fa !important;
  box-shadow: inset 0 -1px 0 #25334d !important;
}

.accordion-button::after {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.accordion-body {
  background-color: #131b2e !important;
  color: #cbd5e1 !important;
}

/* Nav Pills Customization */
.nav-pills .nav-link {
  border-radius: 8px !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
  padding: 0.5rem 1rem !important;
  transition: all 0.15s ease;
}

.nav-pills .nav-link:hover:not(.active) {
  background-color: #162036 !important;
  color: #f8fafc !important;
}

.nav-pills .nav-link.active {
  background: var(--app-primary-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35) !important;
}

/* ========================================================
   MODALS & POPUPS (DARK MODERN)
   ======================================================== */
.modal-content {
  background-color: #131b2e !important;
  border: 1px solid #25334d !important;
  border-radius: 14px !important;
  color: #f8fafc !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
}

.modal-header {
  border-bottom: 1px solid #1e293b !important;
  color: #f8fafc !important;
}

.modal-footer {
  border-top: 1px solid #1e293b !important;
}

.btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.75;
}

.btn-close:hover {
  opacity: 1;
}

/* ========================================================
   DROPDOWNS (DARK MODERN)
   ======================================================== */
.dropdown-menu {
  background-color: #162036 !important;
  border: 1px solid #25334d !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5) !important;
  color: #cbd5e1 !important;
  padding: 0.5rem !important;
}

.dropdown-item {
  color: #cbd5e1 !important;
  border-radius: 8px !important;
  font-size: 0.84rem !important;
  padding: 0.5rem 0.85rem !important;
  transition: all 0.15s ease;
}

.dropdown-item:hover, .dropdown-item:focus {
  background-color: rgba(59, 130, 246, 0.18) !important;
  color: #60a5fa !important;
}

.dropdown-divider {
  border-color: #1e293b !important;
  margin: 0.4rem 0 !important;
}

/* ========================================================
   RESPONSIVE SIDEBAR & MAIN CONTENT LAYOUT SYSTEM
   ======================================================== */
@media (min-width: 992px) {
  /* 1. Full Sidebar Mode */
  html:not(.sidebar-icon-only) .app-sidebar,
  body:not(.sidebar-icon-only) .app-sidebar {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    transform: none !important;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  html:not(.sidebar-icon-only) .app-header,
  html:not(.sidebar-icon-only) .app-main,
  html:not(.sidebar-icon-only) .app-footer,
  body:not(.sidebar-icon-only) .app-header,
  body:not(.sidebar-icon-only) .app-main,
  body:not(.sidebar-icon-only) .app-footer {
    margin-left: 250px !important;
    width: auto !important;
    transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  /* 2. Compact / Icon-Only Sidebar Mode (72px) */
  html.sidebar-icon-only .app-sidebar,
  body.sidebar-icon-only .app-sidebar {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    overflow-x: hidden !important;
    transform: none !important;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  html.sidebar-icon-only .app-header,
  html.sidebar-icon-only .app-main,
  html.sidebar-icon-only .app-footer,
  body.sidebar-icon-only .app-header,
  body.sidebar-icon-only .app-main,
  body.sidebar-icon-only .app-footer {
    margin-left: 72px !important;
    width: auto !important;
    transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  html.sidebar-icon-only .app-sidebar .sidebar-wrapper,
  body.sidebar-icon-only .app-sidebar .sidebar-wrapper {
    overflow-x: hidden !important;
    width: 72px !important;
  }

  html.sidebar-icon-only .sidebar-brand,
  body.sidebar-icon-only .sidebar-brand {
    padding: 0.8rem 0.5rem !important;
    justify-content: center !important;
  }
  html.sidebar-icon-only .brand-link,
  body.sidebar-icon-only .brand-link {
    justify-content: center !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }
  html.sidebar-icon-only .brand-title,
  html.sidebar-icon-only .brand-rad-text,
  body.sidebar-icon-only .brand-title,
  body.sidebar-icon-only .brand-rad-text {
    display: none !important;
  }
  html.sidebar-icon-only .brand-logo-img,
  body.sidebar-icon-only .brand-logo-img {
    margin-right: 0 !important;
    width: 32px !important;
    height: 32px !important;
  }
  html.sidebar-icon-only .brand-collapse-btn,
  body.sidebar-icon-only .brand-collapse-btn {
    display: none !important;
  }

  html.sidebar-icon-only .sidebar-user-card,
  body.sidebar-icon-only .sidebar-user-card {
    display: none !important;
  }

  html.sidebar-icon-only .nav-header,
  body.sidebar-icon-only .nav-header {
    font-size: 0 !important;
    line-height: 0 !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 8px 14px !important;
    background-color: var(--app-border) !important;
    border: none !important;
  }

  html.sidebar-icon-only .sidebar-menu .nav-item,
  body.sidebar-icon-only .sidebar-menu .nav-item {
    position: relative;
  }
  html.sidebar-icon-only .sidebar-menu .nav-link,
  body.sidebar-icon-only .sidebar-menu .nav-link {
    margin: 0 10px 4px !important;
    padding: 0.65rem 0 !important;
    justify-content: center !important;
    text-align: center !important;
    border-radius: 8px !important;
  }
  html.sidebar-icon-only .sidebar-menu .nav-link p,
  html.sidebar-icon-only .sidebar-menu .nav-link .nav-chevron,
  body.sidebar-icon-only .sidebar-menu .nav-link p,
  body.sidebar-icon-only .sidebar-menu .nav-link .nav-chevron {
    display: none !important;
  }
  html.sidebar-icon-only .sidebar-menu .nav-link i.nav-icon,
  body.sidebar-icon-only .sidebar-menu .nav-link i.nav-icon {
    margin-right: 0 !important;
    font-size: 1.15rem !important;
    width: auto !important;
  }

  html.sidebar-icon-only .sidebar-menu .nav-link:hover::after,
  body.sidebar-icon-only .sidebar-menu .nav-link:hover::after {
    content: attr(data-title);
    position: fixed;
    left: 80px;
    margin-top: -14px;
    background: #162036;
    color: #ffffff;
    border: 1px solid #25334d;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 999999;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    animation: navTooltipIn 0.15s ease forwards;
  }
  html.sidebar-icon-only .sidebar-menu .nav-link:hover::before,
  body.sidebar-icon-only .sidebar-menu .nav-link:hover::before {
    content: "";
    position: fixed;
    left: 74px;
    margin-top: -5px;
    border-width: 5px 6px 5px 0;
    border-style: solid;
    border-color: transparent #162036 transparent transparent;
    z-index: 999999;
    pointer-events: none;
  }
  @keyframes navTooltipIn {
    0% { opacity: 0; transform: translateX(-4px); }
    100% { opacity: 1; transform: translateX(0); }
  }
}

/* 3. Mobile & Tablet Screen Mode (< 992px) */
@media (max-width: 991.98px) {
  .app-sidebar {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    transform: translateX(-100%) !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0) !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7) !important;
  }

  /* Overlay backdrop for mobile when sidebar is open */
  body.sidebar-open::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 25, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1035;
    animation: fadeIn 0.2s ease forwards;
  }

  .app-header,
  .app-main,
  .app-footer {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

/* ========================================================
   FOOTER (Dark Modern & Sticky Bottom)
   ======================================================== */
.app-footer {
  margin-top: auto !important;
  flex-shrink: 0 !important;
  background-color: #0c1222 !important;
  color: #64748b !important;
  border-top: 1px solid var(--app-border) !important;
  padding: 0.9rem 1.5rem !important;
  font-size: 0.8rem !important;
}

.app-footer strong {
  color: #cbd5e1 !important;
}

.app-footer a {
  color: #60a5fa !important;
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* ========================================================
   ULTRA-SLIM SIDEBAR SCROLLBAR
   ======================================================== */
.app-sidebar,
.sidebar-wrapper,
.app-sidebar .sidebar-wrapper,
.sidebar-wrapper * {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(148, 163, 184, 0.2) transparent !important;
}

.app-sidebar .sidebar-wrapper::-webkit-scrollbar,
.sidebar-wrapper::-webkit-scrollbar {
  width: 4px !important;
  height: 4px !important;
  background-color: transparent !important;
}

.app-sidebar .sidebar-wrapper::-webkit-scrollbar-track,
.sidebar-wrapper::-webkit-scrollbar-track {
  background: transparent !important;
  border-radius: 10px !important;
}

.app-sidebar .sidebar-wrapper::-webkit-scrollbar-thumb,
.sidebar-wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.2) !important;
  border-radius: 10px !important;
  transition: background-color 0.2s ease !important;
}

.app-sidebar .sidebar-wrapper:hover::-webkit-scrollbar-thumb,
.sidebar-wrapper:hover::-webkit-scrollbar-thumb {
  background-color: rgba(100, 116, 139, 0.5) !important;
}

.sidebar-wrapper nav {
  padding-right: 6px !important;
}

/* ========================================================
   TABLE ACTION BUTTONS & ACTION GROUPS (Luminous High Contrast)
   ======================================================== */
.table-actions,
td .btn-group,
td .btn-action-group {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  flex-wrap: nowrap !important;
  vertical-align: middle !important;
  padding: 2px 0 !important;
}

td .btn-group,
.table-actions {
  white-space: nowrap !important;
}

td .btn-group > .btn,
td .btn-group > :not(.btn-check:first-child) + .btn,
td .btn-action-group > .btn,
.table-actions > .btn,
.btn-action {
  position: relative !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  border-radius: 8px !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.825rem !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  border-width: 1px !important;
  border-style: solid !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) !important;
  flex-shrink: 0 !important;
}

td .btn-group > .btn i,
td .btn-action-group > .btn i,
.table-actions > .btn i,
.btn-action i {
  font-size: 0.85rem !important;
  line-height: 1 !important;
  margin: 0 !important;
  pointer-events: none;
}

td .btn-group > .btn.btn-has-text,
.table-actions > .btn.btn-has-text {
  width: auto !important;
  max-width: none !important;
  padding: 0 10px !important;
}

/* Luminous Action Buttons */
td .btn-group > .btn.btn-outline-primary,
.table-actions > .btn.btn-outline-primary {
  color: #60a5fa !important;
  background-color: rgba(59, 130, 246, 0.14) !important;
  border-color: rgba(59, 130, 246, 0.38) !important;
}
td .btn-group > .btn.btn-outline-primary:hover,
.table-actions > .btn.btn-outline-primary:hover {
  color: #ffffff !important;
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45) !important;
}

td .btn-group > .btn.btn-outline-success,
.table-actions > .btn.btn-outline-success {
  color: #34d399 !important;
  background-color: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.38) !important;
}
td .btn-group > .btn.btn-outline-success:hover,
.table-actions > .btn.btn-outline-success:hover {
  color: #ffffff !important;
  background-color: #059669 !important;
  border-color: #059669 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45) !important;
}

td .btn-group > .btn.btn-outline-danger,
.table-actions > .btn.btn-outline-danger {
  color: #f87171 !important;
  background-color: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.38) !important;
}
td .btn-group > .btn.btn-outline-danger:hover,
.table-actions > .btn.btn-outline-danger:hover {
  color: #ffffff !important;
  background-color: #dc2626 !important;
  border-color: #dc2626 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.45) !important;
}

td .btn-group > .btn.btn-outline-warning,
.table-actions > .btn.btn-outline-warning {
  color: #fbbf24 !important;
  background-color: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.38) !important;
}
td .btn-group > .btn.btn-outline-warning:hover,
.table-actions > .btn.btn-outline-warning:hover {
  color: #ffffff !important;
  background-color: #d97706 !important;
  border-color: #d97706 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.45) !important;
}

td .btn-group > .btn.btn-outline-secondary,
.table-actions > .btn.btn-outline-secondary {
  color: #cbd5e1 !important;
  background-color: rgba(148, 163, 184, 0.12) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}
td .btn-group > .btn.btn-outline-secondary:hover,
.table-actions > .btn.btn-outline-secondary:hover {
  color: #ffffff !important;
  background-color: #475569 !important;
  border-color: #475569 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(71, 85, 105, 0.45) !important;
}

td .btn-group > .btn.btn-outline-info,
.table-actions > .btn.btn-outline-info {
  color: #38bdf8 !important;
  background-color: rgba(6, 182, 212, 0.14) !important;
  border-color: rgba(6, 182, 212, 0.38) !important;
}
td .btn-group > .btn.btn-outline-info:hover,
.table-actions > .btn.btn-outline-info:hover {
  color: #ffffff !important;
  background-color: #0284c7 !important;
  border-color: #0284c7 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.45) !important;
}

td .btn-group > .btn:active,
.table-actions > .btn:active {
  transform: translateY(0) scale(0.96) !important;
}

/* ========================================================
   BADGE TIPE LAYANAN & CUSTOM BUTTONS
   ======================================================== */
.badge-pppoe {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%) !important;
  color: #ffffff !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  padding: 0.3rem 0.65rem !important;
  border-radius: 6px !important;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  border: none !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.badge-hotspot {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%) !important;
  color: #ffffff !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  padding: 0.3rem 0.65rem !important;
  border-radius: 6px !important;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  border: none !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-allur-primary {
  background: var(--app-primary-gradient) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.btn-allur-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

@media (min-width: 768px) {
  .border-start-md {
    border-left: 1px solid var(--app-border) !important;
  }
}

.icon-box-sm,
.icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ========================================================
   FLOATING ACTION BUTTON
   ======================================================== */
.floating-action-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1030;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--app-primary-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  opacity: 0.9;
}
.floating-action-btn:hover {
  opacity: 1;
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.6);
}

.btn-sidebar-toggle.glowing-active {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3), 0 0 14px rgba(59, 130, 246, 0.3) !important;
  border-color: var(--app-primary) !important;
}

/* ========================================================
   LIST GROUPS & PAGINATION (DARK MODERN)
   ======================================================== */
.list-group-item {
  background-color: #131b2e !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

.list-group-item:hover {
  background-color: #162036 !important;
  color: #f8fafc !important;
}

.pagination .page-link {
  background-color: #162036 !important;
  border-color: #25334d !important;
  color: #94a3b8 !important;
  border-radius: 6px !important;
  margin: 0 2px !important;
}

.pagination .page-link:hover {
  background-color: #1e293b !important;
  color: #60a5fa !important;
  border-color: #3b82f6 !important;
}

.pagination .page-item.active .page-link {
  background: var(--app-primary-gradient) !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4) !important;
}

/* ========================================================
   ALERTS (DARK MODERN)
   ======================================================== */
.alert {
  border-radius: 10px !important;
  font-size: 0.86rem !important;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
  color: #34d399 !important;
}

.alert-success h1, .alert-success h2, .alert-success h3,
.alert-success h4, .alert-success h5, .alert-success h6,
.alert-success strong, .alert-success b, .alert-success i {
  color: #6ee7b7 !important;
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.28) !important;
  color: #f87171 !important;
}

.alert-danger h1, .alert-danger h2, .alert-danger h3,
.alert-danger h4, .alert-danger h5, .alert-danger h6,
.alert-danger strong, .alert-danger b, .alert-danger i {
  color: #fca5a5 !important;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
  color: #fbbf24 !important;
}

.alert-warning h1, .alert-warning h2, .alert-warning h3,
.alert-warning h4, .alert-warning h5, .alert-warning h6,
.alert-warning strong, .alert-warning b, .alert-warning i {
  color: #fde047 !important;
}

.alert-info {
  background-color: rgba(6, 182, 212, 0.12) !important;
  border: 1px solid rgba(6, 182, 212, 0.28) !important;
  color: #38bdf8 !important;
}

.alert-info h1, .alert-info h2, .alert-info h3,
.alert-info h4, .alert-info h5, .alert-info h6,
.alert-info strong, .alert-info b, .alert-info i {
  color: #7dd3fc !important;
}

/* ========================================================
   BERANDA / DASHBOARD KPI CARD RESPONSIVENESS
   ======================================================== */
.kpi-card .kpi-value {
  font-size: clamp(1.1rem, 2.5vw, 1.55rem);
  font-weight: 800;
  color: #f8fafc !important;
  letter-spacing: -0.5px;
  word-break: break-word;
}

.card-body canvas {
  max-width: 100%;
}

.online-indicator-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulseDot 1.4s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px rgba(16, 185, 129, 0.7); }
  50% { opacity: 0.4; transform: scale(0.7); box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  td .btn-group > .btn,
  .table-actions > .btn,
  .btn-action {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
  }
}

.app-content-header,
.app-content {
  overflow-x: hidden;
}

.nav.nav-pills {
  flex-wrap: wrap;
  gap: 4px;
}

.row.g-3 > [class*="col-"] {
  margin-bottom: 0;
}

@media (max-width: 576px) {
  .kpi-card {
    padding: 1rem;
  }
  .kpi-value {
    font-size: 1.25rem !important;
  }
}
