/* ============================================
   SmallLinks — iOS 26 Glassmorphic Theme
   ============================================ */

:root {
  --bg-deep: #0a0a14;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-bg-hover: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-bright: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glass-blur: 40px;

  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-tertiary: rgba(255, 255, 255, 0.3);

  --accent-blue: #007AFF;
  --accent-blue-soft: rgba(0, 122, 255, 0.15);
  --accent-green: #30D158;
  --accent-green-soft: rgba(48, 209, 88, 0.15);
  --accent-purple: #BF5AF2;
  --accent-purple-soft: rgba(191, 90, 242, 0.15);
  --accent-orange: #FF9F0A;
  --accent-orange-soft: rgba(255, 159, 10, 0.15);
  --accent-red: #FF453A;
  --accent-red-soft: rgba(255, 69, 58, 0.15);
  --accent-teal: #64D2FF;
  --accent-teal-soft: rgba(100, 210, 255, 0.15);
  --accent-pink: #FF375F;
  --accent-pink-soft: rgba(255, 55, 95, 0.15);
  --accent-indigo: #5856D6;
  --accent-yellow: #FFD60A;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --transition-fast: 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-smooth: 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ---- Background Orbs ---- */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #007AFF 0%, transparent 70%);
  top: -10%;
  left: -5%;
  animation-duration: 22s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #BF5AF2 0%, transparent 70%);
  top: 50%;
  right: -10%;
  animation-duration: 18s;
  animation-delay: -5s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #5856D6 0%, transparent 70%);
  bottom: -5%;
  left: 30%;
  animation-duration: 25s;
  animation-delay: -10s;
}

.orb-4 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, #30D158 0%, transparent 70%);
  top: 30%;
  left: 50%;
  animation-duration: 20s;
  animation-delay: -3s;
  opacity: 0.2;
}

.orb-5 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #FF9F0A 0%, transparent 70%);
  bottom: 20%;
  right: 20%;
  animation-duration: 23s;
  animation-delay: -8s;
  opacity: 0.18;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(40px, -30px) scale(1.1);
  }

  50% {
    transform: translate(-20px, 50px) scale(0.95);
  }

  75% {
    transform: translate(30px, 20px) scale(1.05);
  }
}

/* ---- 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);
  box-shadow: var(--glass-shadow);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-card:hover {
  border-color: var(--glass-border-bright);
}

.glass-bar {
  background: rgba(15, 15, 25, 0.7);
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  border: 1px solid var(--glass-border);
}

/* ---- Views ---- */
.view {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.view.active {
  display: block;
  animation: viewFadeIn 0.5s ease-out;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

/* ============================================
   LOGIN
   ============================================ */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 48px 36px;
  text-align: center;
}

.login-icon {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

.login-icon svg {
  filter: drop-shadow(0 4px 20px rgba(0, 122, 255, 0.4));
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ---- Inputs ---- */
.input-group {
  margin-bottom: 18px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.input-group label .optional {
  color: var(--text-tertiary);
  font-weight: 400;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: all var(--transition-fast);
}

.input-group input::placeholder {
  color: var(--text-tertiary);
}

.input-group input:focus {
  border-color: var(--accent-blue);
  background: rgba(0, 122, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.slug-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  overflow: hidden;
}

.slug-input-wrap:focus-within {
  border-color: var(--accent-blue);
  background: rgba(0, 122, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.slug-prefix {
  padding: 12px 0 12px 16px;
  font-size: 14px;
  color: var(--text-tertiary);
  white-space: nowrap;
  user-select: none;
}

.slug-input-wrap input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-left: 2px;
  flex: 1;
  min-width: 0;
}

.slug-input-wrap input:focus {
  box-shadow: none !important;
}

/* ---- Error ---- */
.error-msg {
  background: var(--accent-red-soft);
  color: var(--accent-red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  animation: shakeIn 0.4s ease;
}

@keyframes shakeIn {
  0% {
    transform: translateX(-8px);
    opacity: 0;
  }

  25% {
    transform: translateX(6px);
  }

  50% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(2px);
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(0, 122, 255, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, #FF453A, #FF2D55);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 69, 58, 0.3);
}

.btn-danger:hover {
  box-shadow: 0 6px 24px rgba(255, 69, 58, 0.45);
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
}

.btn-icon {
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.hidden {
  display: none !important;
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #007AFF, #AF52DE);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ---- Pills ---- */
.nav-pills {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  margin-bottom: 28px;
  width: fit-content;
}

.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.pill.active {
  background: rgba(0, 122, 255, 0.15);
  color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);
}

/* ---- Tabs ---- */
.tab-content {
  display: none;
  animation: tabIn 0.35s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes tabIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stats-grid-6 {
  grid-template-columns: repeat(3, 1fr);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px;
  cursor: default;
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  flex-shrink: 0;
}

.stat-icon.blue {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.stat-icon.green {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.stat-icon.purple {
  background: var(--accent-purple-soft);
  color: var(--accent-purple);
}

.stat-icon.orange {
  background: var(--accent-orange-soft);
  color: var(--accent-orange);
}

.stat-icon.teal {
  background: var(--accent-teal-soft);
  color: var(--accent-teal);
}

.stat-icon.pink {
  background: var(--accent-pink-soft);
  color: var(--accent-pink);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ---- Card Header ---- */
.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-header-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.card-badge {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-badge.up {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.card-badge.down {
  background: var(--accent-red-soft);
  color: var(--accent-red);
}

.card-badge.neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-tertiary);
}

/* ---- Charts ---- */
.chart-card {
  margin-bottom: 20px;
}

.chart-container {
  padding: 16px 20px 20px;
  position: relative;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-lg {
  height: 260px;
}

.chart-md {
  height: 200px;
}

/* ---- Chart Legend ---- */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 24px 18px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Analytics Grid ---- */
.analytics-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* ---- Top Links ---- */
.top-links-list {
  padding: 8px 16px 16px;
}

.top-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--transition-fast);
  border-radius: 8px;
}

.top-link-item:last-child {
  border-bottom: none;
}

.top-link-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.top-link-slug {
  font-weight: 600;
  font-size: 14px;
  color: var(--accent-blue);
}

.top-link-title {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.top-link-clicks {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-link-unique {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: right;
}

/* ---- Recent Activity ---- */
.recent-activity-list {
  padding: 8px 16px 16px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 5px;
  box-shadow: 0 0 8px rgba(0, 122, 255, 0.4);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.activity-text {
  flex: 1;
  min-width: 0;
}

.activity-link {
  color: var(--accent-teal);
  font-weight: 500;
}

.activity-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.activity-device {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ============================================
   LINKS TAB
   ============================================ */
.links-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-card {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
  cursor: default;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-blue), var(--accent-purple));
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.link-card:hover::before {
  opacity: 1;
}

.link-card.inactive {
  opacity: 0.5;
}

.link-card.inactive::before {
  background: var(--accent-red) !important;
}

.link-info {
  flex: 1;
  min-width: 0;
}

.link-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-name .link-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(48, 209, 88, 0.5);
}

.link-card.inactive .link-status-dot {
  background: var(--accent-red);
  box-shadow: 0 0 6px rgba(255, 69, 58, 0.5);
}

.link-short-url {
  font-size: 13px;
  color: var(--accent-teal);
  margin-bottom: 4px;
  font-weight: 500;
}

.link-dest {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.link-stats-mini {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.link-stat-item {
  text-align: center;
}

.link-stat-num {
  font-size: 18px;
  font-weight: 700;
  display: block;
  line-height: 1.1;
}

.link-stat-lbl {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.link-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 16px;
  font-weight: 500;
}

.empty-state .subtle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.subtle {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 20px;
  animation: modalBgIn 0.25s ease;
}

@keyframes modalBgIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  width: 100%;
  max-width: 480px;
  padding: 28px;
  animation: modalSlideIn 0.35s var(--transition-spring);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-large {
  max-width: 680px;
}

.modal-small {
  max-width: 380px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }

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

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ---- Stats Modal ---- */
.stats-range-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.range-pill {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.range-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.range-pill.active {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border-color: rgba(0, 122, 255, 0.3);
}

.stats-summary {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  flex: 1;
}

.mini-stat-value {
  font-size: 28px;
  font-weight: 700;
}

.mini-stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.stats-details {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.referers-list,
.recent-clicks-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.referer-item,
.recent-click-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  font-size: 13px;
}

.referer-name,
.click-time {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

.referer-count {
  font-weight: 600;
  color: var(--accent-blue);
}

.click-info {
  font-size: 11px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

/* ---- Breakdown bars list ---- */
.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.breakdown-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.breakdown-item-name {
  color: var(--text-secondary);
  font-weight: 500;
}

.breakdown-item-value {
  color: var(--text-tertiary);
  font-weight: 600;
}

.breakdown-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ---- Referrers full ---- */
.referers-list-full {
  padding: 12px 20px 20px;
}

.referer-full-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.referer-full-item:last-child {
  border-bottom: none;
}

.referer-rank {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.referer-full-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referer-full-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-blue);
}

.referer-full-bar {
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  flex-shrink: 0;
}

.referer-full-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent-blue);
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: rgba(30, 30, 45, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: rgba(48, 209, 88, 0.3);
}

.toast.error {
  border-color: rgba(255, 69, 58, 0.3);
}

.copy-flash {
  animation: copyPulse 0.3s ease;
}

@keyframes copyPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}

/* ---- No data placeholder ---- */
.no-data {
  padding: 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .topbar {
    padding: 12px 16px;
  }

  .main-content {
    padding: 16px 12px 40px;
  }

  .stats-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .analytics-grid-2 {
    grid-template-columns: 1fr;
  }

  .stats-details-grid {
    grid-template-columns: 1fr;
  }

  .link-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .link-stats-mini {
    width: 100%;
    justify-content: flex-start;
  }

  .link-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .link-dest {
    max-width: 100%;
  }

  .modal {
    padding: 22px;
    max-height: 85vh;
  }
}

@media (max-width: 480px) {
  .stats-grid-6 {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 32px 24px;
  }

  .nav-pills {
    width: 100%;
  }

  .pill {
    flex: 1;
    justify-content: center;
  }
}