/*
 * RKM Dark Theme Overrides
 * ------------------------------------------------------------
 * Provides a cohesive dark experience on top of the Dashtreme
 * defaults, without editing vendor assets directly.
 */

:root {
  --rkm-surface: #111827;
  --rkm-surface-alt: #0f172a;
  --rkm-surface-high: #1f2937;
  --rkm-on-surface: #f8fafc;
  --rkm-on-muted: #cbd5f5;
  --rkm-muted: #94a3b8;
  --rkm-primary: #38bdf8;
  --rkm-primary-dark: #0ea5e9;
  --rkm-accent: #6366f1;
  --rkm-border: rgba(148, 163, 184, 0.18);
  --rkm-radius: 12px;
  --rkm-shadow: 0 18px 45px rgba(2, 6, 23, 0.55);
}

body,
body.bg-theme12,
.bg-theme.bg-theme12 {
  background: radial-gradient(circle at top, rgba(30, 64, 175, 0.35), rgba(15, 23, 42, 0.95)) !important;
  color: var(--rkm-on-surface) !important;
  letter-spacing: 0.2px;
}

header.topbar-nav,
#sidebar-wrapper {
  background: rgba(2, 6, 23, 0.92) !important;
  backdrop-filter: blur(12px);
}

#sidebar-wrapper .brand-logo {
  padding: 28px 22px 18px;
}

#sidebar-wrapper .brand-logo .logo-text {
  color: #bfdbfe;
  font-weight: 700;
  letter-spacing: 0.6px;
}

#sidebar-wrapper .sidebar-menu > li > a {
  color: #a5b4fc !important;
  border-radius: var(--rkm-radius);
  padding: 11px 18px;
  margin: 4px 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#sidebar-wrapper .sidebar-menu > li > a .fa,
#sidebar-wrapper .sidebar-menu > li > a .zmdi,
#sidebar-wrapper .sidebar-menu > li > a i {
  font-size: 18px;
}

#sidebar-wrapper .sidebar-menu > li > a:hover,
#sidebar-wrapper .sidebar-menu > li.active > a,
#sidebar-wrapper .sidebar-menu > li > a.active {
  background: rgba(56, 189, 248, 0.18) !important;
  color: #e0f2fe !important;
  transform: translateX(4px);
}

#sidebar-wrapper .sidebar-submenu li a {
  color: #c7d2fe !important;
  padding-left: 48px;
  border-radius: var(--rkm-radius);
  margin: 2px 12px;
  font-size: 13px;
}

#sidebar-wrapper .sidebar-submenu li a:hover,
#sidebar-wrapper .sidebar-submenu li a.active {
  color: #f8fafc !important;
  background: rgba(99, 102, 241, 0.22);
}

.content-wrapper {
  background: transparent !important;
}

.card,
.modal-content {
  background: var(--rkm-surface-high) !important;
  color: var(--rkm-on-surface) !important;
  border: 1px solid var(--rkm-border) !important;
  border-radius: var(--rkm-radius) !important;
  box-shadow: var(--rkm-shadow);
}

.card h5,
.card h6,
.card .card-title,
.card .text-white {
  color: var(--rkm-on-surface) !important;
}

.card .progress {
  height: 6px !important;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

.card .progress-bar {
  background: linear-gradient(90deg, var(--rkm-primary), var(--rkm-accent));
  border-radius: 999px;
}

.btn-primary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-light,
.btn-outline-primary {
  border-radius: 8px;
  border: none;
  padding: 10px 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.btn-primary,
.btn-light {
  background: linear-gradient(135deg, var(--rkm-primary-dark), var(--rkm-primary));
  color: #0f172a !important;
  border: none;
}

.btn-light:hover,
.btn-primary:hover {
  background: linear-gradient(135deg, var(--rkm-primary), var(--rkm-accent));
}

.btn-outline-primary {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: transparent;
  color: var(--rkm-on-surface);
}

.btn-outline-primary:hover {
  background: rgba(56, 189, 248, 0.12);
  color: var(--rkm-primary);
}

.table {
  color: var(--rkm-on-surface) !important;
}

.table thead th {
  border-bottom-width: 1px;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.8);
  color: var(--rkm-on-muted);
}

.table td,
.table th {
  border-color: rgba(148, 163, 184, 0.15) !important;
  vertical-align: middle !important;
  padding: 0.75rem !important;
}

.badge,
.label,
.status-pill {
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 600;
}

.status-pill.neutral {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.18);
}

.status-pill.success {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.18);
}

.status-pill.warning {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.24);
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.toast-container {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 2000;
}

.rkm-toast {
  position: relative;
  background: var(--rkm-surface-high);
  border-radius: 10px;
  border: 1px solid var(--rkm-border);
  box-shadow: var(--rkm-shadow);
  padding: 14px 18px;
  margin-bottom: 12px;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toast-slide-in 220ms ease-out;
  color: var(--rkm-on-surface);
}

.rkm-toast.success {
  border-left: 4px solid #4ade80;
}

.rkm-toast.error {
  border-left: 4px solid #f87171;
}

.rkm-toast .message {
  flex: 1;
  font-weight: 500;
}

.rkm-toast button {
  border: none;
  background: transparent;
  color: var(--rkm-muted);
  font-size: 18px;
  cursor: pointer;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-actions .btn {
  background: rgba(56, 189, 248, 0.18);
  color: #e0f2fe !important;
}

.quick-actions .btn:hover {
  background: rgba(99, 102, 241, 0.22);
}

.empty-state {
  text-align: center;
  padding: 32px 12px;
  color: var(--rkm-muted);
}

.form-control,
.custom-select {
  background-color: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--rkm-on-surface);
}

.form-control:focus {
  background-color: rgba(15, 23, 42, 0.95);
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--rkm-on-surface);
  box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.25);
}

.form-text,
.invalid-feedback,
.text-muted {
  color: var(--rkm-muted) !important;
}

.modal-content .form-control {
  background-color: rgba(15, 23, 42, 0.9);
}

.badge-primary {
  background: rgba(99, 102, 241, 0.28);
  color: #c7d2fe;
}

.helper-copy {
  color: var(--rkm-muted);
}

.breadcrumb {
  background: transparent;
}

.breadcrumb .breadcrumb-item,
.breadcrumb .breadcrumb-item a {
  color: var(--rkm-muted);
}

.breadcrumb .breadcrumb-item.active {
  color: var(--rkm-on-muted);
}

@media (max-width: 991px) {
  #sidebar-wrapper {
    box-shadow: 0 16px 45px rgba(2, 6, 23, 0.65);
  }

  .quick-actions {
    flex-direction: column;
  }
}
