:root {
  color-scheme: dark;
  --dash-bg: #06070b;
  --dash-panel: rgba(17, 19, 27, 0.86);
  --dash-panel-strong: rgba(11, 13, 20, 0.94);
  --dash-panel-soft: rgba(255, 255, 255, 0.03);
  --dash-stroke: rgba(255, 255, 255, 0.07);
  --dash-stroke-soft: rgba(255, 255, 255, 0.04);
  --dash-text: #f4f7fb;
  --dash-muted: #9aa3b2;
  --dash-cyan: #39d8ff;
  --dash-cyan-soft: rgba(57, 216, 255, 0.16);
  --dash-pink: #df46ff;
  --dash-pink-soft: rgba(223, 70, 255, 0.14);
  --dash-green: #34e2a2;
  --dash-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  --dash-radius-xl: 28px;
  --dash-radius-lg: 22px;
  --dash-radius-md: 16px;
}

html,
body {
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 15% 20%, rgba(57, 216, 255, 0.10), transparent 18%),
    radial-gradient(circle at 82% 12%, rgba(223, 70, 255, 0.08), transparent 20%),
    radial-gradient(circle at 76% 78%, rgba(52, 226, 162, 0.05), transparent 16%),
    linear-gradient(180deg, #05060a 0%, #080912 100%);
  color: var(--dash-text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black 48%, transparent 96%);
  opacity: 0.24;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(57, 216, 255, 0.06), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(223, 70, 255, 0.04), transparent 28%);
  z-index: 0;
}

.dashboard-shell {
  position: relative;
  z-index: 1;
  gap: 24px;
  padding: 24px;
}

.dashboard-shell > main {
  min-width: 0;
}

.glass,
.sidebar {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--dash-stroke);
  box-shadow: var(--dash-shadow);
}

.glass {
  background: linear-gradient(180deg, rgba(16, 18, 27, 0.92), rgba(11, 13, 20, 0.88));
  border-radius: var(--dash-radius-lg);
}

.sidebar {
  background: linear-gradient(180deg, rgba(16, 18, 27, 0.96), rgba(9, 10, 16, 0.88));
  border-color: rgba(255, 255, 255, 0.06) !important;
  border-radius: var(--dash-radius-xl);
  box-shadow:
    var(--dash-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

@media (min-width: 768px) {
  .dashboard-shell .sidebar {
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
}

.dashboard-shell .sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.dashboard-shell .sidebar .h-10.w-10.rounded-xl {
  background: linear-gradient(135deg, rgba(57, 216, 255, 0.22), rgba(223, 70, 255, 0.16)) !important;
  border-color: rgba(57, 216, 255, 0.18) !important;
  box-shadow: 0 0 24px rgba(57, 216, 255, 0.12);
}

.dashboard-shell .sidebar nav {
  gap: 10px;
}

.dashboard-shell .sidebar nav a,
.dashboard-shell .sidebar nav summary {
  position: relative;
  border-radius: 18px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.dashboard-shell .sidebar nav a:hover,
.dashboard-shell .sidebar nav summary:hover,
.dashboard-shell .sidebar nav details[open] > summary {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.dashboard-shell .sidebar nav a[class*="text-blue-200"] {
  background: linear-gradient(180deg, rgba(57, 216, 255, 0.14), rgba(57, 216, 255, 0.05));
  border-color: rgba(57, 216, 255, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(57, 216, 255, 0.08),
    0 0 28px rgba(57, 216, 255, 0.08);
  color: #eefcff !important;
}

.dashboard-shell .sidebar nav a[class*="text-[#E60037]"] {
  background: linear-gradient(180deg, rgba(223, 70, 255, 0.16), rgba(223, 70, 255, 0.06));
  border-color: rgba(223, 70, 255, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(223, 70, 255, 0.08),
    0 0 28px rgba(223, 70, 255, 0.08);
  color: #ffe8ff !important;
}

.dashboard-shell .sidebar nav a svg,
.dashboard-shell .sidebar nav summary svg {
  width: 18px;
  height: 18px;
  box-sizing: content-box;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #dde5f2 !important;
  flex-shrink: 0;
}

.dashboard-shell .sidebar nav summary::-webkit-details-marker {
  display: none;
}

.dashboard-shell .sidebar nav details > summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--dash-muted);
  font-size: 12px;
  transition: transform 0.22s ease;
}

.dashboard-shell .sidebar nav details[open] > summary::after {
  transform: rotate(180deg);
}

.dashboard-shell .sidebar .glass {
  background: linear-gradient(180deg, rgba(11, 13, 20, 0.90), rgba(17, 21, 32, 0.76));
  border-radius: var(--dash-radius-lg);
}

.dashboard-shell > main > .flex.flex-col.lg\:flex-row {
  padding: 18px 22px;
  border-radius: var(--dash-radius-xl);
  border: 1px solid var(--dash-stroke);
  background: linear-gradient(180deg, rgba(15, 17, 25, 0.90), rgba(11, 13, 20, 0.82));
  box-shadow: var(--dash-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.dashboard-shell .text-slate-500 {
  color: #7f8898 !important;
}

.dashboard-shell .text-slate-400 {
  color: var(--dash-muted) !important;
}

.dashboard-shell .text-slate-300 {
  color: #dbe3ef !important;
}

.dashboard-shell .text-blue-300 {
  color: #7bdfff !important;
}

.dashboard-shell h1,
.dashboard-shell h2,
.dashboard-shell h3,
.dashboard-shell h4 {
  letter-spacing: 0.01em;
}

.glow {
  position: relative;
}

.glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.grid-dots {
  background: none;
}

.card-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(57, 216, 255, 0.05);
}

.badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--dash-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.admin-theme .sidebar {
  border-right-color: rgba(223, 70, 255, 0.16);
  box-shadow:
    var(--dash-shadow),
    inset -1px 0 0 rgba(223, 70, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.admin-theme .glass {
  border-color: rgba(223, 70, 255, 0.12);
}

.dashboard-shell input:not([type="checkbox"]):not([type="radio"]),
.dashboard-shell select,
.dashboard-shell textarea {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--dash-text) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.dashboard-shell input::placeholder,
.dashboard-shell textarea::placeholder {
  color: #7f8898;
}

.dashboard-shell input:not([type="checkbox"]):not([type="radio"]):focus,
.dashboard-shell select:focus,
.dashboard-shell textarea:focus {
  outline: none;
  border-color: rgba(57, 216, 255, 0.28) !important;
  box-shadow:
    0 0 0 4px rgba(57, 216, 255, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-shell button,
.dashboard-shell a[href="/auth/logout"],
.dashboard-shell a[href="/auth/stop-impersonation"] {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    filter 0.2s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.dashboard-shell button:hover,
.dashboard-shell a[href="/auth/logout"]:hover,
.dashboard-shell a[href="/auth/stop-impersonation"]:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.dashboard-shell .bg-blue-500 {
  background: linear-gradient(135deg, rgba(57, 216, 255, 0.92), rgba(97, 111, 255, 0.92)) !important;
  border-color: rgba(57, 216, 255, 0.20) !important;
  box-shadow: 0 0 30px rgba(57, 216, 255, 0.12);
}

.dashboard-shell .bg-slate-700 {
  background: rgba(255, 255, 255, 0.06) !important;
}

.chart-bar {
  background: linear-gradient(180deg, rgba(57, 216, 255, 0.96), rgba(68, 204, 255, 0));
  box-shadow: none;
}

.chart-bar-alt {
  background: linear-gradient(180deg, rgba(223, 70, 255, 0.98), rgba(212, 73, 255, 0));
  box-shadow: none;
}

.chart-tooltip-anchor {
  position: relative;
  outline: none;
}

.chart-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 6px);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  min-width: 130px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.20);
  background: rgba(12, 16, 24, 0.96);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.36);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border-width: 6px 5px 0 5px;
  border-style: solid;
  border-color: rgba(12, 16, 24, 0.96) transparent transparent transparent;
}

.chart-tooltip-day {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.chart-tooltip-row {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: #94a3b8;
}

.chart-tooltip-anchor:hover .chart-tooltip,
.chart-tooltip-anchor:focus-within .chart-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dashboard-shell table {
  width: 100%;
}

.dashboard-shell thead {
  color: #98a5b7;
}

.dashboard-shell tbody tr {
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-shell tbody tr:hover {
  background: rgba(57, 216, 255, 0.05) !important;
}

.dashboard-shell th,
.dashboard-shell td {
  border-color: rgba(255, 255, 255, 0.04);
}

.dashboard-shell .stats-table .stats-day-row {
  background: rgba(255, 255, 255, 0.03) !important;
}

.dashboard-shell .stats-table .stats-day-row.is-alt {
  background: rgba(255, 255, 255, 0.06) !important;
}

.dashboard-shell .stats-table .stats-day-row:hover {
  background: rgba(255, 255, 255, 0.10) !important;
}

.dashboard-shell .stats-table .stats-event-row {
  background: rgba(255, 255, 255, 0.02) !important;
}

.dashboard-shell .stats-table .stats-event-row.is-alt {
  background: rgba(255, 255, 255, 0.05) !important;
}

.dashboard-shell .stats-table .stats-event-row:hover {
  background: inherit !important;
}

.dashboard-shell .stats-day-detail-cell {
}

.dashboard-shell .stats-day-detail-card {
  background: rgba(0, 0, 0, 0.20);
  padding-top: 10px;
}

.dashboard-shell .stats-day-detail-loader {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: #a9b6c8;
  text-align: center;
}

.dashboard-shell .stats-day-detail-spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(57, 216, 255, 0.92);
  border-right-color: rgba(57, 216, 255, 0.38);
  animation: stats-spin 0.8s linear infinite;
}

@keyframes stats-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.dashboard-shell .stats-filter-tabs {
    display: block;
    align-items: center;
    margin: 0px auto;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.dashboard-shell .stats-filter-tab {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  line-height: 1;
  color: #cdd7e5;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.dashboard-shell .stats-filter-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: none;
  filter: none;
}

.dashboard-shell .stats-filter-tab.is-active {
  background: linear-gradient(180deg, rgba(57, 216, 255, 0.18), rgba(57, 216, 255, 0.08));
  color: #ffffff;
  border: 1px solid rgba(57, 216, 255, 0.14);
}

.pulse-dot {
  box-shadow: 0 0 0 0 rgba(52, 226, 162, 0.52);
  animation: pulse 2.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 226, 162, 0.62); }
  70% { box-shadow: 0 0 0 12px rgba(52, 226, 162, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 226, 162, 0); }
}

.fade-in {
  animation: fadeIn 0.8s ease-out both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.dashboard-shell.soft-border-theme .glow::after {
  border-color: rgba(255, 255, 255, 0.04) !important;
}

.dashboard-shell.soft-border-theme .glass,
.dashboard-shell.soft-border-theme .badge,
.dashboard-shell.soft-border-theme .sidebar,
.dashboard-shell.soft-border-theme table,
.dashboard-shell.soft-border-theme th,
.dashboard-shell.soft-border-theme td,
.dashboard-shell.soft-border-theme input,
.dashboard-shell.soft-border-theme select,
.dashboard-shell.soft-border-theme textarea,
.dashboard-shell.soft-border-theme button,
.dashboard-shell.soft-border-theme [class~="border"],
.dashboard-shell.soft-border-theme [class*="border-"] {
  border-color: rgba(255, 255, 255, 0.04) !important;
}

@media (max-width: 1200px) {
  .dashboard-shell {
    gap: 18px;
    padding: 18px;
  }

  .dashboard-shell .sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 760px) {
  .dashboard-shell {
    padding: 14px;
    gap: 14px;
  }

  .glass,
  .sidebar,
  .dashboard-shell > main > .flex.flex-col.lg\:flex-row {
    border-radius: 22px;
  }
}
