:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top center, rgba(77, 113, 255, 0.12), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(86, 163, 255, 0.08), transparent 20%),
    linear-gradient(180deg, #14161b 0%, #101216 60%, #0f1115 100%);
  color: #f5f7fb;
}

#app {
  position: relative;
  z-index: 1;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.9), transparent 92%);
  opacity: 0.45;
  animation: gridDrift 22s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 24%, rgba(53, 109, 255, 0.22), transparent 22%),
    radial-gradient(circle at 76% 18%, rgba(35, 214, 255, 0.12), transparent 21%),
    radial-gradient(circle at 62% 82%, rgba(64, 255, 176, 0.08), transparent 24%);
  filter: blur(18px);
  mix-blend-mode: screen;
  opacity: 0.72;
  transform: translate3d(0, 0, 0);
  animation: auroraMove 16s ease-in-out infinite alternate;
}

@keyframes auroraMove {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }

  50% {
    transform: translate3d(2%, 1.5%, 0) scale(1.04);
  }

  100% {
    transform: translate3d(4%, -1%, 0) scale(1.08);
  }
}

@keyframes gridDrift {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 72px 72px, 72px 72px;
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

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

@keyframes softPulse {
  0%,
  100% {
    opacity: 0.56;
  }

  50% {
    opacity: 0.9;
  }
}

button,
a,
select,
input,
textarea {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

button:not(:disabled),
a,
select,
input,
textarea {
  will-change: transform, box-shadow;
}

button:not(:disabled):hover,
a:hover {
  transform: translateY(-1px) scale(1.028);
  box-shadow:
    0 0 0 1px rgba(112, 148, 255, 0.2),
    0 12px 34px rgba(64, 112, 255, 0.16);
}

button:not(:disabled):active,
a:active {
  transform: translateY(0) scale(0.982);
}

input:hover,
select:hover,
textarea:hover {
  box-shadow:
    0 0 0 1px rgba(113, 147, 255, 0.16),
    0 10px 30px rgba(50, 94, 232, 0.1);
}

input:focus,
select:focus,
textarea:focus {
  box-shadow:
    0 0 0 1px rgba(112, 148, 255, 0.28),
    0 0 32px rgba(61, 106, 255, 0.14);
}

.surface-panel {
  background: rgba(22, 24, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  animation: panelIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.surface-panel-soft {
  background: rgba(28, 30, 37, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.surface-panel::after,
.surface-panel-soft::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.surface-panel,
.surface-panel-soft {
  position: relative;
  border-radius: 24px;
}

.surface-panel:hover {
  border-color: rgba(120, 142, 255, 0.16);
  transform: translateY(-2px) scale(1.004);
  box-shadow:
    0 0 0 1px rgba(109, 142, 255, 0.1),
    0 18px 42px rgba(0, 0, 0, 0.28),
    0 0 46px rgba(65, 105, 255, 0.11);
}

.topbar-blur {
  backdrop-filter: blur(16px);
  background: rgba(17, 19, 24, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-banner {
  background:
    radial-gradient(circle at 20% 30%, rgba(149, 190, 255, 0.28), transparent 28%),
    radial-gradient(circle at 76% 20%, rgba(103, 128, 255, 0.28), transparent 26%),
    linear-gradient(120deg, #315fe8 0%, #406ef8 38%, #3259e4 100%);
  overflow: hidden;
}

.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.55) 0.4px, transparent 0.6px),
    radial-gradient(circle at 70% 50%, rgba(255, 255, 255, 0.45) 0.4px, transparent 0.6px);
  background-size: 18px 18px, 22px 22px;
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.2) 48%, transparent 72%);
  transform: translateX(-55%) rotate(3deg);
  animation: heroSweep 7s ease-in-out infinite;
}

@keyframes heroSweep {
  0%,
  42% {
    transform: translateX(-58%) rotate(3deg);
    opacity: 0;
  }

  58% {
    opacity: 0.48;
  }

  100% {
    transform: translateX(58%) rotate(3deg);
    opacity: 0;
  }
}

tbody tr {
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

tbody tr:hover {
  transform: translateX(2px) scale(1.002);
  box-shadow: inset 3px 0 0 rgba(92, 132, 255, 0.42);
}

.calendar-day {
  position: relative;
}

.calendar-day:nth-child(7n) {
  border-right-color: transparent;
}

.calendar-day:hover {
  z-index: 1;
  background: rgba(49, 95, 232, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(100, 134, 255, 0.18),
    0 14px 34px rgba(23, 52, 132, 0.18);
  transform: translateY(-1px) scale(1.006);
}

.calendar-day-today {
  background:
    radial-gradient(circle at 18% 78%, rgba(49, 221, 140, 0.1), transparent 34%),
    rgba(49, 95, 232, 0.05);
  box-shadow: inset 0 0 0 1px rgba(49, 111, 255, 0.24);
}

.modal-backdrop {
  animation: modalFade 180ms ease both;
}

.modal-drawer {
  animation: drawerSlide 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-drawer > div {
  animation: panelIn 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modalFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes drawerSlide {
  from {
    opacity: 0;
    transform: translateX(44px);
  }

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

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-active {
  background: rgba(49, 95, 232, 0.22);
  border-color: rgba(97, 134, 255, 0.28);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(100, 134, 255, 0.08);
}

.top-tab-active {
  color: #ffffff;
}

.top-tab-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(73, 121, 255, 0.2), #5d86ff 50%, rgba(73, 121, 255, 0.2));
}

.filter-pill-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(97, 134, 255, 0.26);
  color: #ffffff;
}

.chip-blue {
  background: rgba(74, 118, 255, 0.14);
  color: #cdd8ff;
}

.chip-green {
  background: rgba(37, 192, 133, 0.14);
  color: #b8f4dc;
}

.chip-purple {
  background: rgba(147, 109, 255, 0.14);
  color: #daccff;
}

.chip-zinc {
  background: rgba(255, 255, 255, 0.06);
  color: #d1d5de;
}

.chart-grid line {
  stroke: rgba(255, 255, 255, 0.08);
}

.chart-path {
  fill: none;
  stroke: #5c84ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: url(#usageGradient);
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
