/* =========================================================
   ClubCash Theme v6
   Shared visual system for Admin and Affiliate Dashboard
   ========================================================= */

:root {
  --accent: #12b981;
  --accent-strong: #0f9f74;
  --accent-light: #5ce3ad;
  --accent-soft: rgba(18, 185, 129, 0.14);
  --accent-soft-strong: rgba(18, 185, 129, 0.24);

  --bg-base: #eef3f8;
  --bg-muted: #e4ebf3;
  --bg-subtle: #d3deea;
  --surface: #ffffff;
  --surface-card: #ffffff;
  --surface-elevated: #fbfdff;
  --surface-glass: rgba(255, 255, 255, 0.82);

  --sidebar-bg: #fbfdff;
  --sidebar-bg-alt: #f1f6fc;
  --sidebar-border: #d4e0ec;
  --sidebar-text: #58708c;
  --sidebar-text-active: #0d1b2f;

  --border: #cfdbe8;
  --border-soft: #dee7f1;
  --border-strong: #b7c7d8;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --util-gray-50: #f1f6fb;
  --util-gray-100: #e6eef6;
  --util-gray-200: #d4e0eb;
  --util-gray-300: #b8c8d8;

  --emerald-bg: rgba(16, 185, 129, 0.14);
  --emerald-text: #057857;
  --emerald-border: rgba(16, 185, 129, 0.30);

  --blue-bg: rgba(59, 130, 246, 0.13);
  --blue-text: #1d4ed8;
  --blue-border: rgba(59, 130, 246, 0.30);

  --amber-bg: rgba(245, 158, 11, 0.16);
  --amber-text: #b45309;
  --amber-border: rgba(245, 158, 11, 0.32);

  --red-bg: rgba(239, 68, 68, 0.14);
  --red-text: #b91c1c;
  --red-border: rgba(239, 68, 68, 0.30);

  --purple-bg: rgba(139, 92, 246, 0.14);
  --purple-text: #6d28d9;
  --purple-border: rgba(139, 92, 246, 0.30);

  --orange-bg: rgba(249, 115, 22, 0.15);
  --orange-text: #c2410c;
  --orange-border: rgba(249, 115, 22, 0.30);

  --chart-grid: rgba(30, 41, 59, 0.10);
  --chart-axis: #5b6f84;
  --chart-tooltip: #0f172a;

  --bg-orb-a: rgba(18, 185, 129, 0.12);
  --bg-orb-b: rgba(30, 64, 175, 0.08);
  --grid-color: rgba(15, 23, 42, 0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-card: 18px;
  --radius-btn: 11px;
  --radius-input: 11px;
  --radius-chip: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 5px 16px rgba(15, 23, 42, 0.07), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.10), 0 4px 10px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 18px 52px rgba(15, 23, 42, 0.14), 0 8px 18px rgba(15, 23, 42, 0.07);
  --shadow-xl: 0 30px 80px rgba(15, 23, 42, 0.22);
  --shadow-card: var(--shadow-sm);
  --shadow-hover: var(--shadow-md);
  --shadow-btn: 0 8px 20px rgba(18, 185, 129, 0.30);
  --shadow-btn-hover: 0 14px 28px rgba(18, 185, 129, 0.34);
  --shadow-login: var(--shadow-xl);

  --transition-fast: 0.14s ease;
  --transition-base: 0.22s ease;
  --transition-slow: 0.34s ease;
}

:root[data-theme='dark'] {
  --accent: #39d99b;
  --accent-strong: #1ebf84;
  --accent-light: #7af0c1;
  --accent-soft: rgba(57, 217, 155, 0.16);
  --accent-soft-strong: rgba(57, 217, 155, 0.28);

  --bg-base: #060d1c;
  --bg-muted: #0e1a32;
  --bg-subtle: #172847;
  --surface: #0f1d36;
  --surface-card: #122340;
  --surface-elevated: #1a2f52;
  --surface-glass: rgba(8, 18, 36, 0.80);

  --sidebar-bg: #08162e;
  --sidebar-bg-alt: #0d1f3c;
  --sidebar-border: #20365b;
  --sidebar-text: #8da4c2;
  --sidebar-text-active: #e2ecf8;

  --border: #223a5f;
  --border-soft: #1a2f4d;
  --border-strong: #33507d;

  --text-primary: #e8f0fc;
  --text-secondary: #c3d2e6;
  --text-muted: #97abc6;
  --text-subtle: #728aa7;

  --util-gray-50: #121f39;
  --util-gray-100: #1a2b4a;
  --util-gray-200: #24395d;
  --util-gray-300: #395684;

  --emerald-bg: rgba(57, 217, 155, 0.20);
  --emerald-text: #78f0c0;
  --emerald-border: rgba(57, 217, 155, 0.36);

  --blue-bg: rgba(96, 165, 250, 0.22);
  --blue-text: #93c5fd;
  --blue-border: rgba(96, 165, 250, 0.34);

  --amber-bg: rgba(251, 191, 36, 0.22);
  --amber-text: #fcd34d;
  --amber-border: rgba(251, 191, 36, 0.34);

  --red-bg: rgba(248, 113, 113, 0.22);
  --red-text: #fca5a5;
  --red-border: rgba(248, 113, 113, 0.36);

  --purple-bg: rgba(167, 139, 250, 0.24);
  --purple-text: #c4b5fd;
  --purple-border: rgba(167, 139, 250, 0.34);

  --orange-bg: rgba(251, 146, 60, 0.23);
  --orange-text: #fdba74;
  --orange-border: rgba(251, 146, 60, 0.36);

  --chart-grid: rgba(148, 163, 184, 0.16);
  --chart-axis: #9bb0cc;
  --chart-tooltip: #0b1730;

  --bg-orb-a: rgba(57, 217, 155, 0.18);
  --bg-orb-b: rgba(96, 165, 250, 0.12);
  --grid-color: rgba(148, 163, 184, 0.07);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.34), 0 2px 6px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.42), 0 4px 12px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 20px 58px rgba(0, 0, 0, 0.50), 0 8px 20px rgba(0, 0, 0, 0.36);
  --shadow-xl: 0 34px 90px rgba(0, 0, 0, 0.62);
  --shadow-btn: 0 8px 22px rgba(57, 217, 155, 0.22);
  --shadow-btn-hover: 0 14px 30px rgba(57, 217, 155, 0.28);
}

html,
body {
  min-height: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
}

h1,
h2,
h3,
h4,
.font-display,
.font-extrabold,
.font-bold {
  font-family: 'Sora', 'Manrope', system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg-base);
  color: var(--text-primary);
  position: relative;
  isolation: isolate;
  transition: background var(--transition-slow), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: -25%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 10%, var(--bg-orb-a) 0%, rgba(0, 0, 0, 0) 44%),
    radial-gradient(circle at 88% 18%, var(--bg-orb-b) 0%, rgba(0, 0, 0, 0) 40%),
    radial-gradient(circle at 44% 92%, var(--bg-orb-a) 0%, rgba(0, 0, 0, 0) 38%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.8;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 42px 42px;
}

html {
  background: var(--bg-base) !important;
}

#view-app,
#view-login,
#app-shell,
#app-body,
main,
#page-content,
.lg\:ml-\[260px\] {
  background: transparent !important;
}

a {
  color: inherit;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.48rem 0.9rem;
  border-radius: var(--radius-chip);
  border: 1px solid var(--border);
  background: var(--surface-glass);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: all var(--transition-base);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: translateY(0);
}

#sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-alt)) !important;
  border-right: 1px solid var(--sidebar-border) !important;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

#mobile-header {
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-alt)) !important;
  border-bottom: 1px solid var(--sidebar-border) !important;
  box-shadow: var(--shadow-sm);
}

#sidebar-overlay {
  background: rgba(4, 11, 24, 0.58) !important;
  backdrop-filter: blur(3px);
}

.sidebar-icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid var(--sidebar-border);
  background: var(--bg-muted);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.sidebar-icon-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.sidebar-icon-logout:hover,
#logout-btn:hover,
#sidebar-logout:hover {
  background: var(--red-bg) !important;
  border-color: var(--red-border) !important;
  color: var(--red-text) !important;
}

.nav-item,
.nav-link {
  color: var(--sidebar-text) !important;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item:hover,
.nav-link:hover {
  color: var(--sidebar-text-active) !important;
  background: rgba(148, 163, 184, 0.10) !important;
}

.nav-item.active,
.nav-link.active,
.nav-link.text-white {
  color: var(--accent-light) !important;
  background: linear-gradient(90deg, rgba(18, 185, 129, 0.16), rgba(18, 185, 129, 0.06)) !important;
  border-color: rgba(18, 185, 129, 0.26);
}

.nav-item.active::before,
.nav-link.active::before,
.nav-link.text-white::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.nav-link.text-gray-400 {
  color: var(--sidebar-text) !important;
}

header {
  background: var(--surface-glass) !important;
  border-bottom: 1px solid var(--border) !important;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.72rem;
}

#menu-toggle:hover {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}

.gradient-hero {
  border: 1px solid rgba(69, 231, 168, 0.20) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(122, 240, 193, 0.18), transparent 45%),
    radial-gradient(circle at 90% 40%, rgba(88, 99, 255, 0.14), transparent 48%),
    linear-gradient(140deg, #0a4f42 0%, #0f7058 54%, #0f7f65 100%) !important;
  box-shadow: var(--shadow-lg);
}

:root[data-theme='dark'] .gradient-hero {
  border-color: rgba(122, 240, 193, 0.26) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(122, 240, 193, 0.24), transparent 46%),
    radial-gradient(circle at 90% 40%, rgba(96, 165, 250, 0.20), transparent 48%),
    linear-gradient(140deg, #06362e 0%, #0a4d42 54%, #0f6752 100%) !important;
}

.dashboard-card,
.stat-card,
.card,
.bg-white.rounded-2xl,
.bg-white.rounded-xl,
.bg-white.rounded-lg {
  background: var(--surface-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), border-color var(--transition-base), transform var(--transition-fast);
}

.gradient-hero.dashboard-card {
  border: 1px solid rgba(69, 231, 168, 0.20) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(122, 240, 193, 0.18), transparent 45%),
    radial-gradient(circle at 90% 40%, rgba(88, 99, 255, 0.14), transparent 48%),
    linear-gradient(140deg, #0a4f42 0%, #0f7058 54%, #0f7f65 100%) !important;
  box-shadow: var(--shadow-lg) !important;
}

:root[data-theme='dark'] .gradient-hero.dashboard-card {
  border-color: rgba(122, 240, 193, 0.26) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(122, 240, 193, 0.24), transparent 46%),
    radial-gradient(circle at 90% 40%, rgba(96, 165, 250, 0.20), transparent 48%),
    linear-gradient(140deg, #06362e 0%, #0a4d42 54%, #0f6752 100%) !important;
}

.dashboard-card:hover,
.stat-card:hover,
.card:hover,
.bg-white.rounded-2xl:hover,
.bg-white.rounded-xl:hover,
.bg-white.rounded-lg:hover {
  border-color: var(--border-strong) !important;
  box-shadow: var(--shadow-hover);
}

.stat-card {
  padding: 1.2rem !important;
}

.stat-card-accent {
  border-top: 3px solid var(--accent) !important;
}

.stat-card-blue {
  border-top: 3px solid #3b82f6 !important;
}

.stat-card-emerald {
  border-top: 3px solid #10b981 !important;
}

.stat-card-amber {
  border-top: 3px solid #f59e0b !important;
}

.stat-card-red {
  border-top: 3px solid #ef4444 !important;
}

.quick-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-base), filter var(--transition-base);
}

.card:hover .quick-icon {
  transform: translateY(-2px) scale(1.06);
  filter: saturate(1.12);
}

.points-display {
  font-family: 'Sora', 'Manrope', sans-serif;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  animation: points-pulse 4s ease-in-out infinite;
}

.progress-bar-fill {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(224, 242, 254, 0.72));
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.28);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item {
  display: flex;
  gap: 0.95rem;
  padding: 0.86rem 0;
  position: relative;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 16px;
  top: 46px;
  bottom: 0;
  width: 1.5px;
  opacity: 0.35;
  background: linear-gradient(180deg, var(--accent), transparent);
}

.timeline-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 0.85rem;
}

.timeline-dot-green {
  background: var(--emerald-bg);
}

.timeline-dot-amber {
  background: var(--amber-bg);
}

.timeline-dot-blue {
  background: var(--blue-bg);
}

.timeline-dot-purple {
  background: var(--purple-bg);
}

.step-number {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 7px 16px rgba(16, 185, 129, 0.28);
}

.step-connector {
  display: none;
  height: 1.5px;
  flex: 1;
  margin: 20px 0.5rem 0;
  opacity: 0.4;
  background: linear-gradient(90deg, var(--accent), transparent);
}

@media (min-width: 640px) {
  .step-connector {
    display: block;
  }
}

.login-input,
.search-bar-input,
input,
select,
textarea {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-input);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.login-input {
  width: 100%;
  padding: 0.84rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.search-bar-wrap {
  position: relative;
}

.search-icon,
.search-bar-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.search-bar-input {
  width: 100%;
  padding: 0.68rem 0.95rem 0.68rem 2.65rem;
  font-size: 0.86rem;
  font-weight: 500;
}

input::placeholder,
textarea::placeholder,
.search-bar-input::placeholder,
.login-input::placeholder {
  color: var(--text-subtle);
}

.login-input:hover,
.search-bar-input:hover,
input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong) !important;
}

.login-input:focus,
.search-bar-input:focus,
input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px var(--accent-soft) !important;
}

button {
  transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-fast);
}

button:hover {
  filter: saturate(1.05);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  background: var(--bg-muted) !important;
  color: var(--text-muted) !important;
  font-size: 0.69rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  padding: 0.8rem 1rem !important;
  border-bottom: 1px solid var(--border) !important;
}

tbody td {
  color: var(--text-primary) !important;
  font-size: 0.875rem !important;
  border-bottom: 1px solid var(--border-soft) !important;
  padding: 0.82rem 1rem !important;
}

tbody tr:hover td {
  background-color: var(--util-gray-50) !important;
}

tbody tr:nth-child(even) td {
  background-color: rgba(148, 163, 184, 0.04);
}

:root[data-theme='dark'] tbody tr:nth-child(even) td {
  background-color: rgba(148, 163, 184, 0.06);
}

.copy-link-btn {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.copy-link-btn:hover {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.impersonate-bar {
  background: linear-gradient(90deg, #065f46, #10b981);
  box-shadow: var(--shadow-md);
}

.app-confirm-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 360;
}

.app-confirm-modal.hidden {
  display: none;
}

.app-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 26, 0.66);
  backdrop-filter: blur(4px);
}

.app-confirm-dialog {
  position: relative;
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 1.25rem;
}

.app-confirm-title {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.app-confirm-message {
  margin: 0.35rem 0 1.1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
}

.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.app-confirm-btn {
  border-radius: var(--radius-btn);
  padding: 0.52rem 0.92rem;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.82rem;
}

.app-confirm-btn-cancel {
  background: var(--bg-muted);
  border-color: var(--border);
  color: var(--text-secondary);
}

.app-confirm-btn-confirm {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
}

.toast {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 380;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 360px;
  padding: 0.82rem 1rem;
  border-radius: 12px;
  color: #ffffff;
  box-shadow: var(--shadow-lg);
  animation: toast-enter 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast-success {
  background: linear-gradient(120deg, #047857, #0ea271);
}

.toast-info {
  background: linear-gradient(120deg, #1d4ed8, #2563eb);
}

.toast-error {
  background: linear-gradient(120deg, #b91c1c, #dc2626);
}

#toast > div {
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px);
}

.bg-emerald-500 {
  background: linear-gradient(120deg, #047857, #0ea271) !important;
}

.bg-blue-500 {
  background: linear-gradient(120deg, #1d4ed8, #2563eb) !important;
}

.bg-red-500 {
  background: linear-gradient(120deg, #b91c1c, #dc2626) !important;
}

.spinner {
  width: 2rem;
  height: 2rem;
  margin: 1.8rem auto;
  border-radius: 999px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.fade-in,
.page-content {
  animation: fade-up 0.35s ease;
}

code,
pre {
  color: var(--text-primary);
}

pre {
  border: 1px solid var(--border);
}

/* Tailwind utility bridge: neutral */
.bg-white {
  background-color: var(--surface-card) !important;
}

.bg-gray-50 {
  background-color: var(--util-gray-50) !important;
}

.bg-gray-100 {
  background-color: var(--util-gray-100) !important;
}

.bg-gray-200 {
  background-color: var(--util-gray-200) !important;
}

.bg-gray-300 {
  background-color: var(--util-gray-300) !important;
}

.text-gray-900,
.text-gray-800 {
  color: var(--text-primary) !important;
}

.text-gray-700,
.text-gray-600 {
  color: var(--text-secondary) !important;
}

.text-gray-500,
.text-gray-400 {
  color: var(--text-muted) !important;
}

.text-gray-300 {
  color: var(--text-subtle) !important;
}

.text-slate-700 {
  color: var(--text-secondary) !important;
}

.text-slate-400 {
  color: var(--text-muted) !important;
}

.border-gray-50,
.border-gray-100,
.border-gray-200 {
  border-color: var(--border) !important;
}

.divide-gray-50 > :not([hidden]) ~ :not([hidden]),
.divide-gray-100 > :not([hidden]) ~ :not([hidden]),
.divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--border) !important;
}

.hover\:bg-gray-50:hover,
.hover\:bg-gray-50\/50:hover {
  background-color: var(--util-gray-50) !important;
}

/* Tailwind utility bridge: brand */
.bg-brand-50 {
  background-color: var(--accent-soft) !important;
}

.bg-brand-100 {
  background-color: var(--accent-soft-strong) !important;
}

.bg-brand-500 {
  background-color: var(--accent) !important;
}

.text-brand-500,
.text-brand-600,
.text-brand-700,
.text-brand-800 {
  color: var(--accent) !important;
}

.border-brand-100 {
  border-color: rgba(18, 185, 129, 0.28) !important;
}

.border-brand-400 {
  border-color: var(--accent) !important;
}

.hover\:bg-brand-100:hover {
  background-color: var(--accent-soft-strong) !important;
}

.hover\:text-brand-800:hover {
  color: var(--accent-light) !important;
}

/* Tailwind utility bridge: semantic tones */
.bg-emerald-50,
.bg-green-50 {
  background-color: var(--emerald-bg) !important;
}

.text-emerald-600,
.text-emerald-700,
.text-green-700 {
  color: var(--emerald-text) !important;
}

.border-emerald-100,
.border-green-100 {
  border-color: var(--emerald-border) !important;
}

.hover\:bg-emerald-100:hover,
.hover\:bg-green-100:hover {
  background-color: rgba(16, 185, 129, 0.24) !important;
}

.bg-blue-50 {
  background-color: var(--blue-bg) !important;
}

.text-blue-600,
.text-blue-700 {
  color: var(--blue-text) !important;
}

.border-blue-100,
.border-blue-200 {
  border-color: var(--blue-border) !important;
}

.bg-blue-400,
.bg-blue-500 {
  background-color: #3b82f6 !important;
}

:root[data-theme='dark'] .bg-blue-400,
:root[data-theme='dark'] .bg-blue-500 {
  background-color: #60a5fa !important;
}

.hover\:bg-blue-100:hover {
  background-color: rgba(59, 130, 246, 0.23) !important;
}

.bg-amber-50,
.bg-yellow-50 {
  background-color: var(--amber-bg) !important;
}

.text-amber-600,
.text-amber-700,
.text-yellow-500,
.text-yellow-700 {
  color: var(--amber-text) !important;
}

.border-amber-100,
.border-yellow-100,
.border-yellow-200 {
  border-color: var(--amber-border) !important;
}

.hover\:bg-amber-100:hover,
.hover\:bg-yellow-100:hover {
  background-color: rgba(245, 158, 11, 0.26) !important;
}

.bg-red-50 {
  background-color: var(--red-bg) !important;
}

.text-red-500,
.text-red-600,
.text-red-700,
.text-red-800 {
  color: var(--red-text) !important;
}

.border-red-100,
.border-red-200 {
  border-color: var(--red-border) !important;
}

.hover\:bg-red-100:hover {
  background-color: rgba(239, 68, 68, 0.26) !important;
}

.bg-purple-50 {
  background-color: var(--purple-bg) !important;
}

.text-purple-600,
.text-purple-700 {
  color: var(--purple-text) !important;
}

.border-purple-100 {
  border-color: var(--purple-border) !important;
}

.bg-orange-50 {
  background-color: var(--orange-bg) !important;
}

.text-orange-600,
.text-orange-700 {
  color: var(--orange-text) !important;
}

.border-orange-100 {
  border-color: var(--orange-border) !important;
}

/* Generic chips and badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-chip);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success {
  background: var(--emerald-bg);
  color: var(--emerald-text);
}

.badge-warning {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.badge-danger {
  background: var(--red-bg);
  color: var(--red-text);
}

.badge-info {
  background: var(--blue-bg);
  color: var(--blue-text);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes points-pulse {
  0%,
  100% {
    text-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  }

  50% {
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 22px rgba(121, 255, 200, 0.20);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1024px) {
  body.sidebar-open {
    overflow: hidden;
  }

  body::after {
    opacity: 0.55;
  }

  .topbar-actions {
    gap: 0.5rem;
  }

  .dashboard-card,
  .stat-card,
  .card {
    border-radius: 15px !important;
  }
}

@media (max-width: 640px) {
  body::before {
    inset: -35%;
  }

  .theme-toggle {
    padding: 0.44rem 0.72rem;
    font-size: 0.7rem;
  }

  .login-input,
  .search-bar-input {
    font-size: 0.82rem;
  }

  thead th,
  tbody td {
    padding: 0.7rem 0.75rem !important;
  }

  .toast {
    top: auto;
    right: 0.8rem;
    bottom: 0.8rem;
    left: 0.8rem;
    max-width: none;
  }
}
