:root {
  --bg: #0a0a0f;
  --accent: #6366f1;
  --accent-cyan: #22d3ee;
  --glass: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
}
* {
  box-sizing: border-box;
}
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 2px;
}
body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  height: 100vh;
  min-height: 100vh;
}
h1,
h2,
h3,
.font-heading {
  font-family: "Space Grotesk", sans-serif;
}
img,
svg {
  max-width: 100%;
  height: auto;
}

/* Boot overlay */
#boot-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
#boot-overlay.hidden {
  opacity: 0;
}

/* Mesh bg */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-mesh::before,
.bg-mesh::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: mesh-drift 18s ease-in-out infinite alternate;
}
.bg-mesh::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -10%;
  left: 20%;
}
.bg-mesh::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  bottom: -5%;
  right: 10%;
  animation-delay: -9s;
  animation-direction: alternate-reverse;
}
.mesh-blob {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.2;
  background: radial-gradient(circle, #a78bfa 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  animation: mesh-pulse 12s ease-in-out infinite;
}
@keyframes mesh-drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(40px, 30px) scale(1.1);
  }
}
@keyframes mesh-pulse {
  0%,
  100% {
    opacity: 0.15;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.28;
    transform: translateX(-50%) scale(1.15);
  }
}

/* Particles */
.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: float-particle linear infinite;
}
.particle:nth-child(odd) {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}
.particle:nth-child(1) {
  width: 3px;
  height: 3px;
  left: 8%;
  top: 15%;
  animation-duration: 22s;
}
.particle:nth-child(2) {
  width: 4px;
  height: 4px;
  left: 22%;
  top: 70%;
  animation-duration: 28s;
  animation-delay: -4s;
}
.particle:nth-child(3) {
  width: 2px;
  height: 2px;
  left: 45%;
  top: 30%;
  animation-duration: 19s;
  animation-delay: -8s;
}
.particle:nth-child(4) {
  width: 5px;
  height: 5px;
  left: 60%;
  top: 85%;
  animation-duration: 25s;
  animation-delay: -2s;
}
.particle:nth-child(5) {
  width: 3px;
  height: 3px;
  left: 75%;
  top: 20%;
  animation-duration: 30s;
  animation-delay: -12s;
}
.particle:nth-child(6) {
  width: 2px;
  height: 2px;
  left: 88%;
  top: 55%;
  animation-duration: 21s;
  animation-delay: -6s;
}
.particle:nth-child(7) {
  width: 4px;
  height: 4px;
  left: 35%;
  top: 90%;
  animation-duration: 26s;
  animation-delay: -10s;
}
.particle:nth-child(8) {
  width: 3px;
  height: 3px;
  left: 92%;
  top: 10%;
  animation-duration: 24s;
  animation-delay: -14s;
}
.particle:nth-child(9) {
  width: 2px;
  height: 2px;
  left: 15%;
  top: 45%;
  animation-duration: 27s;
  animation-delay: -3s;
}
.particle:nth-child(10) {
  width: 4px;
  height: 4px;
  left: 55%;
  top: 60%;
  animation-duration: 23s;
  animation-delay: -7s;
}
@keyframes float-particle {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0.3;
  }
  25% {
    transform: translateY(-30px) translateX(15px);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-10px) translateX(-10px);
    opacity: 0.5;
  }
  75% {
    transform: translateY(-40px) translateX(20px);
    opacity: 0.8;
  }
  100% {
    transform: translateY(0) translateX(0);
    opacity: 0.3;
  }
}

/* Glass card */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.glass-card:not(.no-hover):hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

/* Sidebar */
.sidebar-glass {
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(24px);
  border-right: 1px solid transparent;
  background-clip: padding-box;
  position: relative;
}
.sidebar-glass::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(99, 102, 241, 0.5) 0%,
    rgba(34, 211, 238, 0.2) 50%,
    rgba(99, 102, 241, 0.1) 100%
  );
}
.logo-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Nav */
.nav-item {
  transition:
    transform 0.2s,
    color 0.2s,
    background 0.2s;
  cursor: pointer;
}
.nav-item:hover {
  transform: translateX(6px);
  color: rgba(255, 255, 255, 0.95);
}
.nav-item:hover .nav-icon {
  color: var(--accent-cyan);
}
.nav-item.active {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
  color: #fff;
}
.nav-item.active .nav-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.8));
}

/* Badges */
.badge-indigo {
  background: linear-gradient(135deg, #6366f1, #818cf8);
}
.badge-cyan {
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
}
.badge-violet {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}
.badge-amber {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}
.badge-rose {
  background: linear-gradient(135deg, #f43f5e, #fb7185);
}
.badge-emerald {
  background: linear-gradient(135deg, #10b981, #34d399);
}

/* Inputs */
.search-glass,
.glass-input,
.glass-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  color: rgba(255, 255, 255, 0.85);
}
.search-glass:focus-within,
.glass-input:focus,
.glass-select:focus {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  outline: none;
}
.glass-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.glass-select option {
  background: #1a1a24;
  color: #fff;
}
.period-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
}
.period-pill:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
  outline: none;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #818cf8);
  border: none;
  border-radius: 0.75rem;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-glass {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-glass:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.btn-ghost-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
}
.btn-icon {
  padding: 0.5rem;
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  border: none;
}
.btn-icon:hover {
  color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.05);
}

/* Status dot */
.status-dot {
  box-shadow: 0 0 8px #22c55e;
  animation: pulse-dot 2s ease-in-out infinite;
}
.status-dot.inactive {
  background: #ef4444 !important;
  box-shadow: 0 0 8px #ef4444;
  animation: none;
}
@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 6px #22c55e;
  }
  50% {
    box-shadow:
      0 0 14px #22c55e,
      0 0 20px rgba(34, 197, 94, 0.4);
  }
}

/* Startup anims */
.anim-sidebar {
  opacity: 0;
  transform: translateX(-100%);
  transition:
    opacity 0.4s,
    transform 0.4s;
}
.anim-sidebar.visible {
  opacity: 1;
  transform: translateX(0);
}
.anim-topbar {
  opacity: 0;
  transform: translateY(-24px);
  transition:
    opacity 0.3s,
    transform 0.3s;
}
.anim-topbar.visible {
  opacity: 1;
  transform: translateY(0);
}
.anim-kpi {
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 0.35s,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.anim-kpi.visible {
  opacity: 1;
  transform: scale(1);
}
.anim-chart {
  opacity: 0;
  transform: scale(0.95);
  transition:
    opacity 0.4s,
    transform 0.4s;
}
.anim-chart.visible {
  opacity: 1;
  transform: scale(1);
}
.bell-btn {
  transition:
    color 0.2s,
    transform 0.2s;
  cursor: pointer;
}
.bell-btn:hover {
  color: var(--accent-cyan);
  transform: rotate(12deg);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot-indigo {
  background: #6366f1;
}
.legend-dot-violet {
  background: #a78bfa;
}
.legend-dot-cyan {
  background: #22d3ee;
}

/* SPA layout */
#main-content {
  margin-left: 260px;
  transition: margin-left 0.3s;
}
#scrollContent {
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem;
}
.page {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.25s,
    transform 0.25s;
}

.page.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.page:not(.active) {
  display: none !important;
}
#sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.hamburger-btn {
  display: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.625rem;
  cursor: pointer;
  transition: all 0.2s;
  color: rgba(255, 255, 255, 0.7);
}
.hamburger-btn:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}
@media (max-width: 1023px) {
  #sidebar {
    transform: translateX(-100%);
    z-index: 40;
  }
  #sidebar.sidebar-open {
    transform: translateX(0);
  }
  #sidebar.anim-sidebar.visible {
    transform: translateX(-100%);
  }
  #sidebar.anim-sidebar.visible.sidebar-open {
    transform: translateX(0);
  }
  #main-content {
    margin-left: 0;
  }
  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.875rem;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  transform: translateX(120%);
  animation: toast-in 0.35s ease forwards;
  cursor: pointer;
}
.toast.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}
.toast.error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.toast.info {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}
.toast.toast-out {
  animation: toast-out 0.3s ease forwards;
}
@keyframes toast-in {
  to {
    transform: translateX(0);
  }
}
@keyframes toast-out {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* Scroll top */
#scroll-top-btn {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 8000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
#scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#scroll-top-btn:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent-cyan);
}

/* Tables */
.glass-table-wrap {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead th {
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.data-table tbody tr {
  transition: background 0.2s;
}
.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}
.data-table tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.875rem;
}
.role-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-role-admin {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.badge-role-moderator {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.3);
}
.badge-role-user {
  background: rgba(34, 211, 238, 0.12);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.25);
}
.badge-status-active {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.badge-status-inactive {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.badge-type-users {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}
.badge-type-activity {
  background: rgba(34, 211, 238, 0.12);
  color: #67e8f9;
}
.badge-type-security {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
}
.badge-report-progress {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}
.pulse-amber {
  animation: pulse-amber 1.5s ease-in-out infinite;
}
@keyframes pulse-amber {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
.pagination-pill {
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s;
}
.pagination-pill:hover {
  border-color: rgba(99, 102, 241, 0.35);
  color: #fff;
}
.pagination-pill.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  padding: 1rem;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: rgba(15, 15, 22, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.open .modal-content {
  transform: scale(1);
}

/* Settings */
.settings-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.settings-tab {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.2s;
}
.settings-tab:hover {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
}
.settings-tab.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}
.settings-panel {
  display: none;
}
.settings-panel.active {
  display: block;
  animation: fade-up 0.25s ease forwards;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.avatar-upload {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
}
.avatar-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.7rem;
  color: #fff;
  gap: 0.25rem;
}
.avatar-upload:hover .avatar-upload-overlay {
  opacity: 1;
}
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  transition: background 0.25s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  transition: border-color 0.2s;
}
.toggle-row:hover {
  border-color: rgba(255, 255, 255, 0.12);
}
.password-field {
  position: relative;
}
.password-toggle {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: color 0.2s;
}
.password-toggle:hover {
  color: rgba(255, 255, 255, 0.8);
}
.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.color-swatch:hover {
  transform: scale(1.1);
}
.color-swatch.active {
  border-color: #fff;
  transform: scale(1.15);
}
.swatch-indigo {
  background: #6366f1;
}
.swatch-cyan {
  background: #22d3ee;
}
.swatch-violet {
  background: #8b5cf6;
}
.swatch-rose {
  background: #f43f5e;
}
.swatch-amber {
  background: #f59e0b;
}
.swatch-emerald {
  background: #10b981;
}
.lang-pill {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.2s;
}
.lang-pill.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}
.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}
.mini-kpi-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
}

/* Reports */
.report-card {
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.report-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.btn-loading .btn-text {
  display: none;
}
.btn-primary .spinner {
  display: none;
}
.btn-loading .spinner {
  display: inline-block;
}

/* Compact mode */
.compact-mode #scrollContent {
  padding: 1rem;
}
.compact-mode .glass-card {
  padding: 0.875rem !important;
}
.compact-mode .anim-kpi {
  padding: 0.875rem !important;
}
.compact-mode .data-table tbody td,
.compact-mode .data-table thead th {
  padding: 0.625rem 1rem;
}
.compact-mode .toggle-row {
  padding: 0.75rem 1rem;
}
.compact-mode .nav-item {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* RESPONSIVE — TABLETTE (≤ 1023 px) */
@media (max-width: 1023px) {
  #scrollContent {
    padding: 1.25rem;
  }

  #topbar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  #topbar .search-glass {
    display: none;
  }
  #topbar > div:last-child {
    gap: 0.5rem;
    margin-left: auto;
  }

  #page-dashboard section.grid.grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  #page-dashboard > section:nth-of-type(2) {
    display: flex;
    flex-direction: column;
  }
  #chart-line-wrap {
    order: -1;
  }
  #chart-donut-wrap {
    order: -1;
  }
  #page-dashboard > section:nth-of-type(1) {
    order: 1;
  }

  #page-dashboard section.grid.grid-cols-5 {
    grid-template-columns: 1fr;
  }
  #page-dashboard section.grid.grid-cols-5 article.col-span-3,
  #page-dashboard section.grid.grid-cols-5 article.col-span-2 {
    grid-column: span 1;
  }

  #chart-line-wrap .relative {
    height: 240px !important;
  }
  #chart-donut-wrap .relative.mx-auto {
    margin: 0 auto;
    width: 180px !important;
    height: 180px !important;
  }

  /* PAGE UTILISATEURS */
  #page-users > .mb-6 {
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
  }
  #page-users #add-user-btn {
    margin-left: auto;
  }
  #page-users .mb-5.flex {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  #page-users .mb-5 .search-glass {
    flex: 1;
    min-width: 180px;
  }
  #page-users .mb-5 select {
    min-width: 140px;
  }
  #page-users .glass-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
  }
  #page-users .data-table {
    min-width: 580px;
  }
  #page-users .data-table thead th:nth-child(5),
  #page-users .data-table tbody td:nth-child(5) {
    display: none;
  }

  /* PAGE STATISTIQUES */
  #page-statistics section.grid.grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  #page-statistics section.grid.grid-cols-2 {
    grid-template-columns: 1fr;
  }
  #page-statistics {
    display: flex;
    flex-direction: column;
  }
  #page-statistics > section:first-of-type {
    order: 2;
  }
  #page-statistics > article.glass-card:first-of-type {
    order: 1;
  }
  #page-statistics > section.grid.grid-cols-2 {
    order: 1;
  }
  #page-statistics > article.glass-table-wrap {
    order: 3;
  }
  #page-statistics .relative.h-72 {
    height: 240px !important;
  }
  #page-statistics .relative.h-56 {
    height: 200px !important;
  }
  #page-statistics .glass-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
  }
  #page-statistics .data-table {
    min-width: 480px;
  }

  /* PAGE RAPPORTS */
  #page-reports > .mb-6 {
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
  }
  #generate-report-btn {
    margin-left: auto;
  }
  #page-reports section.grid.grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  #page-reports section.grid.grid-cols-3 article:last-child {
    grid-column: span 2;
    max-width: none;
  }
  #page-reports .mb-5.flex {
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }
  #page-reports .mb-5.flex select {
    min-width: 160px;
  }
  #page-reports .mb-5.flex input[type="date"] {
    flex: 1;
    min-width: 140px;
  }
  #page-reports .glass-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
  }
  #page-reports .data-table {
    min-width: 560px;
  }
  #page-reports .data-table thead th:nth-child(4),
  #page-reports .data-table tbody td:nth-child(4) {
    display: none;
  }

  /* PAGE PARAMÈTRES */
  #tab-profil .grid.grid-cols-2 {
    grid-template-columns: 1fr;
  }
  #tab-profil .grid.grid-cols-2 .col-span-2 {
    grid-column: span 1;
  }
  .settings-tabs {
    flex-wrap: wrap;
  }

  .modal-content {
    max-width: 92vw;
  }
}

/* RESPONSIVE — MOBILE (≤ 640 px) */
@media (max-width: 640px) {
  #scrollContent,
  .page {
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .page > * {
    max-width: 100%;
    box-sizing: border-box;
  }

  #scrollContent {
    padding: 1rem;
  }

  #topbar {
    gap: 0.6rem;
  }
  #topbar > div:first-child {
    flex: 1;
    min-width: 0;
  }
  #topbar > div:last-child {
    gap: 0.5rem;
    margin-left: auto;
  }
  #topbar .search-glass {
    display: none;
  }
  #topbar img.rounded-full {
    display: none;
  }
  #topbar h2 {
    font-size: 1.2rem;
  }
  #topbar p.text-sm {
    display: none;
  }

  .page > div:first-child.flex,
  .page > header {
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 100%;
  }
  .page h2.text-2xl {
    font-size: 1.2rem !important;
  }
  .page > div:first-child .btn-primary {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    max-width: 100%;
  }

  #page-dashboard section.grid.grid-cols-4 {
    grid-template-columns: 1fr;
  }

  /* GRAPHIQUES EN PREMIER sur mobile */
  #page-dashboard {
    display: flex;
    flex-direction: column;
  }
  #page-dashboard > header {
    order: 0;
  }
  #page-dashboard > section:nth-of-type(2) {
    order: 1;
    margin-bottom: 1.5rem;
  }
  #page-dashboard > section:nth-of-type(1) {
    order: 2;
  }

  /* Hauteurs charts mobile */
  #chart-line-wrap .relative {
    height: 200px !important;
  }
  #chart-donut-wrap .relative.mx-auto {
    width: 160px !important;
    height: 160px !important;
  }

  /* PAGE UTILISATEURS */
  #page-users > .mb-6 {
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }
  #page-users #add-user-btn {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }
  #page-users .mb-5.flex {
    flex-direction: column;
    gap: 0.5rem;
  }
  #page-users .mb-5 .search-glass {
    width: 100%;
    min-width: unset;
  }
  #page-users .mb-5 select {
    width: 100%;
    min-width: unset;
    padding: 0.625rem 1rem;
  }
  #page-users .glass-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  #page-users .data-table {
    min-width: 440px;
    max-width: none;
  }
  #page-users .data-table tbody td:nth-child(1) > div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
  }
  #page-users .data-table thead th:nth-child(2),
  #page-users .data-table tbody td:nth-child(2) {
    display: none;
  }
  #page-users .data-table thead th:nth-child(5),
  #page-users .data-table tbody td:nth-child(5) {
    display: none;
  }
  #users-pagination {
    flex-wrap: wrap;
    gap: 0.375rem;
    justify-content: center;
  }

  /* PAGE STATISTIQUES */
  #page-statistics > .mb-6 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  #page-statistics {
    display: flex;
    flex-direction: column;
  }
  #page-statistics > div.mb-6:first-child {
    order: 0;
  }
  #page-statistics > section.grid.grid-cols-3 {
    order: 3;
  }
  #page-statistics > article.glass-card {
    order: 1;
  }
  #page-statistics > section.grid.grid-cols-2 {
    order: 2;
  }
  #page-statistics > article.glass-table-wrap {
    order: 4;
  }
  #page-statistics section.grid.grid-cols-3 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  #page-statistics .relative.h-72 {
    height: 200px !important;
  }
  #page-statistics .relative.h-56 {
    height: 180px !important;
  }
  #page-statistics section.grid.grid-cols-2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  #page-statistics .data-table {
    min-width: unset;
    width: 100%;
  }
  #page-statistics .data-table thead th:nth-child(3),
  #page-statistics .data-table tbody td:nth-child(3),
  #page-statistics .data-table thead th:nth-child(4),
  #page-statistics .data-table tbody td:nth-child(4) {
    display: none;
  }
  #page-statistics .glass-table-wrap {
    overflow-x: unset;
  }

  /* PAGE PARAMÈTRES */
  #page-settings > .mb-6 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .settings-tabs {
    gap: 0.35rem;
  }
  .settings-tab {
    padding: 0.375rem 0.75rem;
    font-size: 0.78rem;
  }
  #tab-profil .mb-6.flex.items-center {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  #tab-profil .grid.grid-cols-2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  #tab-profil .col-span-2 {
    grid-column: span 1;
  }
  #tab-profil .glass-input {
    font-size: 0.85rem;
  }
  #save-profile-btn {
    width: 100%;
    margin-top: 1rem;
  }
  #tab-securite .mb-6.grid {
    max-width: none;
    gap: 0.75rem;
  }
  #tab-securite .toggle-row {
    max-width: none;
  }
  #tab-securite .space-y-3 {
    max-width: none;
  }
  .session-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .session-item button {
    align-self: flex-end;
  }
  #tab-notifications .space-y-3 {
    max-width: none;
  }
  #save-notif-btn {
    width: 100%;
    margin-top: 1rem;
  }
  #tab-apparence .flex.gap-3 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  #tab-apparence .toggle-row {
    max-width: none;
  }
  #tab-apparence .flex.gap-2 {
    flex-wrap: wrap;
  }

  /* PAGE RAPPORTS */
  #page-reports > .mb-6 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  #generate-report-btn {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }
  #page-reports section.grid.grid-cols-3 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  #page-reports section.grid.grid-cols-3 article:last-child {
    grid-column: span 1;
    max-width: none;
  }
  #page-reports .report-card {
    display: flex;
    flex-direction: column;
    height: auto !important;
  }
  #page-reports .report-card button {
    align-self: flex-start;
    margin-top: auto;
  }
  #page-reports .mb-5.flex {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  #page-reports .mb-5 span {
    display: none;
  }
  #page-reports .mb-5 select,
  #page-reports .mb-5 input[type="date"] {
    width: 100%;
    min-width: unset;
  }
  #page-reports .glass-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  #page-reports .data-table {
    min-width: 320px;
    max-width: none;
  }
  #page-reports .data-table thead th:nth-child(3),
  #page-reports .data-table tbody td:nth-child(3) {
    display: none;
  }
  #page-reports .data-table thead th:nth-child(4),
  #page-reports .data-table tbody td:nth-child(4) {
    display: none;
  }

  .modal-content {
    padding: 1.25rem;
    margin: 0;
    max-width: calc(100vw - 2rem);
    max-height: 85vh;
  }
  .modal-content h3 {
    font-size: 1.1rem;
  }
  .modal-content .flex.justify-end {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  .modal-content .flex.justify-end button {
    width: 100%;
    text-align: center;
  }

  #toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
  .toast {
    min-width: unset;
    width: 100%;
  }

  #scroll-top-btn {
    bottom: 4.5rem;
    right: 1rem;
  }
}

/* RESPONSIVE — TRÈS PETIT (≤ 400 px) */
@media (max-width: 400px) {
  #scrollContent {
    padding: 0.75rem;
  }
  .glass-card {
    border-radius: 14px;
  }
  .modal-content {
    border-radius: 14px;
    max-height: 80vh;
  }
  .mini-kpi-value {
    font-size: 1.4rem;
  }
  #page-dashboard section.grid.grid-cols-4 article {
    padding: 0.875rem;
  }

  #chart-line-wrap .relative {
    height: 170px !important;
  }

  .data-table thead th:nth-child(2),
  .data-table tbody td:nth-child(2) {
    display: none;
  }
}
