:root {
  --bg-0: #070b16;
  --bg-1: #0b1220;
  --bg-2: #101c2f;
  --text-main: #e6edf9;
  --text-muted: #9fb0cc;
  --card-bg: rgba(11, 18, 32, 0.72);
  --card-border: rgba(159, 176, 204, 0.18);
  --shadow-soft: 0 24px 48px rgba(2, 8, 23, 0.35);
  --accent: #56d4ff;
  --accent-2: #6ee7b7;
  --danger: #fb7185;
  --warning: #fbbf24;
}

:root[data-theme='light'] {
  --bg-0: #e6edf8;
  --bg-1: #f5f8ff;
  --bg-2: #d9e5fb;
  --text-main: #0f1b31;
  --text-muted: #526382;
  --card-bg: rgba(255, 255, 255, 0.84);
  --card-border: rgba(17, 24, 39, 0.12);
  --shadow-soft: 0 20px 46px rgba(31, 41, 55, 0.16);
  --accent: #0284c7;
  --accent-2: #059669;
  --danger: #e11d48;
  --warning: #d97706;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 10%, rgba(86, 212, 255, 0.14), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(110, 231, 183, 0.1), transparent 28%),
    linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 54%, var(--bg-2) 100%);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 95%);
}

.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.badge-soft {
  border: 1px solid rgba(86, 212, 255, 0.35);
  background: rgba(86, 212, 255, 0.14);
  color: var(--text-main);
}

.kpi-card {
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(86, 212, 255, 0.12), transparent 52%, rgba(110, 231, 183, 0.08));
  pointer-events: none;
}

.kpi-value {
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--text-muted);
}

.chart-canvas {
  min-height: 300px;
}

.empty-state {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed var(--card-border);
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.05);
  color: var(--text-muted);
  padding: 1.5rem;
}

.table-premium {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.table-premium th,
.table-premium td {
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.table-premium th {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.table-premium td {
  font-size: 0.92rem;
}

.btn-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0.7rem 1.05rem;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 160ms ease, box-shadow 200ms ease, background-color 200ms ease;
}

.btn-base:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.btn-base:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.94), rgba(2, 132, 199, 0.94));
  color: #f8fbff;
  box-shadow: 0 14px 22px rgba(2, 132, 199, 0.24);
}

.btn-secondary {
  border-color: var(--card-border);
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-main);
}

.btn-danger {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.14);
  color: #ffe4eb;
}

.notice-error {
  border: 1px solid rgba(251, 113, 133, 0.34);
  background: rgba(159, 18, 57, 0.16);
  color: #ffe4eb;
}

.notice-warning {
  border: 1px solid rgba(251, 191, 36, 0.36);
  background: rgba(146, 64, 14, 0.16);
  color: #fde68a;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

.spinner.dark {
  border: 2px solid rgba(2, 6, 23, 0.26);
  border-top-color: rgba(2, 6, 23, 0.9);
}

.hidden {
  display: none !important;
}

.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: rgba(148, 163, 184, 0.24);
  border-radius: 0.45rem;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  animation: shimmer 1.3s infinite;
}

.fade-in {
  animation: fadeIn 350ms ease;
}

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

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

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 768px) {
  .chart-canvas {
    min-height: 260px;
  }

  .empty-state {
    min-height: 220px;
  }
}
