:root {
  --ac-bg: #070914;
  --ac-bg-soft: #0a0d1a;
  --ac-surface: #0d1020;
  --ac-surface-2: #13172a;
  --ac-surface-3: #181d35;
  --ac-border: rgba(255, 255, 255, 0.08);
  --ac-border-strong: rgba(255, 45, 100, 0.35);
  --ac-text: #f4f6ff;
  --ac-muted: #8f96ad;
  --ac-muted-2: #aab0c4;
  --ac-accent: #ff2d64;
  --ac-accent-soft: rgba(255, 45, 100, 0.16);
  --ac-accent-2: #7c3cff;
  --ac-success: #22c55e;
  --ac-warning: #f59e0b;
  --ac-danger: #ef4444;
  --ac-info: #38bdf8;
  --ac-radius-sm: 10px;
  --ac-radius-md: 14px;
  --ac-radius-lg: 18px;
  --ac-radius-xl: 24px;
  --ac-shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.25);
  --ac-shadow-md: 0 18px 55px rgba(0, 0, 0, 0.35);
  --ac-glow: 0 0 28px rgba(255, 45, 100, 0.28);
  --ac-transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ac-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ac-text);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 45, 100, 0.12), transparent 32%),
    radial-gradient(circle at 90% 8%, rgba(124, 60, 255, 0.12), transparent 34%),
    linear-gradient(180deg, #070914 0%, #050711 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app,
.dashboard,
.layout,
.admin-layout,
main {
  color: var(--ac-text);
}

.main-content,
.content,
.page,
.page-content {
  padding: 24px;
}

.sidebar,
aside,
nav.sidebar {
  background:
    linear-gradient(180deg, rgba(13, 16, 32, 0.98), rgba(7, 9, 20, 0.98)),
    radial-gradient(circle at top, rgba(255, 45, 100, 0.10), transparent 30%);
  border-right: 1px solid var(--ac-border);
  box-shadow: var(--ac-shadow-sm);
}

.sidebar a,
.sidebar button,
.nav-link,
.menu-link,
.menu-item {
  color: var(--ac-muted-2);
  border-radius: var(--ac-radius-md);
  transition:
    background var(--ac-transition),
    color var(--ac-transition),
    border-color var(--ac-transition),
    transform var(--ac-transition),
    box-shadow var(--ac-transition);
}

.sidebar a:hover,
.sidebar button:hover,
.nav-link:hover,
.menu-link:hover,
.menu-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.045);
  transform: translateX(2px);
}

.sidebar a.active,
.sidebar button.active,
.nav-link.active,
.menu-link.active,
.menu-item.active,
[aria-current="page"] {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(255, 45, 100, 0.24), rgba(255, 45, 100, 0.06));
  border: 1px solid rgba(255, 45, 100, 0.35);
  box-shadow: inset 3px 0 0 var(--ac-accent), 0 0 24px rgba(255, 45, 100, 0.12);
}

.header,
.topbar,
.page-header,
.dashboard-header {
  background: rgba(13, 16, 32, 0.78);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-lg);
  box-shadow: var(--ac-shadow-sm);
  backdrop-filter: blur(14px);
}

.header h1,
.topbar h1,
.page-header h1,
.dashboard-header h1 {
  letter-spacing: -0.04em;
}

.hero,
.banner,
.dashboard-hero,
.welcome-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--ac-radius-xl);
  border: 1px solid rgba(255, 45, 100, 0.22);
  background:
    radial-gradient(circle at 70% 50%, rgba(255, 45, 100, 0.28), transparent 28%),
    radial-gradient(circle at 85% 40%, rgba(124, 60, 255, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(19, 23, 42, 0.96), rgba(7, 9, 20, 0.96));
  box-shadow: var(--ac-shadow-md);
}

.hero::before,
.banner::before,
.dashboard-hero::before,
.welcome-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.05), transparent 18%, transparent 80%, rgba(255,45,100,0.08)),
    repeating-linear-gradient(90deg, transparent 0 48px, rgba(255,255,255,0.018) 49px 50px);
  opacity: 0.75;
}

.hero > *,
.banner > *,
.dashboard-hero > *,
.welcome-card > * {
  position: relative;
  z-index: 1;
}

.card,
.panel,
.stat-card,
.widget,
.section-card,
.box,
article {
  background: linear-gradient(180deg, rgba(19, 23, 42, 0.88), rgba(10, 13, 26, 0.94));
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-lg);
  box-shadow: var(--ac-shadow-sm);
  transition:
    transform var(--ac-transition),
    border-color var(--ac-transition),
    box-shadow var(--ac-transition),
    background var(--ac-transition);
}

.card:hover,
.panel:hover,
.stat-card:hover,
.widget:hover,
.section-card:hover,
.box:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 45, 100, 0.28);
  box-shadow: var(--ac-shadow-md);
}

.card-title,
.section-title,
.panel-title {
  color: var(--ac-text);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.card-subtitle,
.muted,
.text-muted,
.description,
small {
  color: var(--ac-muted);
}

.stat-card {
  padding: 22px;
}

.stat-card .stat-value,
.stat-value,
.kpi-value,
.metric-value {
  color: var(--ac-text);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
}

.stat-card .stat-label,
.stat-label,
.kpi-label,
.metric-label {
  color: var(--ac-muted);
  font-size: 0.9rem;
}

button,
.btn,
.button,
[role="button"] {
  border-radius: var(--ac-radius-md);
  border: 1px solid var(--ac-border);
  background: rgba(255, 255, 255, 0.045);
  color: var(--ac-text);
  cursor: pointer;
  transition:
    transform var(--ac-transition),
    background var(--ac-transition),
    border-color var(--ac-transition),
    box-shadow var(--ac-transition),
    opacity var(--ac-transition);
}

button:hover,
.btn:hover,
.button:hover,
[role="button"]:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

button:focus-visible,
.btn:focus-visible,
.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(255, 45, 100, 0.85);
  outline-offset: 3px;
}

button:disabled,
.btn:disabled,
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary,
.primary,
button[type="submit"] {
  background: linear-gradient(135deg, var(--ac-accent), #c9184a);
  border-color: rgba(255, 45, 100, 0.65);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(255, 45, 100, 0.22);
}

.btn-primary:hover,
.primary:hover,
button[type="submit"]:hover {
  box-shadow: var(--ac-glow);
}

.btn-danger,
.danger,
.danger-button,
.purge,
.delete,
button[data-variant="danger"] {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.24), rgba(127, 29, 29, 0.34));
  border-color: rgba(239, 68, 68, 0.45);
  color: #ffe4e6;
}

.btn-danger:hover,
.danger:hover,
.danger-button:hover,
.purge:hover,
.delete:hover,
button[data-variant="danger"]:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.32), rgba(127, 29, 29, 0.44));
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.22);
}

.btn-success,
.success,
button[data-variant="success"] {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(20, 83, 45, 0.30));
  border-color: rgba(34, 197, 94, 0.42);
  color: #dcfce7;
}

input,
select,
textarea {
  color: var(--ac-text);
  background: rgba(7, 9, 20, 0.72);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-md);
  transition:
    border-color var(--ac-transition),
    box-shadow var(--ac-transition),
    background var(--ac-transition);
}

input::placeholder,
textarea::placeholder {
  color: rgba(143, 150, 173, 0.72);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(255, 45, 100, 0.62);
  background: rgba(10, 13, 26, 0.92);
  box-shadow: 0 0 0 4px rgba(255, 45, 100, 0.12);
}

label {
  color: var(--ac-muted-2);
  font-weight: 700;
}

.form-group,
.field,
.input-group {
  display: grid;
  gap: 8px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ac-text);
}

thead th {
  color: var(--ac-muted-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid var(--ac-border);
}

tbody td {
  color: var(--ac-muted-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

tbody tr {
  transition: background var(--ac-transition);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.badge,
.tag,
.status,
.role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  border: 1px solid var(--ac-border);
  background: rgba(255, 255, 255, 0.055);
  color: var(--ac-muted-2);
}

.badge-primary,
.badge-accent,
.role-admin {
  background: var(--ac-accent-soft);
  border-color: rgba(255, 45, 100, 0.45);
  color: #ff9db8;
}

.badge-success,
.status-valid,
.status-success {
  background: rgba(34, 197, 94, 0.13);
  border-color: rgba(34, 197, 94, 0.42);
  color: #86efac;
}

.badge-warning,
.status-warning,
.status-expired {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.42);
  color: #facc15;
}

.badge-danger,
.status-danger,
.status-blocked,
.status-error,
.badge-permanent {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.42);
  color: #fca5a5;
}

.badge-info,
.status-info {
  background: rgba(56, 189, 248, 0.13);
  border-color: rgba(56, 189, 248, 0.38);
  color: #7dd3fc;
}

.avatar,
.user-avatar,
img.avatar {
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 0 4px rgba(255, 45, 100, 0.08);
}

.session-card,
.user-card,
.active-session {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-lg);
  transition:
    transform var(--ac-transition),
    border-color var(--ac-transition),
    background var(--ac-transition);
}

.session-card:hover,
.user-card:hover,
.active-session:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 45, 100, 0.32);
  background: rgba(255, 255, 255, 0.055);
}

.log,
.log-item,
.activity-item {
  border-radius: var(--ac-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(255, 255, 255, 0.025);
  transition:
    background var(--ac-transition),
    border-color var(--ac-transition);
}

.log:hover,
.log-item:hover,
.activity-item:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.10);
}

.log-info {
  border-left: 3px solid var(--ac-info);
}

.log-success {
  border-left: 3px solid var(--ac-success);
}

.log-warning {
  border-left: 3px solid var(--ac-warning);
}

.log-error,
.log-danger {
  border-left: 3px solid var(--ac-danger);
}

.dropzone,
.upload-zone,
.import-zone {
  border: 1.5px dashed rgba(255, 45, 100, 0.42);
  border-radius: var(--ac-radius-xl);
  background: linear-gradient(180deg, rgba(255, 45, 100, 0.07), rgba(255, 255, 255, 0.025));
  transition:
    border-color var(--ac-transition),
    background var(--ac-transition),
    box-shadow var(--ac-transition);
}

.dropzone:hover,
.upload-zone:hover,
.import-zone:hover {
  border-color: rgba(255, 45, 100, 0.72);
  background: linear-gradient(180deg, rgba(255, 45, 100, 0.10), rgba(255, 255, 255, 0.035));
  box-shadow: var(--ac-glow);
}

.purge-page,
.danger-zone,
.critical-zone {
  border: 1px solid rgba(239, 68, 68, 0.32);
  background:
    radial-gradient(circle at 80% 20%, rgba(239, 68, 68, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(127, 29, 29, 0.20), rgba(13, 16, 32, 0.92));
  border-radius: var(--ac-radius-xl);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 45, 100, 0.55) rgba(255, 255, 255, 0.05);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 45, 100, 0.55);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 45, 100, 0.75);
}

@keyframes acFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.panel,
.stat-card,
.hero,
.banner,
.dashboard-hero,
.section-card {
  animation: acFadeUp 360ms ease both;
}

@media (max-width: 1024px) {
  .grid,
  .stats-grid,
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .main-content,
  .content,
  .page,
  .page-content {
    padding: 16px;
  }
}

@media (max-width: 680px) {
  .grid,
  .stats-grid,
  .cards-grid {
    grid-template-columns: 1fr !important;
  }

  .header,
  .topbar,
  .page-header,
  .dashboard-header {
    border-radius: var(--ac-radius-md);
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .hero,
  .banner,
  .dashboard-hero,
  .welcome-card {
    border-radius: var(--ac-radius-lg);
  }
}

/* Dashboard AC integration */
:root {
  --bg: var(--ac-bg);
  --panel: var(--ac-surface);
  --panel-2: var(--ac-surface-2);
  --panel-3: var(--ac-surface-3);
  --text: var(--ac-text);
  --muted: var(--ac-muted);
  --line: var(--ac-border);
  --accent: var(--ac-accent);
  --accent-2: var(--ac-accent-2);
  --success: var(--ac-success);
  --info: var(--ac-info);
  --danger: var(--ac-danger);
  --shadow: var(--ac-shadow-md);
  --radius: var(--ac-radius-md);
}

.page-header {
  padding: 18px 20px;
}

.dashboard-hero {
  border-radius: var(--ac-radius-xl);
  background:
    radial-gradient(circle at 78% 45%, rgba(255, 45, 100, 0.28), transparent 30%),
    radial-gradient(circle at 92% 20%, rgba(124, 60, 255, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(19, 23, 42, 0.97), rgba(7, 9, 20, 0.97));
}

.metric.stat-card {
  padding: 22px;
  border-radius: var(--ac-radius-lg);
}

.metric .stat-value {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.navbtn.active {
  border: 1px solid rgba(255, 45, 100, 0.35);
  background: linear-gradient(90deg, rgba(255, 45, 100, 0.28), rgba(255, 45, 100, 0.06));
  box-shadow: inset 3px 0 0 var(--ac-accent), 0 0 24px rgba(255, 45, 100, 0.12);
}

.ban-item,
.staff-row,
.whitelist-item,
.check-row,
.detail-line {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--ac-border);
  border-radius: var(--ac-radius-md);
}

.brand-mark {
  border-color: rgba(255, 45, 100, 0.42);
  box-shadow: 0 0 26px rgba(255, 45, 100, 0.18);
}

.action-box {
  background: rgba(255, 45, 100, 0.10);
  border-color: rgba(255, 45, 100, 0.32);
}

.license {
  color: #ff9db8;
}

.modal-panel,
.toast {
  background: rgba(13, 16, 32, 0.98);
  border-color: var(--ac-border);
}

/* Immersive cyber control system */
:root {
  --ac-bg: #05070f;
  --ac-bg-soft: #0a0f1f;
  --ac-surface: #10172a;
  --ac-surface-2: #131c31;
  --ac-surface-3: #18233d;
  --ac-accent: #ff174f;
  --ac-accent-soft: rgba(255, 23, 79, 0.15);
  --ac-border-strong: rgba(255, 23, 79, 0.42);
  --ac-glow: 0 0 34px rgba(255, 23, 79, 0.32);
  --ac-circuit: rgba(255, 23, 79, 0.12);
}

body {
  background:
    radial-gradient(circle at 50% -15%, rgba(255, 23, 79, 0.20), transparent 34%),
    radial-gradient(circle at 95% 10%, rgba(122, 60, 255, 0.10), transparent 28%),
    linear-gradient(180deg, #05070f, #03050b 75%);
  background-attachment: fixed;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(90deg, transparent 0 49%, rgba(255, 23, 79, 0.05) 50%, transparent 51%),
    linear-gradient(transparent 0 49%, rgba(255, 23, 79, 0.04) 50%, transparent 51%),
    radial-gradient(circle, rgba(255, 45, 100, 0.22) 0 1px, transparent 1.5px);
  background-size: 96px 96px, 96px 96px, 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 86%);
}

.login {
  background:
    linear-gradient(90deg, rgba(3, 5, 12, 0.92), rgba(3, 5, 12, 0.56), rgba(3, 5, 12, 0.92)),
    url("/assets/img/ac-control-hud.png") center / cover no-repeat;
}

.login::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, transparent 0 5px, rgba(255, 23, 79, 0.025) 6px),
    radial-gradient(circle at center, transparent 0 18%, rgba(5, 7, 15, 0.72) 58%, rgba(3, 5, 12, 0.96) 100%);
}

.login-card {
  position: relative;
  border-color: rgba(255, 23, 79, 0.34);
  background: rgba(5, 8, 17, 0.88);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.68),
    0 0 55px rgba(255, 23, 79, 0.16),
    inset 0 0 42px rgba(255, 23, 79, 0.04);
  backdrop-filter: blur(18px) saturate(120%);
}

.login-card::after {
  content: "SECURE AUTH // AC NETWORK";
  position: absolute;
  right: 18px;
  bottom: 12px;
  color: rgba(255, 45, 100, 0.42);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
}

.sidebar {
  border-right-color: rgba(255, 23, 79, 0.22);
  background:
    linear-gradient(180deg, rgba(7, 10, 20, 0.98), rgba(4, 6, 13, 0.99)),
    radial-gradient(circle at 50% 0%, rgba(255, 23, 79, 0.22), transparent 26%);
  box-shadow: 12px 0 50px rgba(0, 0, 0, 0.38), 1px 0 0 rgba(255, 23, 79, 0.12);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background:
    linear-gradient(90deg, transparent 0 94%, rgba(255, 23, 79, 0.3) 95%, transparent 96%),
    repeating-linear-gradient(180deg, transparent 0 76px, rgba(255, 23, 79, 0.05) 77px 78px);
}

.sidebar .brand {
  position: relative;
  border-bottom-color: rgba(255, 23, 79, 0.25);
}

.brand-mark {
  position: relative;
  border-radius: 50%;
  border-color: rgba(255, 45, 100, 0.72);
  box-shadow:
    0 0 0 5px rgba(255, 23, 79, 0.06),
    0 0 28px rgba(255, 23, 79, 0.40),
    inset 0 0 18px rgba(255, 23, 79, 0.22);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px dashed rgba(255, 45, 100, 0.38);
  border-radius: 50%;
  animation: acHudSpin 14s linear infinite;
}

.navbtn {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  letter-spacing: 0.015em;
}

.navbtn::after {
  content: "";
  position: absolute;
  inset: auto 12px 5px 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 23, 79, 0.65), transparent);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity var(--ac-transition), transform var(--ac-transition);
}

.navbtn:hover::after,
.navbtn.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.navbtn.active {
  background:
    linear-gradient(90deg, rgba(255, 23, 79, 0.25), rgba(255, 23, 79, 0.04)),
    rgba(255, 255, 255, 0.02);
  box-shadow:
    inset 3px 0 0 var(--ac-accent),
    inset 0 0 22px rgba(255, 23, 79, 0.08),
    0 0 22px rgba(255, 23, 79, 0.12);
}

.page-header {
  position: relative;
  overflow: hidden;
  min-height: 82px;
  border-color: rgba(255, 23, 79, 0.18);
  background:
    linear-gradient(90deg, rgba(16, 23, 42, 0.92), rgba(8, 11, 22, 0.90)),
    rgba(5, 7, 15, 0.88);
}

.page-header::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 0;
  width: min(38vw, 430px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ac-accent));
  box-shadow: 0 0 13px var(--ac-accent);
}

.page-header h1,
.section-title h2,
.section-title h3 {
  text-shadow: 0 0 24px rgba(255, 23, 79, 0.12);
}

.control-hero {
  min-height: 330px;
  grid-template-columns: minmax(300px, 1fr) minmax(170px, 0.32fr) minmax(170px, 0.32fr);
  align-items: end;
  isolation: isolate;
  padding: clamp(24px, 4vw, 46px);
  background:
    linear-gradient(90deg, rgba(3, 5, 12, 0.96) 0%, rgba(3, 5, 12, 0.66) 38%, rgba(3, 5, 12, 0.30) 55%, rgba(3, 5, 12, 0.80) 100%),
    url("/assets/img/ac-control-hud.png") center / cover no-repeat;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.54),
    inset 0 0 70px rgba(255, 23, 79, 0.10),
    0 0 0 1px rgba(255, 23, 79, 0.12);
}

.control-hero::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 30%, rgba(2, 3, 8, 0.7)),
    repeating-linear-gradient(180deg, transparent 0 5px, rgba(255, 23, 79, 0.025) 6px);
  opacity: 0.9;
}

.control-hero::after {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 23, 79, 0.18);
  border-radius: calc(var(--ac-radius-xl) - 8px);
  clip-path: polygon(0 0, 28% 0, 31% 4px, 69% 4px, 72% 0, 100% 0, 100% 100%, 72% 100%, 69% calc(100% - 4px), 31% calc(100% - 4px), 28% 100%, 0 100%);
}

.dashboard-hero:not(.control-hero)::after {
  content: "";
  position: absolute;
  right: clamp(-90px, -5vw, -30px);
  top: 50%;
  width: 260px;
  aspect-ratio: 1;
  pointer-events: none;
  border: 1px solid rgba(255, 23, 79, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 38%, rgba(255, 23, 79, 0.10) 39% 40%, transparent 41% 52%, rgba(255, 23, 79, 0.08) 53% 54%, transparent 55%),
    repeating-conic-gradient(from 0deg, rgba(255, 23, 79, 0.18) 0 2deg, transparent 2deg 15deg);
  transform: translateY(-50%);
  opacity: 0.56;
}

.control-hero-copy {
  max-width: 520px;
  padding: 20px;
  border-left: 2px solid var(--ac-accent);
  background: linear-gradient(90deg, rgba(5, 7, 15, 0.82), transparent);
  backdrop-filter: blur(5px);
}

.control-hero h2 {
  margin: 9px 0;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  letter-spacing: -0.075em;
  text-transform: uppercase;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.14),
    0 0 30px rgba(255, 23, 79, 0.28);
}

.system-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.system-status-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 23, 79, 0.25);
  border-radius: 4px;
  color: #d7ddea;
  background: rgba(5, 7, 15, 0.76);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.system-status-strip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ac-success);
  box-shadow: 0 0 10px var(--ac-success);
  animation: acSystemPulse 1.8s ease-in-out infinite;
}

.hud-readout {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border-radius: 8px;
  border-color: rgba(255, 23, 79, 0.40);
  background:
    linear-gradient(135deg, rgba(5, 7, 15, 0.86), rgba(255, 23, 79, 0.10)),
    rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(12px);
}

.hud-readout::after {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(255, 23, 79, 0.12);
  clip-path: polygon(0 0, 82% 0, 100% 30%, 100% 100%, 18% 100%, 0 70%);
}

.card {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.075);
  background:
    linear-gradient(145deg, rgba(18, 27, 48, 0.88), rgba(6, 9, 19, 0.96)),
    var(--ac-surface);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.30),
    inset 0 1px rgba(255, 255, 255, 0.025);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background:
    linear-gradient(90deg, var(--ac-circuit), transparent 16%) top left / 74px 1px no-repeat,
    linear-gradient(180deg, var(--ac-circuit), transparent 18%) top left / 1px 58px no-repeat,
    linear-gradient(270deg, var(--ac-circuit), transparent 16%) bottom right / 74px 1px no-repeat,
    linear-gradient(0deg, var(--ac-circuit), transparent 18%) bottom right / 1px 58px no-repeat;
}

.card:hover {
  border-color: rgba(255, 23, 79, 0.32);
  box-shadow:
    0 22px 58px rgba(0, 0, 0, 0.42),
    0 0 25px rgba(255, 23, 79, 0.08),
    inset 0 1px rgba(255, 255, 255, 0.035);
}

.metric.stat-card,
.period-metrics .metric {
  min-height: 140px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 23, 79, 0.14), transparent 28%),
    linear-gradient(145deg, rgba(17, 26, 47, 0.94), rgba(6, 9, 19, 0.98));
}

.metric.stat-card::after,
.period-metrics .metric::after {
  right: -28px;
  top: -28px;
  width: 104px;
  height: 104px;
  border: 1px solid rgba(255, 23, 79, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 41%, rgba(255, 23, 79, 0.12) 42% 44%, transparent 45%),
    repeating-conic-gradient(from 0deg, rgba(255, 23, 79, 0.26) 0 2deg, transparent 2deg 13deg);
  animation: acHudSpin 18s linear infinite;
}

.metric .stat-value,
.metric strong {
  font-family: "Cascadia Code", Consolas, monospace;
  text-shadow: 0 0 22px rgba(255, 23, 79, 0.24);
}

.cyber-toolbar,
.toolbar {
  position: relative;
  border: 1px solid rgba(255, 23, 79, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(16, 23, 42, 0.92), rgba(5, 7, 15, 0.94));
  box-shadow: inset 3px 0 0 rgba(255, 23, 79, 0.50);
}

.cyber-form-panel::after,
.scanner-layout::after,
.analytics-grid::after,
.admin-control-grid::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0.34;
  background: radial-gradient(circle, rgba(255, 23, 79, 0.9) 0 1px, transparent 1.5px);
  background-size: 16px 16px;
  mask-image: linear-gradient(135deg, #000, transparent 48%);
}

.cyber-form-panel::after {
  inset: 0 55% 48% 0;
}

.scanner-layout,
.analytics-grid,
.admin-control-grid {
  position: relative;
}

.scanner-layout::after,
.analytics-grid::after,
.admin-control-grid::after {
  inset: 0;
  z-index: -1;
}

.license-check-item,
.ban-item,
.session-item,
.staff-row,
.whitelist-item,
.log-item {
  border-color: rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(100deg, rgba(255, 23, 79, 0.025), transparent 24%),
    rgba(7, 11, 23, 0.78);
}

.license-check-item:hover,
.ban-item:hover,
.session-item:hover,
.staff-row:hover,
.whitelist-item:hover,
.log-item:hover {
  border-color: rgba(255, 23, 79, 0.28);
  background:
    linear-gradient(100deg, rgba(255, 23, 79, 0.08), transparent 34%),
    rgba(9, 14, 28, 0.90);
}

.scanner-layout .license-editor-card {
  top: 28px;
  border-color: rgba(255, 23, 79, 0.20);
  box-shadow: inset 0 0 42px rgba(255, 23, 79, 0.035), var(--ac-shadow-sm);
}

.license-category {
  border-color: rgba(255, 23, 79, 0.14);
  background: rgba(7, 11, 23, 0.72);
}

.license-category[open] {
  border-color: rgba(255, 23, 79, 0.28);
  box-shadow: 0 0 24px rgba(255, 23, 79, 0.06);
}

.console-panel {
  border-color: rgba(255, 23, 79, 0.20);
  background:
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(255, 23, 79, 0.035) 32px),
    linear-gradient(180deg, rgba(4, 7, 14, 0.98), rgba(8, 12, 24, 0.98));
  font-family: "Cascadia Code", Consolas, monospace;
}

.console-panel::after {
  content: "AC SECURITY LOG // LIVE";
  display: block;
  padding: 8px 14px;
  color: rgba(255, 45, 100, 0.55);
  border-top: 1px solid rgba(255, 23, 79, 0.12);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.chart-wrap {
  border: 1px solid rgba(255, 23, 79, 0.10);
  border-radius: 10px;
  background:
    linear-gradient(rgba(255, 23, 79, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 23, 79, 0.035) 1px, transparent 1px),
    rgba(5, 8, 17, 0.58);
  background-size: 28px 28px;
}

.hold-purge-btn {
  border-color: rgba(239, 68, 68, 0.58);
  background:
    repeating-linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0 8px, rgba(127, 29, 29, 0.20) 8px 16px),
    rgba(73, 10, 18, 0.55);
  box-shadow: inset 0 0 24px rgba(239, 68, 68, 0.12), 0 0 20px rgba(239, 68, 68, 0.08);
}

.modal-panel {
  border-color: rgba(255, 23, 79, 0.30);
  box-shadow:
    0 32px 100px rgba(0, 0, 0, 0.65),
    0 0 45px rgba(255, 23, 79, 0.12);
}

.toast {
  border-color: rgba(255, 23, 79, 0.28);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.50), 0 0 26px rgba(255, 23, 79, 0.12);
}

@keyframes acHudSpin {
  to { transform: rotate(360deg); }
}

@keyframes acSystemPulse {
  50% { opacity: 0.45; transform: scale(0.75); }
}

@media (max-width: 1180px) {
  .control-hero {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(160px, 0.44fr));
    background-position: 58% center;
  }
}

@media (max-width: 900px) {
  .control-hero {
    min-height: 420px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    background-position: center;
  }

  .control-hero-copy {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .control-hero {
    min-height: 500px;
    grid-template-columns: 1fr;
    padding: 18px;
    background-position: 52% center;
  }

  .control-hero-copy {
    grid-column: auto;
    padding: 14px;
  }

  .control-hero h2 {
    font-size: clamp(2.2rem, 15vw, 4rem);
  }

  .system-status-strip span {
    font-size: 0.56rem;
  }

  .page-header {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark::after,
  .metric.stat-card::after,
  .period-metrics .metric::after,
  .system-status-strip i {
    animation: none;
  }
}

/* RBAC settings command center */
.settings-command-center {
  gap: 18px;
}

.settings-command-center.active {
  display: grid;
}

.settings-hero {
  min-height: 230px;
  border-color: rgba(122, 60, 255, 0.32);
  background:
    linear-gradient(90deg, rgba(5, 7, 15, 0.96), rgba(5, 7, 15, 0.50), rgba(5, 7, 15, 0.90)),
    url("/assets/img/ac-control-hud.png") center / cover no-repeat;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
}

.settings-role-editor,
.settings-permissions-panel,
.settings-role-list-card {
  border-color: rgba(122, 60, 255, 0.22);
  background:
    radial-gradient(circle at 95% 0%, rgba(122, 60, 255, 0.10), transparent 28%),
    linear-gradient(145deg, rgba(15, 23, 43, 0.96), rgba(5, 8, 17, 0.98));
}

.settings-role-editor input[type="color"] {
  min-height: 50px;
  padding: 5px;
  cursor: pointer;
}

.settings-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}

.settings-permission-switch {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(5, 9, 19, 0.72);
  cursor: pointer;
  transition: border-color var(--ac-transition), background var(--ac-transition);
}

.settings-permission-switch:hover {
  border-color: rgba(255, 23, 79, 0.28);
  background: rgba(255, 23, 79, 0.05);
}

.settings-permission-switch input {
  width: 34px;
  min-height: 18px;
  accent-color: var(--ac-accent);
}

.settings-permission-switch strong,
.settings-permission-switch small {
  display: block;
}

.settings-permission-switch small {
  margin-top: 4px;
  color: rgba(54, 217, 255, 0.55);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.58rem;
}

.settings-role-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-role-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.settings-role-card {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(5, 9, 19, 0.74);
}

.settings-role-card:hover,
.settings-role-card.active {
  border-color: var(--role-color);
  background: color-mix(in srgb, var(--role-color) 9%, rgba(5, 9, 19, 0.88));
  box-shadow: 0 0 22px color-mix(in srgb, var(--role-color) 16%, transparent);
}

.settings-role-swatch {
  width: 7px;
  height: 38px;
  border-radius: 999px;
  background: var(--role-color);
  box-shadow: 0 0 12px var(--role-color);
}

.settings-role-card strong,
.settings-role-card small {
  display: block;
}

.settings-role-card small {
  margin-top: 4px;
  color: var(--ac-muted);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.58rem;
}

@media (max-width: 980px) {
  .settings-layout,
  .settings-role-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .settings-permission-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar command rail */
.app.is-ready {
  grid-template-columns: 304px minmax(0, 1fr);
}

.sidebar {
  width: 304px;
  padding: 18px 14px 16px;
  border-right: 1px solid rgba(255, 23, 79, 0.30);
  background:
    radial-gradient(circle at 50% -6%, rgba(255, 23, 79, 0.24), transparent 27%),
    linear-gradient(180deg, rgba(6, 9, 19, 0.99), rgba(3, 5, 12, 0.99));
  box-shadow:
    18px 0 60px rgba(0, 0, 0, 0.48),
    1px 0 0 rgba(255, 23, 79, 0.12),
    inset -18px 0 38px rgba(255, 23, 79, 0.025);
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 7px;
  bottom: 0;
  width: 1px;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(255, 23, 79, 0.75) 18%, rgba(255, 23, 79, 0.16) 72%, transparent);
  box-shadow: 0 0 14px rgba(255, 23, 79, 0.48);
}

.sidebar .brand {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 10px 12px 18px;
  margin: 0 0 12px;
  border-bottom: 1px solid rgba(255, 23, 79, 0.20);
  background: linear-gradient(90deg, rgba(255, 23, 79, 0.055), transparent);
}

.sidebar .brand-mark {
  width: 58px;
  height: 58px;
}

.sidebar .brand-copy {
  min-width: 0;
}

.sidebar .brand-code {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 45, 100, 0.68);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.sidebar .brand h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.04em;
  text-shadow: 0 0 18px rgba(255, 23, 79, 0.22);
}

.sidebar .brand p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ac-muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 6px 14px;
  padding: 8px 10px;
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.035);
  color: #aab0c4;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sidebar-status span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sidebar-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ac-success);
  box-shadow: 0 0 10px var(--ac-success);
  animation: acSystemPulse 1.8s ease-in-out infinite;
}

.sidebar-status small {
  color: #86efac;
  font-size: inherit;
}

.sidebar .nav {
  counter-reset: ac-nav;
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 6px 0;
}

.sidebar .navbtn {
  counter-increment: ac-nav;
  display: grid;
  grid-template-columns: 28px 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #9ba5ba;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.018), transparent);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.sidebar .navbtn::before {
  content: counter(ac-nav, decimal-leading-zero);
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: rgba(143, 150, 173, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.018);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.52rem;
  font-weight: 800;
  transition: color var(--ac-transition), border-color var(--ac-transition), background var(--ac-transition);
}

.sidebar .navbtn .icon {
  grid-column: 2;
  display: block;
  width: 36px;
  height: 36px;
  padding: 9px;
  color: #8f99af;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
  transition: color var(--ac-transition), border-color var(--ac-transition), background var(--ac-transition), box-shadow var(--ac-transition);
}

.sidebar .navbtn::after {
  content: "";
  position: static;
  grid-column: 4;
  justify-self: end;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(143, 150, 173, 0.34);
  border-radius: 50%;
  background: transparent;
  opacity: 1;
  transform: none;
  transition: background var(--ac-transition), border-color var(--ac-transition), box-shadow var(--ac-transition);
}

.sidebar .navbtn:hover {
  color: #f4f7ff;
  border-color: rgba(255, 23, 79, 0.16);
  background:
    linear-gradient(90deg, rgba(255, 23, 79, 0.10), transparent 82%),
    rgba(255, 255, 255, 0.018);
  transform: translateX(2px);
}

.sidebar .navbtn:hover::before {
  color: #ff8da8;
  border-color: rgba(255, 23, 79, 0.24);
}

.sidebar .navbtn:hover .icon {
  color: #ff7598;
  border-color: rgba(255, 23, 79, 0.30);
  box-shadow: 0 0 16px rgba(255, 23, 79, 0.12);
}

.sidebar .navbtn.active {
  color: #fff;
  border-color: rgba(255, 23, 79, 0.48);
  background:
    linear-gradient(90deg, rgba(255, 23, 79, 0.23), rgba(255, 23, 79, 0.055) 68%, transparent),
    rgba(255, 255, 255, 0.018);
  box-shadow:
    inset 3px 0 0 var(--ac-accent),
    inset 0 0 34px rgba(255, 23, 79, 0.055),
    0 0 25px rgba(255, 23, 79, 0.10);
}

.sidebar .navbtn.active::before {
  color: #fff;
  border-color: rgba(255, 23, 79, 0.55);
  background: rgba(255, 23, 79, 0.16);
  box-shadow: 0 0 12px rgba(255, 23, 79, 0.15);
}

.sidebar .navbtn.active .icon {
  color: #fff;
  border-color: rgba(255, 45, 100, 0.66);
  background:
    radial-gradient(circle, rgba(255, 45, 100, 0.24), rgba(255, 23, 79, 0.07));
  box-shadow: 0 0 20px rgba(255, 23, 79, 0.24), inset 0 0 14px rgba(255, 23, 79, 0.10);
}

.sidebar .navbtn.active::after {
  border-color: var(--ac-accent);
  background: var(--ac-accent);
  box-shadow: 0 0 11px var(--ac-accent);
}

.sidebar-footer {
  position: relative;
  gap: 8px;
  margin-top: 18px;
  padding: 17px 6px 4px;
  border-top-color: rgba(255, 23, 79, 0.20);
}

.sidebar-footer-label {
  display: block;
  margin: 0 4px 2px;
  color: rgba(255, 45, 100, 0.60);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.sidebar-footer .btn {
  min-height: 44px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.022);
}

.main::before {
  left: 304px;
}

@media (max-width: 760px) {
  .app.is-ready {
    display: block;
  }

  .sidebar {
    width: min(320px, 88vw);
    transform: translateX(-102%) !important;
    transition: transform 220ms ease;
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }

  .sidebar::after {
    right: 4px;
  }

  .main::before {
    left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-status i {
    animation: none;
  }
}

/* Weekly command center: dedicated visual redesign */
#weekly.weekly-command-center {
  --weekly-red: #ff174f;
  --weekly-cyan: #36d9ff;
  --weekly-amber: #ffb82e;
  --weekly-green: #2ce58a;
  gap: 20px;
}

#weekly .weekly-hero {
  min-height: 370px;
  grid-template-columns: minmax(390px, 1.15fr) minmax(300px, 0.62fr);
  align-items: center;
  padding: clamp(24px, 4vw, 48px);
  border-color: rgba(255, 23, 79, 0.42);
  background:
    linear-gradient(90deg, rgba(3, 5, 12, 0.96), rgba(3, 5, 12, 0.48) 54%, rgba(3, 5, 12, 0.88)),
    url("/assets/img/ac-control-hud.png") center / cover no-repeat;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.56),
    inset 0 0 90px rgba(255, 23, 79, 0.12),
    0 0 35px rgba(255, 23, 79, 0.10);
}

#weekly .weekly-hero::before {
  opacity: 0.8;
  background:
    repeating-linear-gradient(180deg, transparent 0 5px, rgba(255, 23, 79, 0.028) 6px),
    radial-gradient(circle at 29% 50%, transparent 0 22%, rgba(255, 23, 79, 0.10) 22.4% 22.8%, transparent 23.2%);
  mask-image: none;
}

#weekly .weekly-hero::after {
  right: 24px;
  bottom: 18px;
  width: calc(100% - 48px);
  height: 1px;
  background: linear-gradient(90deg, var(--weekly-red), transparent 38%, transparent 70%, var(--weekly-cyan));
  box-shadow: 0 0 18px rgba(255, 23, 79, 0.55);
}

#weekly .weekly-hero-copy {
  display: grid;
  justify-items: start;
  gap: 12px;
}

#weekly .weekly-radar {
  position: relative;
  display: grid;
  width: min(290px, 65vw);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 23, 79, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 23, 79, 0.15) 0 3%, transparent 3.5% 29%, rgba(255, 23, 79, 0.09) 29.5% 30%, transparent 30.5% 42%, rgba(255, 23, 79, 0.13) 42.5% 43%, transparent 43.5%),
    repeating-conic-gradient(from 0deg, rgba(255, 23, 79, 0.30) 0 1deg, transparent 1deg 9deg);
  box-shadow:
    0 0 50px rgba(255, 23, 79, 0.18),
    inset 0 0 55px rgba(255, 23, 79, 0.08);
}

#weekly .weekly-radar::before,
#weekly .weekly-radar::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

#weekly .weekly-radar::before {
  inset: 14px;
  border: 2px dashed rgba(255, 45, 100, 0.38);
  animation: weeklyRadarSpin 18s linear infinite;
}

#weekly .weekly-radar::after {
  inset: 38px;
  border: 1px solid rgba(255, 45, 100, 0.30);
  border-top-color: var(--weekly-cyan);
  border-bottom-color: var(--weekly-red);
  box-shadow: inset 0 0 24px rgba(255, 23, 79, 0.10);
  animation: weeklyRadarSpin 8s linear infinite reverse;
}

#weekly .weekly-radar-core {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 62%;
  aspect-ratio: 1;
  place-content: center;
  border: 1px solid rgba(255, 23, 79, 0.34);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 8, 19, 0.94), rgba(5, 7, 15, 0.94) 70%);
  box-shadow: 0 0 38px rgba(255, 23, 79, 0.24), inset 0 0 32px rgba(255, 23, 79, 0.10);
}

#weekly .weekly-radar-core span,
#weekly .weekly-radar-core small {
  color: rgba(244, 247, 255, 0.62);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

#weekly .weekly-radar-core h2 {
  margin: 2px 0;
  color: #fff;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.08em;
  text-shadow: 0 0 14px #fff, 0 0 32px rgba(255, 23, 79, 0.75);
}

#weekly .weekly-hero .panel-subtitle {
  max-width: 470px;
  margin: 0;
  padding: 9px 12px;
  border-left: 2px solid var(--weekly-red);
  background: linear-gradient(90deg, rgba(255, 23, 79, 0.10), transparent);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.72rem;
}

#weekly .weekly-command-panel {
  position: relative;
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 250px;
  padding: 26px;
  border-radius: 10px;
  border-color: rgba(54, 217, 255, 0.30);
  background:
    linear-gradient(145deg, rgba(54, 217, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(5, 9, 19, 0.90), rgba(5, 7, 15, 0.78));
  box-shadow: inset 0 0 42px rgba(54, 217, 255, 0.035), 0 20px 45px rgba(0, 0, 0, 0.35);
}

#weekly .weekly-command-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(54, 217, 255, 0.10);
  clip-path: polygon(0 0, 75% 0, 100% 22%, 100% 100%, 25% 100%, 0 78%);
}

#weekly .weekly-panel-code,
#weekly .weekly-section-code,
#weekly .weekly-kpi-code {
  display: block;
  color: rgba(54, 217, 255, 0.68);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#weekly .weekly-command-panel strong {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: -0.055em;
  text-shadow: 0 0 25px rgba(54, 217, 255, 0.26);
}

#weekly .weekly-signal-bars {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 32px;
  padding-top: 8px;
  border-top: 1px solid rgba(54, 217, 255, 0.12);
}

#weekly .weekly-signal-bars i {
  width: 9px;
  height: 30%;
  background: linear-gradient(180deg, var(--weekly-cyan), var(--weekly-red));
  box-shadow: 0 0 8px rgba(54, 217, 255, 0.42);
  animation: weeklySignalBars 1.7s ease-in-out infinite alternate;
}

#weekly .weekly-signal-bars i:nth-child(2) { height: 52%; animation-delay: -0.4s; }
#weekly .weekly-signal-bars i:nth-child(3) { height: 80%; animation-delay: -0.8s; }
#weekly .weekly-signal-bars i:nth-child(4) { height: 44%; animation-delay: -1.1s; }
#weekly .weekly-signal-bars i:nth-child(5) { height: 68%; animation-delay: -0.2s; }
#weekly .weekly-signal-bars i:nth-child(6) { height: 94%; animation-delay: -0.65s; }

#weekly .period-metrics {
  gap: 14px;
}

#weekly .period-metrics .weekly-kpi {
  min-height: 166px;
  padding: 22px;
  border-radius: 8px;
  border-top: 2px solid var(--weekly-tone);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--weekly-tone) 10%, transparent), transparent 44%),
    linear-gradient(145deg, rgba(15, 24, 43, 0.96), rgba(5, 8, 17, 0.98));
}

#weekly .period-metrics .weekly-kpi::before {
  background:
    linear-gradient(90deg, var(--weekly-tone), transparent) top left / 45% 1px no-repeat,
    linear-gradient(180deg, var(--weekly-tone), transparent) top left / 1px 45% no-repeat,
    linear-gradient(270deg, var(--weekly-tone), transparent) bottom right / 45% 1px no-repeat,
    linear-gradient(0deg, var(--weekly-tone), transparent) bottom right / 1px 45% no-repeat;
  opacity: 0.28;
}

#weekly .period-metrics .weekly-kpi .weekly-kpi-code {
  margin-bottom: 14px;
  color: color-mix(in srgb, var(--weekly-tone) 76%, white);
}

#weekly .period-metrics .weekly-kpi strong {
  margin-top: 17px;
  color: #fff;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: clamp(2rem, 3vw, 3rem);
  text-shadow: 0 0 24px color-mix(in srgb, var(--weekly-tone) 42%, transparent);
}

#weekly .period-toolbar {
  padding: 13px;
  border: 1px solid rgba(255, 23, 79, 0.25);
  border-left: 3px solid var(--weekly-red);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32), inset 0 0 30px rgba(255, 23, 79, 0.025);
}

#weekly .period-podium-card,
#weekly .period-chart-card,
#weekly .weekly-grid > .card,
#weekly .period-archive-card {
  border-radius: 10px;
  border-color: rgba(255, 23, 79, 0.16);
  background:
    radial-gradient(circle at 95% 5%, rgba(255, 23, 79, 0.08), transparent 26%),
    linear-gradient(145deg, rgba(14, 22, 40, 0.94), rgba(5, 8, 17, 0.98));
}

#weekly .section-title {
  align-items: end;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255, 23, 79, 0.12);
}

#weekly .weekly-section-code {
  margin-bottom: 5px;
  color: rgba(255, 45, 100, 0.66);
}

#weekly .podium-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  min-height: 250px;
}

#weekly .podium-item {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 10px;
  min-height: 180px;
  padding: 22px 14px;
  text-align: center;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 23, 79, 0.10), transparent 45%),
    rgba(5, 9, 19, 0.78);
}

#weekly .podium-item.podium-1 {
  min-height: 235px;
  order: 2;
  border-color: rgba(255, 184, 46, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 184, 46, 0.18), transparent 48%),
    rgba(5, 9, 19, 0.88);
  box-shadow: 0 0 32px rgba(255, 184, 46, 0.10);
}

#weekly .podium-item.podium-2 {
  min-height: 205px;
  order: 1;
  border-color: rgba(54, 217, 255, 0.35);
}

#weekly .podium-item.podium-3 {
  order: 3;
}

#weekly .podium-avatar {
  width: 58px;
  height: 58px;
  border: 2px solid rgba(255, 23, 79, 0.44);
  box-shadow: 0 0 22px rgba(255, 23, 79, 0.20);
}

#weekly .podium-copy strong,
#weekly .podium-copy span {
  white-space: normal;
}

#weekly .podium-total {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 2.1rem;
}

#weekly .period-chart-card .chart-wrap {
  height: 350px;
  border-color: rgba(54, 217, 255, 0.14);
  background:
    linear-gradient(rgba(54, 217, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 217, 255, 0.045) 1px, transparent 1px),
    rgba(4, 8, 17, 0.72);
  background-size: 26px 26px;
  box-shadow: inset 0 0 45px rgba(54, 217, 255, 0.025);
}

#weekly .staff-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  padding: 15px;
  border-left: 2px solid var(--weekly-red);
}

#weekly .rank {
  border-radius: 7px;
  font-family: "Cascadia Code", Consolas, monospace;
  background: rgba(255, 23, 79, 0.13);
}

#weekly .period-archive-card .user-row {
  border-left: 2px solid rgba(54, 217, 255, 0.45);
}

@keyframes weeklyRadarSpin {
  to { transform: rotate(360deg); }
}

@keyframes weeklySignalBars {
  to { transform: scaleY(0.45); opacity: 0.45; }
}

@media (max-width: 1050px) {
  #weekly .weekly-hero {
    grid-template-columns: 1fr;
  }

  #weekly .weekly-hero-copy {
    justify-items: center;
    text-align: center;
  }

  #weekly .weekly-hero .panel-subtitle {
    border-left: 0;
    border-bottom: 2px solid var(--weekly-red);
  }
}

@media (max-width: 760px) {
  #weekly .weekly-hero {
    min-height: 0;
    padding: 20px;
  }

  #weekly .weekly-radar {
    width: min(260px, 78vw);
  }

  #weekly .weekly-command-panel {
    min-height: 0;
  }

  #weekly .podium-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  #weekly .podium-item,
  #weekly .podium-item.podium-1,
  #weekly .podium-item.podium-2 {
    min-height: 0;
    order: initial;
  }
}

@media (prefers-reduced-motion: reduce) {
  #weekly .weekly-radar::before,
  #weekly .weekly-radar::after,
  #weekly .weekly-signal-bars i {
    animation: none;
  }
}

/* Interface reliability and responsive polish */
.sidebar-backdrop {
  display: none;
}

.role-badge[style*="--role-color"] {
  color: color-mix(in srgb, var(--role-color) 74%, white);
  border-color: color-mix(in srgb, var(--role-color) 58%, transparent);
  background: color-mix(in srgb, var(--role-color) 14%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--role-color) 18%, transparent);
}

.settings-role-card > span:nth-child(2),
.settings-role-card strong,
.settings-role-card small,
.detail-line strong,
.user-row > div,
.ban-item > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-permission-switch:has(input:checked) {
  border-color: rgba(255, 23, 79, 0.38);
  background: rgba(255, 23, 79, 0.08);
}

.settings-permission-switch:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.72;
}

@media (max-width: 760px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 8;
    display: block;
    border: 0;
    border-radius: 0;
    background: rgba(1, 3, 9, 0.74);
    backdrop-filter: blur(4px);
  }

  .sidebar {
    z-index: 9;
  }

  .top-actions .btn,
  .toolbar .btn,
  .toolbar input,
  .toolbar select,
  .settings-role-editor .btn,
  .settings-permissions-panel .btn {
    width: 100%;
  }

  .settings-role-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .settings-role-card {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .settings-role-card .role-badge {
    grid-column: 2;
    justify-self: start;
  }

  .modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }
}

@media (max-width: 420px) {
  .main {
    padding-inline: 8px;
  }

  .top-actions {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 24px 20px;
  }

  .control-hero {
    min-height: 0;
  }

  .system-status-strip {
    display: grid;
  }
}
