:root {
  --color-white: #ffffff;
  --color-black: #000000;

  --color-primary: #22c55e;
  --color-primary-dark: #16a34a;
  --color-primary-light: #86efac;
  --color-primary-bright: #4ade80;
  --color-primary-border: #15803d;

  --color-aqua: #06b6d4;
  --color-aqua-dark: #0e7490;
  --color-aqua-light: #67e8f9;

  --color-sky: #7dd3fc;
  --color-sky-light: #bae6fd;

  --color-white-glass: rgba(255, 255, 255, 0.75);
  --color-surface: rgba(255, 255, 255, 0.85);
  --color-border-glass: rgba(255, 255, 255, 0.8);

  --color-text: #1e293b;
  --color-text-secondary: #64748b;

  --color-bg-start: #e0f2fe;
  --color-bg-mid: #dcfce7;

  --color-error: #ef4444;
  --color-error-dark: #dc2626;
  --color-error-border: #b91c1c;

  --color-success: #22c55e;
  --color-success-text: #166534;

  --color-warning: #f59e0b;
  --color-warning-text: #92400e;
  --color-warning-border: #fde68a;

  --color-brown-dark: #78350f;
  --color-danger-text: #991b1b;
  --color-danger-light: #fca5a5;
  --color-danger-pale: #fecaca;
  --color-info-text: #1e40af;
  --color-info-border: #93c5fd;

  --color-orange: #fb923c;
  --color-orange-deep: #ea580c;
  --color-orange-dark: #c2410c;
  --color-yellow: #fcd34d;

  --color-purple: #a78bfa;
  --color-purple-light: #c4b5fd;
  --color-purple-dark: #6d28d9;

  --color-gray-400: #9ca3af;
  --color-star: #fbbf24;

  --color-white-a10: rgba(255, 255, 255, 0.1);
  --color-white-a30: rgba(255, 255, 255, 0.3);
  --color-white-a40: rgba(255, 255, 255, 0.4);
  --color-white-a50: rgba(255, 255, 255, 0.5);
  --color-white-a60: rgba(255, 255, 255, 0.6);
  --color-white-a70: rgba(255, 255, 255, 0.7);
  --color-white-a72: rgba(255, 255, 255, 0.72);
  --color-white-a80: rgba(255, 255, 255, 0.8);
  --color-white-a82: rgba(255, 255, 255, 0.82);
  --color-white-a86: rgba(255, 255, 255, 0.86);
  --color-white-a90: rgba(255, 255, 255, 0.9);
  --color-white-a96: rgba(255, 255, 255, 0.96);

  --color-black-a04: rgba(0, 0, 0, 0.04);
  --color-black-a05: rgba(0, 0, 0, 0.05);
  --color-black-a06: rgba(0, 0, 0, 0.06);
  --color-black-a08: rgba(0, 0, 0, 0.08);
  --color-black-a12: rgba(0, 0, 0, 0.12);
  --color-black-a15: rgba(0, 0, 0, 0.15);
  --color-black-a20: rgba(0, 0, 0, 0.2);
  --color-black-a35: rgba(0, 0, 0, 0.35);

  --color-slate-900-a08: rgba(15, 23, 42, 0.08);
  --color-slate-900-a14: rgba(15, 23, 42, 0.14);
  --color-slate-500-a10: rgba(100, 116, 139, 0.1);
  --color-slate-500-a20: rgba(100, 116, 139, 0.2);

  --color-primary-a05: rgba(34, 197, 94, 0.05);
  --color-primary-a08: rgba(34, 197, 94, 0.08);
  --color-primary-a10: rgba(34, 197, 94, 0.1);
  --color-primary-a12: rgba(34, 197, 94, 0.12);
  --color-primary-a15: rgba(34, 197, 94, 0.15);
  --color-primary-a18: rgba(34, 197, 94, 0.18);
  --color-primary-a20: rgba(34, 197, 94, 0.2);
  --color-primary-a25: rgba(34, 197, 94, 0.25);
  --color-primary-a30: rgba(34, 197, 94, 0.3);
  --color-primary-a40: rgba(34, 197, 94, 0.4);
  --color-primary-a45: rgba(34, 197, 94, 0.45);
  --color-primary-a50: rgba(34, 197, 94, 0.5);
  --color-primary-light-a12: rgba(134, 239, 172, 0.12);

  --color-error-a10: rgba(239, 68, 68, 0.1);
  --color-error-a12: rgba(239, 68, 68, 0.12);
  --color-error-a20: rgba(239, 68, 68, 0.2);
  --color-error-a24: rgba(239, 68, 68, 0.24);
  --color-error-a30: rgba(239, 68, 68, 0.3);
  --color-error-a40: rgba(239, 68, 68, 0.4);

  --color-aqua-a15: rgba(6, 182, 212, 0.15);
  --color-aqua-a25: rgba(6, 182, 212, 0.25);
  --color-aqua-a30: rgba(6, 182, 212, 0.3);
  --color-aqua-a40: rgba(6, 182, 212, 0.4);
  --color-orange-a15: rgba(251, 146, 60, 0.15);
  --color-orange-a30: rgba(251, 146, 60, 0.3);
  --color-purple-a12: rgba(139, 92, 246, 0.12);
  --color-purple-a20: rgba(139, 92, 246, 0.2);
  --color-star-a15: rgba(251, 191, 36, 0.15);
  --color-star-a20: rgba(251, 191, 36, 0.2);
  --color-star-a30: rgba(251, 191, 36, 0.3);
  --color-warning-a15: rgba(245, 158, 11, 0.15);
  --color-warning-a25: rgba(245, 158, 11, 0.25);
  --color-warning-a40: rgba(245, 158, 11, 0.4);

  --color-success-bg-a90: rgba(220, 252, 231, 0.9);
  --color-success-bg-a95: rgba(220, 252, 231, 0.95);
  --color-info-bg-a90: rgba(224, 242, 254, 0.9);
  --color-info-bg-a95: rgba(224, 242, 254, 0.95);
  --color-danger-bg-a68: rgba(254, 242, 242, 0.68);
  --color-danger-bg-a90: rgba(254, 226, 226, 0.9);
  --color-danger-bg-a95: rgba(254, 226, 226, 0.95);
  --color-warning-bg-a90: rgba(254, 243, 199, 0.9);

  --gradient-bg: linear-gradient(
    135deg,
    var(--color-bg-start) 0%,
    var(--color-bg-mid) 50%,
    var(--color-bg-start) 100%
  );
  --gradient-brand: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-aqua) 60%,
    var(--color-sky) 100%
  );
  --gradient-progress-success: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-primary-light)
  );
  --gradient-progress-neutral: linear-gradient(90deg, var(--color-sky), var(--color-sky-light));
  --gradient-progress-danger: linear-gradient(
    90deg,
    var(--color-danger-light),
    var(--color-danger-pale)
  );
  --gradient-bar-success-vertical: linear-gradient(
    180deg,
    var(--color-primary),
    var(--color-primary-light)
  );
  --gradient-bar-neutral-vertical: linear-gradient(
    180deg,
    var(--color-sky),
    var(--color-sky-light)
  );
  --gradient-nav-active: linear-gradient(
    135deg,
    var(--color-primary-a18),
    var(--color-primary-light-a12)
  );
  --gradient-stats-green: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  --gradient-stats-aqua: linear-gradient(90deg, var(--color-aqua), var(--color-aqua-light));
  --gradient-stats-orange: linear-gradient(90deg, var(--color-orange), var(--color-yellow));
  --gradient-stats-purple: linear-gradient(90deg, var(--color-purple), var(--color-purple-light));
  --gradient-coin-chip: linear-gradient(
    135deg,
    var(--color-primary-a25) 0%,
    var(--color-aqua-a25) 100%
  );
  --gradient-coin-chip-hover: linear-gradient(
    135deg,
    var(--color-primary-a40) 0%,
    var(--color-aqua-a40) 100%
  );
  --color-coin-chip-border: var(--color-primary-a45);
  --color-coin-chip-text: var(--color-primary-border);
  --color-coin-chip-label: var(--color-primary-border);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-glass: 0 8px 32px var(--color-black-a08), inset 0 1px 0 var(--color-white-a90);
  --shadow-card: 0 4px 16px var(--color-black-a06);
  --sidebar-width: 240px;
  --topbar-height: 60px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--gradient-bg);
  background-attachment: fixed;
  min-height: 100vh;
}

a {
  color: var(--color-primary-dark);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input,
textarea,
select {
  font-family: inherit;
  outline: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-black-a04);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary-a30);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-a50);
}

/* Glass panel utility */
.glass-panel {
  background: var(--color-white-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
}

/* Primary button */
.btn-primary {
  background: var(--color-primary-a18);
  border: 1px solid var(--color-primary-a40);
  border-radius: var(--radius-sm);
  color: var(--color-primary-border);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 8px var(--color-primary-a08);
  backdrop-filter: blur(8px);
}
.btn-primary:hover {
  background: var(--color-primary-a25);
  border-color: var(--color-primary-a50);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px var(--color-primary-a15);
}
.btn-primary:focus-visible {
  box-shadow:
    0 0 0 3px var(--color-primary-a20),
    0 2px 8px var(--color-primary-a08);
}
.btn-primary:active {
  background: var(--color-primary-a30);
  transform: translateY(0);
  box-shadow: 0 1px 4px var(--color-primary-a12);
}
.btn-primary:disabled {
  background: var(--color-slate-500-a10);
  border-color: var(--color-slate-500-a20);
  color: var(--color-text-secondary);
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Secondary button */
.btn-secondary {
  background: var(--color-white-a70);
  border: 1px solid var(--color-primary-a40);
  border-radius: var(--radius-sm);
  color: var(--color-primary-dark);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: var(--color-primary-a10);
  border-color: var(--color-primary);
}

/* Danger button */
.btn-danger {
  background: var(--color-danger-bg-a90);
  border: 1px solid var(--color-danger-light);
  border-radius: var(--radius-sm);
  color: var(--color-danger-text);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 8px var(--color-error-a10);
  backdrop-filter: blur(8px);
}
.btn-danger:hover {
  background: var(--color-danger-bg-a95);
  border-color: var(--color-error-a30);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px var(--color-error-a12);
}
.btn-danger:focus-visible {
  box-shadow:
    0 0 0 3px var(--color-error-a20),
    0 2px 8px var(--color-error-a10);
}
.btn-danger:active {
  background: var(--color-danger-pale);
  transform: translateY(0);
  box-shadow: 0 1px 4px var(--color-error-a12);
}
.btn-danger:disabled {
  background: var(--color-slate-500-a10);
  border-color: var(--color-slate-500-a20);
  color: var(--color-text-secondary);
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  padding: 8px 14px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost:hover {
  background: var(--color-black-a05);
  color: var(--color-text);
}

/* Glass input */
.glass-input {
  background: var(--color-white-a60);
  border: 1px solid var(--color-border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--color-text);
  width: 100%;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.glass-input:focus {
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-a15);
}
.glass-input::placeholder {
  color: var(--color-text-secondary);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green {
  color: var(--color-primary-border);
  border: 1.3px solid var(--color-primary-a30);
}
.badge-blue {
  background: var(--color-aqua-a15);
  color: var(--color-aqua-dark);
  border: 1px solid var(--color-aqua-a30);
}
.badge-orange {
  background: var(--color-orange-a15);
  color: var(--color-orange-dark);
  border: 1px solid var(--color-orange-a30);
}
.badge-gray {
  background: var(--color-slate-500-a10);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-slate-500-a20);
}
.badge-red {
  background: var(--color-error-a12);
  color: var(--color-error-border);
  border: 1px solid var(--color-error-a20);
}
.badge-purple {
  background: var(--color-purple-a12);
  color: var(--color-purple-dark);
  border: 1px solid var(--color-purple-a20);
}

/* Tag chip */
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--color-primary-a10);
  border: 1px solid var(--color-primary-a25);
  border-radius: 20px;
  font-size: 12px;
  color: var(--color-primary-dark);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.tag-chip:hover,
.tag-chip.active {
  background: var(--color-primary-a20);
  border-color: var(--color-primary);
}

/* Page layout helpers */
.page-content {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 20px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 14px;
}

/* Grid helpers */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .page-content {
    padding: 16px;
  }
}

/* Flex helpers */
.flex {
  display: flex;
}
.flex-col {
  display: flex;
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.gap-4 {
  gap: 16px;
}

/* Text helpers */
.text-sm {
  font-size: 12px;
}
.text-secondary {
  color: var(--color-text-secondary);
}
.font-bold {
  font-weight: 700;
}
.font-semibold {
  font-weight: 600;
}

/* Stars rating */
.stars {
  color: var(--color-star);
  font-size: 14px;
  letter-spacing: 1px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-white-a30);
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.spinner-green {
  border-color: var(--color-primary-a20);
  border-top-color: var(--color-primary);
}

#app {
  min-height: 100vh;
}
