/*
 * Chaos Dashboard
 * Couche visuelle uniquement : les navigations et composants React d'origine
 * restent présents et continuent de porter toute la logique fonctionnelle.
 */

body.cc-control-active {
  --cc-accent: #ff0033;
  --cc-accent-soft: rgba(255, 0, 51, 0.1);
  --cc-bg: #080809;
  --cc-surface: #101013;
  --cc-surface-raised: #151519;
  --cc-sidebar: #0b0b0e;
  --cc-sidebar-hover: rgba(255, 255, 255, 0.045);
  --cc-sidebar-active: rgba(255, 255, 255, 0.075);
  --cc-line: rgba(255, 255, 255, 0.09);
  --cc-line-strong: rgba(255, 255, 255, 0.15);
  --cc-text: #f7f7f8;
  --cc-text-soft: #b0b0b8;
  --cc-text-muted: #74747e;
  --cc-good: #2fd277;
  --cc-sidebar-width: 258px;
  min-width: 320px;
  background:
    radial-gradient(circle at 73% -20%, rgba(255, 0, 51, 0.07), transparent 36rem),
    var(--cc-bg);
  color: var(--cc-text);
}

body.cc-control-active.cc-sidebar-open {
  overflow: hidden;
}

body.cc-control-active .dashboard,
body.cc-control-active .admin-panel {
  min-height: 100vh;
  background: transparent;
}

/* Header */
body.cc-control-active .dashboard-header {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: 68px;
  padding: 0;
  border-bottom: 1px solid var(--cc-line);
  background: rgba(8, 8, 9, 0.94);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

body.cc-control-active .dashboard-header .container.dashboard-header-content {
  width: 100%;
  max-width: none;
  min-height: 68px;
  margin: 0;
  padding: 0 24px;
}

body.cc-control-active .dashboard-brand {
  gap: 11px;
}

body.cc-control-active .dashboard-brand .brand-logo {
  width: auto;
  height: 38px;
  object-fit: contain;
}

body.cc-control-active .dashboard-brand h1 {
  margin: 0;
  color: var(--cc-text);
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

body.cc-control-active .dashboard-brand h1::after {
  content: none;
}

body.cc-control-active .dashboard-user {
  gap: 10px;
}

body.cc-control-active .dashboard-admin-btn {
  display: none !important;
}

body.cc-control-active .dashboard-home-btn,
body.cc-control-active .logout-btn,
body.cc-control-active .admin-panel-nav-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--cc-line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--cc-text-soft);
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 650;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

body.cc-control-active .dashboard-home-btn:hover,
body.cc-control-active .logout-btn:hover,
body.cc-control-active .admin-panel-nav-btn:hover {
  transform: none;
  border-color: var(--cc-line-strong);
  background: rgba(255, 255, 255, 0.055);
  color: var(--cc-text);
}

body.cc-control-active .user-info {
  min-height: 38px;
  padding: 0 4px;
}

body.cc-control-active .user-avatar {
  width: 32px;
  height: 32px;
  border: 1px solid var(--cc-line-strong);
  box-shadow: none;
}

body.cc-control-active .user-details {
  gap: 0;
}

body.cc-control-active .user-name {
  color: var(--cc-text);
  font-size: 0.77rem;
  font-weight: 650;
}

body.cc-control-active .user-role {
  color: var(--cc-text-muted);
  font-size: 0.64rem;
}

/* Main app shell */
body.cc-control-active .dashboard-main {
  display: grid !important;
  grid-template-columns: var(--cc-sidebar-width) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - 68px);
  padding: 0 !important;
}

body.cc-control-active .dashboard-main > .container {
  grid-column: 2;
  width: 100% !important;
  max-width: 1680px !important;
  min-width: 0;
  margin: 0 auto !important;
  padding: 26px clamp(22px, 3vw, 44px) 44px !important;
}

body.cc-control-active .cc-control-sidebar {
  position: sticky;
  top: 68px;
  z-index: 55;
  display: flex;
  grid-column: 1;
  grid-row: 1;
  width: var(--cc-sidebar-width);
  height: calc(100vh - 68px);
  min-height: 520px;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--cc-line);
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 0, 51, 0.07), transparent 17rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 14rem),
    var(--cc-sidebar);
  box-shadow: none;
}

.cc-sidebar-head {
  display: none;
}

.cc-sidebar-close,
.cc-sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--cc-line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--cc-text-soft);
  cursor: pointer;
}

.cc-sidebar-nav {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 10px 20px;
  scrollbar-color: rgba(168, 185, 211, 0.22) transparent;
  scrollbar-width: thin;
}

.cc-sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

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

.cc-sidebar-nav::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(168, 185, 211, 0.2);
}

.cc-nav-section-label {
  margin: 20px 10px 8px;
  color: #65748b;
  font-size: 0.59rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.cc-nav-section-label.cc-admin-label {
  margin-top: 24px;
}

.cc-nav-item,
.cc-nav-group-toggle,
.cc-nav-subgroup-toggle {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cc-text-soft);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  font-family: inherit;
  font-weight: 570;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.cc-nav-item,
.cc-nav-group-toggle {
  min-height: 39px;
  gap: 10px;
  margin: 2px 0;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 0.79rem;
}

.cc-nav-subgroup-toggle {
  min-height: 36px;
  gap: 9px;
  margin: 3px 0 1px;
  padding: 6px 8px;
  border-radius: 6px;
  color: #8998ad;
  font-size: 0.72rem;
  font-weight: 630;
}

.cc-nav-item:hover,
.cc-nav-group-toggle:hover,
.cc-nav-subgroup-toggle:hover {
  border-color: rgba(168, 185, 211, 0.08);
  background: var(--cc-sidebar-hover);
  color: var(--cc-text);
}

.cc-control-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  overflow: hidden;
  color: #7f90aa;
  font-size: 18px !important;
  line-height: 18px !important;
}

.cc-nav-group-toggle > span:nth-child(2),
.cc-nav-subgroup-toggle > span:nth-child(2),
.cc-nav-item > span:last-child {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-nav-group-toggle > .cc-control-icon:last-child,
.cc-nav-subgroup-toggle > .cc-control-icon:last-child {
  margin-left: auto;
  color: #70707a;
  transition: color 180ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cc-nav-group.is-open > .cc-nav-group-toggle > .cc-control-icon:last-child,
.cc-nav-subgroup.is-open > .cc-nav-subgroup-toggle > .cc-control-icon:last-child {
  transform: rotate(180deg);
}

.cc-nav-group.has-active > .cc-nav-group-toggle,
.cc-nav-subgroup.has-active > .cc-nav-subgroup-toggle {
  color: #dfe6f1;
}

.cc-nav-group.has-active > .cc-nav-group-toggle > .cc-control-icon:first-child,
.cc-nav-subgroup.has-active > .cc-nav-subgroup-toggle > .cc-control-icon:first-child {
  color: var(--cc-accent);
}

.cc-nav-item.is-active {
  border-color: rgba(255, 0, 51, 0.18);
  background: var(--cc-sidebar-active);
  color: #ffffff;
  font-weight: 650;
}

.cc-nav-item.is-active::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -1px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--cc-accent);
}

.cc-nav-item.is-active > .cc-control-icon {
  color: var(--cc-accent);
}

.cc-nav-group-panel,
.cc-nav-subgroup-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-4px);
  visibility: hidden;
  transition:
    grid-template-rows 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 280ms;
}

.cc-nav-group.is-open > .cc-nav-group-panel,
.cc-nav-subgroup.is-open > .cc-nav-subgroup-panel {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition-delay: 0s;
}

.cc-nav-panel-clip {
  min-height: 0;
  overflow: hidden;
}

.cc-nav-group > .cc-nav-group-panel > .cc-nav-panel-clip > .cc-nav-panel-inner {
  position: relative;
  margin: 1px 0 7px 18px;
  padding: 1px 0 2px 10px;
  border-left: 1px solid rgba(168, 185, 211, 0.12);
}

.cc-nav-subgroup > .cc-nav-subgroup-panel > .cc-nav-panel-clip > .cc-nav-panel-inner {
  margin: 0 0 5px 14px;
  padding: 1px 0 3px 8px;
  border-left: 1px solid rgba(168, 185, 211, 0.1);
}

.cc-nav-group.is-open > .cc-nav-group-panel > .cc-nav-panel-clip > .cc-nav-panel-inner > .cc-nav-item,
.cc-nav-group.is-open > .cc-nav-group-panel > .cc-nav-panel-clip > .cc-nav-panel-inner > .cc-nav-subgroup,
.cc-nav-subgroup.is-open > .cc-nav-subgroup-panel > .cc-nav-panel-clip > .cc-nav-panel-inner > .cc-nav-item {
  animation: cc-nav-item-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cc-nav-panel-inner > :nth-child(2) { animation-delay: 18ms !important; }
.cc-nav-panel-inner > :nth-child(3) { animation-delay: 36ms !important; }
.cc-nav-panel-inner > :nth-child(4) { animation-delay: 54ms !important; }
.cc-nav-panel-inner > :nth-child(5) { animation-delay: 72ms !important; }
.cc-nav-panel-inner > :nth-child(6) { animation-delay: 90ms !important; }
.cc-nav-panel-inner > :nth-child(7) { animation-delay: 108ms !important; }

@keyframes cc-nav-item-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cc-nav-group-panel .cc-nav-item {
  min-height: 35px;
  padding: 6px 8px;
  font-size: 0.74rem;
}

.cc-nav-group-panel .cc-nav-item .cc-control-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  font-size: 16px !important;
  line-height: 16px !important;
}

.cc-admin-panel {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.cc-admin-panel > .cc-nav-panel-clip > .cc-nav-panel-inner {
  margin-left: 8px !important;
  padding-left: 8px !important;
}

.cc-admin-lock {
  flex: 0 0 auto !important;
  padding: 3px 5px;
  border: 1px solid rgba(255, 0, 51, 0.22);
  border-radius: 4px;
  color: #ff607f;
  font-size: 0.46rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
}

.cc-sidebar-foot {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 9px;
  padding: 11px 17px;
  border-top: 1px solid rgba(168, 185, 211, 0.08);
  color: var(--cc-text-muted);
}

.cc-sidebar-foot-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--cc-good);
  box-shadow: 0 0 0 3px rgba(69, 212, 131, 0.08);
}

.cc-sidebar-foot > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.cc-sidebar-foot strong {
  color: #b9c4d4;
  font-size: 0.66rem;
  font-weight: 650;
}

.cc-sidebar-foot small {
  margin-top: 2px;
  font-size: 0.57rem;
}

/* Existing navigation stays in the DOM as the functional source of truth. */
body.cc-route-dashboard .dashboard:not(.admin-dashboard) .dashboard-content > .main-nav,
body.cc-route-dashboard .dashboard:not(.admin-dashboard) .dashboard-content > .sub-nav,
body.cc-route-admin .admin-dashboard .dashboard-content > .admin-nav {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Context and hierarchy */
.cc-context-header {
  display: flex;
  min-height: 94px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0 0 20px;
  padding: 4px 2px 18px;
  border-bottom: 1px solid var(--cc-line);
}

.cc-context-copy {
  min-width: 0;
}

.cc-context-path {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 5px !important;
  color: var(--cc-text-muted) !important;
  font-size: 0.63rem !important;
  font-weight: 680;
  letter-spacing: 0.08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

.cc-context-copy h2 {
  margin: 0;
  color: var(--cc-text);
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.cc-context-copy > p:last-child {
  max-width: 680px;
  margin: 6px 0 0 !important;
  color: var(--cc-text-soft) !important;
  font-size: 0.79rem !important;
  line-height: 1.5 !important;
}

.cc-context-access {
  display: inline-flex;
  min-height: 32px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--cc-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.022);
  color: var(--cc-text-muted);
  font-size: 0.64rem;
  font-weight: 650;
}

.cc-context-access .cc-control-icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
  font-size: 15px !important;
  line-height: 15px !important;
}

.cc-context-access.is-admin {
  border-color: rgba(255, 0, 51, 0.18);
  background: rgba(255, 0, 51, 0.045);
  color: #d8a4ae;
}

.cc-context-access.is-admin .cc-control-icon {
  color: var(--cc-accent);
}

/* Dashboard content */
body.cc-route-dashboard .dashboard-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 286px) !important;
  align-items: start;
  gap: clamp(20px, 2.5vw, 34px) !important;
}

body.cc-route-dashboard .dashboard-content {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

body.cc-route-dashboard .dashboard-sidebar {
  position: sticky;
  top: 94px;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

body.cc-route-admin .dashboard-grid.admin-grid,
body.cc-route-admin .dashboard-grid.admin-grid-full {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start;
  gap: 14px !important;
}

body.cc-route-admin .dashboard-sidebar.admin-sidebar {
  position: static;
  top: auto;
  width: 100%;
  min-width: 0;
}

body.cc-route-admin .admin-player-search {
  display: grid;
  grid-template-columns: minmax(160px, 0.32fr) minmax(260px, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 70px;
  padding: 12px 16px;
}

body.cc-route-admin .admin-player-search > h3 {
  margin: 0;
  font-size: 0.83rem;
}

body.cc-route-admin .player-dropdown-container {
  margin: 0;
}

body.cc-control-active .dashboard-content,
body.cc-control-active .admin-panel-content {
  min-width: 0;
}

body.cc-control-active .glass-card,
body.cc-control-active .dashboard-card,
body.cc-control-active .tutorial-card,
body.cc-control-active .admin-panel-card,
body.cc-control-active .admin-panel-section {
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 18, 21, 0.98), rgba(12, 12, 15, 0.98));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

body.cc-control-active .glass-card:hover,
body.cc-control-active .dashboard-card:hover,
body.cc-control-active .tutorial-card:hover {
  transform: none;
  border-color: var(--cc-line-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

body.cc-control-active .dashboard-section {
  margin-bottom: 22px;
}

body.cc-control-active .dashboard-section > p,
body.cc-control-active .section-description {
  color: var(--cc-text-soft);
}

/* Server presence card */
body.cc-route-dashboard .server-status-card {
  position: relative;
  overflow: visible;
  padding: 20px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 0, 51, 0.075), transparent 13rem),
    linear-gradient(180deg, rgba(19, 19, 23, 0.98), rgba(12, 12, 15, 0.98));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
  animation: cc-card-reveal 440ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.cc-route-dashboard .server-status-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 22px;
  left: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 0, 51, 0.78), transparent);
  opacity: 0.68;
}

body.cc-route-dashboard .server-status-card h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: #f5f5f6;
  font-size: 0.84rem;
  font-weight: 720;
}

body.cc-route-dashboard .server-status-card h3 svg {
  color: var(--cc-accent);
}

body.cc-route-dashboard .server-status-card .status-current {
  min-height: 34px;
  margin-bottom: 15px;
  padding: 0 10px;
  border: 1px solid rgba(47, 210, 119, 0.12);
  border-radius: 8px;
  background: rgba(47, 210, 119, 0.045);
  font-size: 0.73rem;
  font-weight: 680;
}

body.cc-route-dashboard .server-status-card .status-current.online svg {
  filter: drop-shadow(0 0 5px rgba(47, 210, 119, 0.48));
  animation: cc-live-pulse 2.8s ease-in-out infinite;
}

body.cc-route-dashboard .server-status-card .status-history {
  margin-bottom: 17px;
}

body.cc-route-dashboard .server-status-card .status-history-label {
  margin-bottom: 7px;
  color: var(--cc-text-muted);
  font-size: 0.63rem;
  font-weight: 550;
}

body.cc-route-dashboard .server-status-card .status-history-bars {
  height: 17px;
  overflow: visible;
}

body.cc-route-dashboard .server-status-card .status-history-bar {
  box-shadow: none;
  transform-origin: bottom;
  animation: cc-status-bar-in 360ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--cc-history-index, 0) * 9ms);
}

body.cc-route-dashboard .server-status-card .player-count {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 9px;
}

body.cc-route-dashboard .server-status-card .player-count .count {
  color: #ffffff;
  font-size: 1.9rem;
  font-weight: 820;
  letter-spacing: -0.045em;
}

body.cc-route-dashboard .server-status-card .player-count .max {
  color: var(--cc-text-muted);
  font-size: 0.69rem;
}

body.cc-route-dashboard .server-status-card .player-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

body.cc-route-dashboard .server-status-card .player-bar-fill {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cc-accent), #ff496d);
  box-shadow: none;
  transform-origin: left;
  animation: cc-player-bar-in 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.cc-route-dashboard .server-status-card .online-players {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid var(--cc-line);
}

body.cc-route-dashboard .server-status-card .online-players h4 {
  margin: 0 0 9px;
  color: #92929c;
  font-size: 0.65rem;
  font-weight: 680;
  letter-spacing: 0.03em;
}

body.cc-route-dashboard .server-status-card .online-players ul {
  display: grid;
  max-height: 340px;
  gap: 5px;
  margin: 0;
  padding: 0 3px 0 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
}

body.cc-route-dashboard .server-status-card .online-players li {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 35px;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.026);
  color: #ebebee;
  font-size: 0.72rem;
  font-weight: 630;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  animation: cc-player-row-in 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--cc-player-index, 0) * 36ms + 100ms);
}

body.cc-route-dashboard .server-status-card .online-players li::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--cc-good);
  box-shadow: 0 0 0 3px rgba(47, 210, 119, 0.08);
}

body.cc-route-dashboard .server-status-card .online-players li.cc-player-overflow::before {
  background: var(--cc-text-muted);
  box-shadow: none;
}

body.cc-route-dashboard .server-status-card .online-players li:hover {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045);
}

@keyframes cc-card-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cc-status-bar-in {
  from { opacity: 0; transform: scaleY(0.25); }
  to { opacity: 1; transform: scaleY(1); }
}

@keyframes cc-player-bar-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes cc-player-row-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cc-live-pulse {
  0%, 100% { opacity: 0.78; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
}

body.cc-route-dashboard .tutorials-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.cc-route-dashboard .tutorial-card {
  min-height: 0;
  padding: 18px;
}

body.cc-route-dashboard .tutorial-card h3 {
  font-size: 0.95rem;
  line-height: 1.35;
}

body.cc-route-dashboard .tutorial-card p {
  color: var(--cc-text-soft);
  font-size: 0.76rem;
  line-height: 1.55;
}

body.cc-control-active .btn,
body.cc-control-active button:not(.cc-nav-item):not(.cc-nav-group-toggle):not(.cc-nav-subgroup-toggle):not(.cc-sidebar-toggle):not(.cc-sidebar-close):not(.cc-sidebar-backdrop) {
  border-radius: 7px;
}

body.cc-control-active input,
body.cc-control-active select,
body.cc-control-active textarea,
body.cc-control-active .player-dropdown-trigger {
  border-color: var(--cc-line);
  border-radius: 7px;
  background: #0d0d10;
  color: var(--cc-text);
  box-shadow: none;
}

body.cc-control-active input:focus,
body.cc-control-active select:focus,
body.cc-control-active textarea:focus,
body.cc-control-active .player-dropdown-trigger:focus-within {
  border-color: rgba(255, 0, 51, 0.55);
  outline: 2px solid rgba(255, 0, 51, 0.1);
  outline-offset: 1px;
}

body.cc-control-active table {
  overflow: hidden;
  border: 1px solid var(--cc-line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.5);
}

body.cc-control-active th {
  border-bottom: 1px solid var(--cc-line-strong);
  background: #111824;
  color: #aeb9c9;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.cc-control-active td {
  border-bottom-color: var(--cc-line);
  color: #d8dee8;
  font-size: 0.78rem;
}

body.cc-control-active tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

/* FiveM admin panel joins the same shell. */
body.cc-route-admin-panel .admin-panel {
  display: grid !important;
  grid-template-columns: var(--cc-sidebar-width) minmax(0, 1fr) !important;
  align-items: start;
}

body.cc-route-admin-panel .admin-panel > .cc-control-sidebar {
  position: sticky;
  top: 0;
  grid-column: 1;
  height: 100vh;
}

body.cc-route-admin-panel .admin-panel > .admin-panel-sidebar:not(.cc-control-sidebar) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

body.cc-route-admin-panel .admin-panel-main {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  background: transparent;
}

body.cc-route-admin-panel .admin-panel-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 68px;
  padding: 0 clamp(20px, 3vw, 42px);
  border-bottom: 1px solid var(--cc-line);
  background: rgba(8, 10, 15, 0.94);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

body.cc-route-admin-panel .admin-panel-header-left h2 {
  color: var(--cc-text);
  font-size: 0.95rem;
  font-weight: 720;
}

body.cc-route-admin-panel .admin-panel-status {
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 0.61rem;
}

body.cc-route-admin-panel .admin-panel-content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 26px clamp(22px, 3vw, 44px) 44px;
}

body.cc-route-admin-panel .admin-panel-content.admin-declarations-active > #cc-context-header {
  display: flex !important;
}

.cc-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: none;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0 !important;
  background: rgba(2, 4, 8, 0.68);
  backdrop-filter: blur(3px);
  cursor: default;
}

@media (max-width: 1180px) {
  body.cc-control-active {
    --cc-sidebar-width: 238px;
  }

  body.cc-route-dashboard .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 250px) !important;
  }

  body.cc-route-dashboard .tutorials-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  body.cc-control-active .dashboard-main,
  body.cc-route-admin-panel .admin-panel {
    display: block !important;
    min-height: calc(100vh - 62px);
  }

  body.cc-control-active .dashboard-header,
  body.cc-route-admin-panel .admin-panel-header {
    min-height: 62px;
  }

  body.cc-control-active .dashboard-header .container.dashboard-header-content {
    display: flex !important;
    height: 62px !important;
    min-height: 62px;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding-inline: 14px;
  }

  body.cc-control-active .dashboard-user {
    width: auto !important;
    min-width: 0;
    flex: 0 1 auto;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    margin-left: auto;
  }

  body.cc-control-active .dashboard-brand {
    flex: 0 0 auto;
    margin: 0 !important;
  }

  body.cc-control-active .dashboard-linked-accounts {
    order: initial !important;
    width: auto !important;
    min-width: 0;
    flex-wrap: nowrap !important;
  }

  body.cc-control-active .dashboard-main > .container,
  body.cc-route-admin-panel .admin-panel-content {
    width: 100% !important;
    padding: 20px 18px 36px !important;
  }

  body.cc-control-active .cc-control-sidebar,
  body.cc-route-admin-panel .admin-panel > .cc-control-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 220;
    width: min(86vw, 292px);
    height: 100vh;
    min-height: 0;
    transform: translateX(-102%);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.36);
    transition: transform 190ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  body.cc-sidebar-open .dashboard-main > .cc-control-sidebar,
  body.cc-sidebar-open.cc-route-admin-panel .admin-panel > .cc-control-sidebar {
    transform: translateX(0);
  }

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

  .cc-sidebar-head {
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 14px;
    border-bottom: 1px solid var(--cc-line);
  }

  .cc-sidebar-close,
  .cc-sidebar-toggle {
    display: inline-flex;
  }

  body.cc-control-active .cc-sidebar-toggle {
    order: -1;
    margin-right: 3px;
  }

  body.cc-route-admin-panel .cc-sidebar-toggle {
    margin-right: 12px;
  }

  body.cc-route-admin-panel .admin-panel-main {
    width: 100%;
  }

  body.cc-route-admin-panel .admin-panel-header {
    display: flex !important;
    height: 62px !important;
    min-height: 62px !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding-block: 0 !important;
  }

  body.cc-route-admin-panel .admin-panel-header-left,
  body.cc-route-admin-panel .admin-panel-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  body.cc-route-admin-panel .admin-panel-header-left {
    min-width: 0;
    flex: 1;
  }

  body.cc-route-admin-panel .admin-panel-header-right {
    flex: 0 0 auto;
  }

  body.cc-route-dashboard .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.cc-route-dashboard .dashboard-content,
  body.cc-route-dashboard .dashboard-sidebar {
    position: static;
    grid-column: 1;
  }

  body.cc-route-dashboard .dashboard-content {
    grid-row: 1;
  }

  body.cc-route-dashboard .dashboard-sidebar {
    grid-row: 2;
  }

  body.cc-route-admin .dashboard-grid.admin-grid,
  body.cc-route-admin .dashboard-grid.admin-grid-full {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 700px) {
  body.cc-control-active .dashboard-brand h1,
  body.cc-control-active .user-details,
  body.cc-control-active .user-info .user-name,
  body.cc-control-active .user-info .chaos-plus-badge,
  body.cc-route-admin-panel .admin-panel-header-right .admin-panel-nav-btn:first-child {
    display: none;
  }

  body.cc-control-active .user-info {
    width: 34px;
    min-width: 34px;
    padding: 0;
  }

  body.cc-control-active .dashboard-account-card {
    width: 36px;
    min-width: 36px;
    height: 36px;
    flex: 0 0 36px;
    justify-content: center;
    padding: 0;
    border-radius: 7px;
  }

  body.cc-control-active .dashboard-account-copy,
  body.cc-control-active .dashboard-account-plus {
    display: none !important;
  }

  body.cc-control-active .dashboard-brand .brand-logo {
    height: 34px;
  }

  body.cc-control-active .dashboard-home-btn,
  body.cc-control-active .logout-btn,
  body.cc-control-active .admin-panel-nav-btn {
    width: 36px;
    min-width: 36px;
    padding: 0;
    font-size: 0;
  }

  body.cc-control-active .dashboard-home-btn svg,
  body.cc-control-active .logout-btn svg,
  body.cc-control-active .admin-panel-nav-btn svg {
    margin: 0;
    font-size: 0.9rem;
  }

  body.cc-control-active .dashboard-main > .container,
  body.cc-route-admin-panel .admin-panel-content {
    padding: 17px 13px 30px !important;
  }

  .cc-context-header {
    min-height: 0;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 2px 1px 14px;
  }

  .cc-context-copy h2 {
    font-size: 1.4rem;
  }

  .cc-context-copy > p:last-child {
    font-size: 0.73rem !important;
  }

  .cc-context-access {
    display: none;
  }

  body.cc-route-admin .admin-player-search {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  body.cc-route-dashboard .tutorial-card,
  body.cc-control-active .glass-card {
    border-radius: 8px;
  }

  body.cc-route-admin-panel .admin-panel-header {
    padding-inline: 12px;
  }

  body.cc-route-admin-panel .admin-panel-header-left {
    min-width: 0;
  }

  body.cc-route-admin-panel .admin-panel-header-left h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.cc-control-active *,
  body.cc-control-active *::before,
  body.cc-control-active *::after {
    scroll-behavior: auto !important;
    animation-delay: 0ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
