/* ═══════════════════════════════════════════════════════════════
   ATech Link — Design System
   Premium Dark Mode + Glassmorphism + Micro-animations
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Reset ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Premium Dark Mode Colors (Deep rich dark to avoid OLED smear) */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-elevated: #161622;
  --bg-surface: #1e1e2d;

  /* Brand — Cyan-Blue Premium Gradient */
  --brand-primary: #06b6d4;
  --brand-secondary: #3b82f6;
  --brand-tertiary: #6366f1;
  --brand-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%);
  --brand-gradient-hover: linear-gradient(135deg, #22d3ee 0%, #60a5fa 50%, #8b5cf6 100%);
  --brand-glow: 0 0 30px rgba(6, 182, 212, 0.5);

  /* Premium Typography Colors */
  --text-primary: #e8e8ed;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-accent: #67e8f9;

  /* Status */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);
  --pending: #f59e0b;

  /* Premium Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-bg-hover: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --glass-blur: 24px;

  /* Premium Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.2);
  --shadow-glow-lg: 0 0 50px rgba(6, 182, 212, 0.35);

  /* Spacing & Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Fluid Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --font-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --font-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --font-lg: clamp(1.125rem, 1rem + 0.6vw, 1.25rem);
  --font-xl: clamp(1.25rem, 1.1rem + 0.8vw, 1.5rem);
  --font-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --font-3xl: clamp(2rem, 1.5rem + 2vw, 3rem);
  --font-display: clamp(2.5rem, 2rem + 3vw, 4rem);

  /* Smooth Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);
}

/* ── Base ──────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Premium Animated Background ───────────────────────────── */
.bg-animated {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-primary);
  overflow: hidden;
}

.bg-animated::before,
.bg-animated::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  animation: bgFloat 15s infinite alternate ease-in-out;
}

.bg-animated::before {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15), transparent 70%);
  animation-delay: -2s;
}

.bg-animated::after {
  bottom: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%);
  animation-duration: 20s;
}

.bg-animated-mesh {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.08), transparent 60%);
  filter: blur(80px);
  animation: pulse 8s infinite alternate ease-in-out;
}

@keyframes bgFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(5%, 10%) scale(1.1);
  }

  100% {
    transform: translate(-5%, 5%) scale(0.95);
  }
}

@keyframes pulse {
  0% {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

/* ── Layout ────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-sm {
  max-width: 480px;
}

.container-md {
  max-width: 640px;
}

.container-lg {
  max-width: 960px;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Glass Card ────────────────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform var(--transition-normal),
    box-shadow var(--transition-normal),
    border-color var(--transition-normal),
    background var(--transition-normal);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}

.glass-card-interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.glass-card-lg {
  padding: 2rem;
  border-radius: var(--radius-xl);
}

.glass-card-sm {
  padding: 1rem;
  border-radius: var(--radius-md);
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(6, 6, 11, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 1.25rem;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: var(--font-lg);
  color: var(--text-primary);
}

.navbar-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--brand-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-links a,
.navbar-links button {
  font-family: var(--font-family);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border: none;
  background: none;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.navbar-links a:hover,
.navbar-links button:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  min-height: 44px;
  min-width: 44px;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--brand-gradient);
  color: white;
  box-shadow: var(--shadow-sm), 0 0 20px rgba(6, 182, 212, 0.2);
}

.btn-primary:hover {
  background: var(--brand-gradient-hover);
  box-shadow: var(--shadow-md), var(--brand-glow);
  transform: translateY(-2px);
  color: white;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
  color: white;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--font-xs);
  min-height: 36px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: var(--font-base);
  min-height: 52px;
}

.btn-xl {
  padding: 1.125rem 2.5rem;
  font-size: var(--font-lg);
  min-height: 56px;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn .btn-loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.loading .btn-text {
  opacity: 0;
}

.btn.loading .btn-loader {
  display: block;
  position: absolute;
}

/* ── Inputs ────────────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-label {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.input {
  font-family: var(--font-family);
  font-size: var(--font-base);
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  min-height: 48px;
  transition: all var(--transition-fast);
  outline: none;
  width: 100%;
}

.input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.input::placeholder {
  color: var(--text-muted);
}

.input-lg {
  padding: 1rem 1.25rem;
  min-height: 56px;
  font-size: var(--font-lg);
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input {
  padding-left: 2.75rem;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.input-error {
  border-color: var(--error) !important;
}

.input-success {
  border-color: var(--success) !important;
}

.input-hint {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.input-error-msg {
  font-size: var(--font-xs);
  color: var(--error);
}

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-card {
  text-align: center;
  padding: 1.25rem;
}

.stat-card-value {
  font-size: var(--font-2xl);
  font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.stat-card-label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-card-change {
  font-size: var(--font-xs);
  margin-top: 0.5rem;
  font-weight: 600;
}

.stat-card-change.up {
  color: var(--success);
}

.stat-card-change.down {
  color: var(--error);
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-neutral {
  background: var(--glass-bg);
  color: var(--text-secondary);
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
  font-size: var(--font-sm);
}

.table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--font-xs);
  background: rgba(255, 255, 255, 0.02);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ── Modals ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.3s var(--ease-bounce);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: var(--font-xl);
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 1.25rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 500;
  animation: slideInRight 0.3s var(--ease-bounce);
  backdrop-filter: blur(20px);
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.toast-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.toast-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.toast-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ── Skeleton Loading ──────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--glass-bg) 25%, rgba(255, 255, 255, 0.08) 50%, var(--glass-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1em;
  width: 80%;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: 0.75rem;
}

.skeleton-card {
  height: 120px;
}

.skeleton-chart {
  height: 250px;
  border-radius: var(--radius-lg);
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--font-xl);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: var(--text-muted);
  font-size: var(--font-sm);
  margin-bottom: 1.5rem;
}

/* ── Section ───────────────────────────────────────────────── */
.section {
  padding: 5rem 0;
}

.section-title {
  font-size: var(--font-3xl);
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.section-subtitle {
  font-size: var(--font-lg);
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 600px;
}

/* ── Gradient Text ─────────────────────────────────────────── */
.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Grid Utilities ────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.flex-between {
  align-items: center;
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-sm {
  gap: 0.5rem;
}

.gap-md {
  gap: 1rem;
}

.gap-lg {
  gap: 1.5rem;
}

.gap-xl {
  gap: 2rem;
}

/* ── Spacing ───────────────────────────────────────────────── */
.mt-auto {
  margin-top: auto;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

/* ── Text ──────────────────────────────────────────────────── */
.text-center {
  text-align: center;
}

.text-sm {
  font-size: var(--font-sm);
}

.text-xs {
  font-size: var(--font-xs);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

/* ── Dashboard Layout ──────────────────────────────────────── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 64px;
}

.sidebar {
  width: 260px;
  min-height: calc(100vh - 64px);
  background: rgba(6, 6, 11, 0.95);
  border-right: 1px solid var(--glass-border);
  padding: 1.5rem 0;
  position: fixed;
  top: 64px;
  left: 0;
  overflow-y: auto;
  transition: transform 0.3s var(--ease-out);
  z-index: 90;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  min-height: 44px;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
}

.sidebar-link.active {
  color: var(--brand-primary);
  background: rgba(6, 182, 212, 0.1);
}

.sidebar-link .icon {
  font-size: 1.125rem;
  width: 24px;
  text-align: center;
}

.sidebar-section-title {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1.5rem 1rem 0.5rem;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  width: calc(100% - 260px);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: var(--font-2xl);
  font-weight: 800;
}

.page-description {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Mobile Sidebar Toggle ─────────────────────────────────── */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 95;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--brand-gradient);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-glow-lg);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 85;
}

/* ── Chart Container ───────────────────────────────────────── */
.chart-container {
  width: 100%;
  height: 280px;
  position: relative;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── Link Card ─────────────────────────────────────────────── */
.link-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
}

.link-card-info {
  flex: 1;
  min-width: 0;
}

.link-card-title {
  font-weight: 600;
  font-size: var(--font-base);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-url {
  font-size: var(--font-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-short {
  font-size: var(--font-sm);
  color: var(--brand-primary);
  font-weight: 600;
  margin-bottom: 0.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.link-card-short:hover {
  color: var(--brand-secondary);
}

.link-card-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.link-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Countdown (Redirect) ──────────────────────────────────── */
.redirect-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.redirect-card {
  text-align: center;
  max-width: 440px;
  width: 100%;
}

.redirect-countdown {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: var(--font-3xl);
  font-weight: 800;
  position: relative;
}

.redirect-countdown::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--brand-primary);
  animation: spin 1s linear infinite;
}

.redirect-url {
  font-size: var(--font-xs);
  color: var(--text-muted);
  word-break: break-all;
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--glass-bg);
  border-radius: var(--radius-sm);
}

/* ── Auth Pages ────────────────────────────────────────────── */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  margin-bottom: 2rem;
  font-size: var(--font-xl);
  font-weight: 800;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: var(--brand-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.auth-title {
  font-size: var(--font-2xl);
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--brand-primary);
  font-weight: 600;
}

/* Pending status */
.pending-status {
  text-align: center;
  padding: 2rem;
}

.pending-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: pulse 2s ease-in-out infinite;
}

.pending-key {
  font-family: 'Courier New', monospace;
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--brand-primary);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(6, 182, 212, 0.2);
  margin: 1rem 0;
  display: inline-block;
  letter-spacing: 0.1em;
  word-break: break-all;
}

/* ── Heatmap ───────────────────────────────────────────────── */
.heatmap-grid {
  display: grid;
  grid-template-columns: 40px repeat(24, 1fr);
  gap: 2px;
  font-size: var(--font-xs);
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  min-width: 0;
}

.heatmap-label {
  display: flex;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

@keyframes countdownPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.5s var(--ease-out);
}

.animate-scale-in {
  animation: scaleIn 0.3s var(--ease-bounce);
}

/* Staggered children */
.stagger>* {
  animation: slideUp 0.4s var(--ease-out) both;
}

.stagger>*:nth-child(1) {
  animation-delay: 0ms;
}

.stagger>*:nth-child(2) {
  animation-delay: 60ms;
}

.stagger>*:nth-child(3) {
  animation-delay: 120ms;
}

.stagger>*:nth-child(4) {
  animation-delay: 180ms;
}

.stagger>*:nth-child(5) {
  animation-delay: 240ms;
}

.stagger>*:nth-child(6) {
  animation-delay: 300ms;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1.25rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar-links .btn-text-hide {
    display: none;
  }

  .section {
    padding: 3rem 0;
  }

  .chart-container {
    height: 220px;
  }

  .heatmap-grid {
    font-size: 8px;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.25rem !important;
  }

  .container {
    padding: 0 1rem;
  }

  .link-card {
    flex-direction: column;
  }

  .link-card-actions {
    width: 100%;
  }

  .link-card-actions .btn {
    flex: 1;
  }
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ── Selection ─────────────────────────────────────────────── */
::selection {
  background: rgba(6, 182, 212, 0.3);
  color: white;
}

/* ── Tab Controls ──────────────────────────────────────────── */
.tab-controls {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  overflow-x: auto;
}

.tab-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  min-height: 36px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--brand-primary);
  color: white;
}

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--glass-bg);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: 3px;
  transition: width 0.5s var(--ease-out);
}

/* ── Donut Chart CSS ───────────────────────────────────────── */
.donut-chart {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  margin: 0 auto;
}

.donut-center {
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.donut-center-value {
  font-size: var(--font-xl);
  font-weight: 800;
}

.donut-center-label {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-xs);
}

.donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Horizontal Bar ────────────────────────────────────────── */
.h-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.h-bar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.h-bar-label {
  min-width: 80px;
  font-size: var(--font-xs);
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h-bar-track {
  flex: 1;
  height: 24px;
  background: var(--glass-bg);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.h-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--brand-gradient);
  transition: width 0.6s var(--ease-out);
  min-width: 2px;
}

.h-bar-value {
  min-width: 40px;
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Copy Button Effect ────────────────────────────────────── */
.copy-feedback {
  position: relative;
}

.copy-feedback::after {
  content: 'Copied!';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.copy-feedback.copied::after {
  opacity: 1;
}

/* ── Date Filter ───────────────────────────────────────────── */
.date-filter {
  display: flex;
  gap: 0.25rem;
}

.date-filter .tab-btn {
  font-size: 11px;
  padding: 0.375rem 0.75rem;
}