/* =========================================================
   TIKSHORTER - PREMIUM SAAS UI v2.0
   Aurora + Glassmorphism + Theme System + Micro-animations
========================================================= */

/* =========================================================
   FONTS
========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&display=swap');

/* =========================================================
   THEME: ACCENT COLOR PRESETS
========================================================= */
:root {
  --font-ui: 'Be Vietnam Pro', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Space Grotesk', 'Be Vietnam Pro', 'Segoe UI', Roboto, sans-serif;
  --accent-indigo: #6366f1;
  --accent-violet: #8b5cf6;
  --accent-rose: #f43f5e;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
}

/* =========================================================
   THEME: DARK MODE (DEFAULT)
========================================================= */
:root,
[data-theme="dark"] {
  /* Accent (default indigo, overridable) */
  --accent: var(--accent-indigo);
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.4);

  /* Backgrounds */
  --bg-base: #030712;
  --bg-surface: #0a0f1a;
  --bg-elevated: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-glass: rgba(255, 255, 255, 0.02);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: rgba(255, 255, 255, 0.08);

  /* Text */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-disabled: #475569;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);

  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Aurora colors */
  --aurora-1: rgba(99, 102, 241, 0.15);
  --aurora-2: rgba(139, 92, 246, 0.1);
  --aurora-3: rgba(6, 182, 212, 0.08);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px var(--accent-glow);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.45);

  /* Glass */
  --glass-blur: 24px;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shell-border: rgba(255, 255, 255, 0.12);
}

/* =========================================================
   THEME: LIGHT MODE
========================================================= */
/* =========================================================
   THEME: LIGHT MODE
========================================================= */
html[data-theme="light"],
body.light-mode {
  --bg-base: #f1f5f9 !important;
  --bg-surface: #ffffff !important;
  --bg-elevated: #ffffff !important;
  --bg-card: rgba(255, 255, 255, 0.9) !important;
  --bg-glass: rgba(255, 255, 255, 0.6) !important;
  --bg-hover: rgba(0, 0, 0, 0.04) !important;
  --bg-active: rgba(0, 0, 0, 0.06) !important;

  --text-primary: #0f172a !important;
  --text-secondary: #475569 !important;
  --text-muted: #64748b !important;
  --text-disabled: #94a3b8 !important;

  --border-subtle: rgba(0, 0, 0, 0.06) !important;
  --border-default: rgba(0, 0, 0, 0.1) !important;
  --border-strong: rgba(0, 0, 0, 0.15) !important;

  --aurora-1: rgba(99, 102, 241, 0.08) !important;
  --aurora-2: rgba(139, 92, 246, 0.05) !important;
  --aurora-3: rgba(6, 182, 212, 0.04) !important;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16) !important;

  --glass-bg: rgba(255, 255, 255, 0.7) !important;
  --glass-border: rgba(0, 0, 0, 0.08) !important;
}

/* Accent color overrides */
[data-accent="indigo"] {
  --accent: var(--accent-indigo);
  --accent-glow: rgba(99, 102, 241, 0.4);
}

[data-accent="violet"] {
  --accent: var(--accent-violet);
  --accent-glow: rgba(139, 92, 246, 0.4);
}

[data-accent="rose"] {
  --accent: var(--accent-rose);
  --accent-glow: rgba(244, 63, 94, 0.4);
}

[data-accent="cyan"] {
  --accent: var(--accent-cyan);
  --accent-glow: rgba(6, 182, 212, 0.4);
}

[data-accent="emerald"] {
  --accent: var(--accent-emerald);
  --accent-glow: rgba(16, 185, 129, 0.4);
}

[data-accent="amber"] {
  --accent: var(--accent-amber);
  --accent-glow: rgba(245, 158, 11, 0.4);
}

/* =========================================================
   SIZING TOKENS
========================================================= */
:root {
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================================================
   REDUCED MOTION
========================================================= */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

[data-reduce-motion="true"] *,
[data-reduce-motion="true"] *::before,
[data-reduce-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* =========================================================
   RESET & BASE
========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

html, body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* =========================================================
   AURORA BACKGROUND EFFECT
========================================================= */
.aurora-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  opacity: 1;
  transition: opacity var(--transition-slow);
}

html[data-theme="light"] .aurora-bg,
body.light-mode .aurora-bg {
  opacity: 0;
  display: none !important;
  /* Force hide */
}

.aurora-bg::before,
.aurora-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: aurora-float 20s ease-in-out infinite;
}

.aurora-bg::before {
  width: 60vw;
  height: 60vh;
  background: var(--aurora-1);
  top: -20%;
  left: 30%;
  animation-delay: 0s;
}

.aurora-bg::after {
  width: 50vw;
  height: 50vh;
  background: var(--aurora-2);
  bottom: -10%;
  right: -10%;
  animation-delay: -10s;
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: aurora-float 25s ease-in-out infinite reverse;
}

.aurora-orb:nth-child(1) {
  width: 40vw;
  height: 40vh;
  background: var(--aurora-3);
  top: 50%;
  left: -10%;
  animation-delay: -5s;
}

.aurora-orb:nth-child(2) {
  width: 35vw;
  height: 35vh;
  background: var(--accent-glow);
  top: 20%;
  right: 20%;
  animation-delay: -15s;
}

@keyframes aurora-float {

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

  25% {
    transform: translate(5%, 10%) scale(1.1);
    opacity: 0.6;
  }

  50% {
    transform: translate(-5%, 5%) scale(0.95);
    opacity: 0.4;
  }

  75% {
    transform: translate(10%, -5%) scale(1.05);
    opacity: 0.55;
  }
}

/* Noise overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

[data-theme="light"] .noise-overlay {
  opacity: 0.015;
}

/* =========================================================
   UTILITIES
========================================================= */
.mono {
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
  font-size: 0.9em;
}

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

.tiny {
  font-size: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row.right {
  justify-content: flex-end;
}

/* Visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   APP LAYOUT
========================================================= */
/* =========================================================
   APP LAYOUT
========================================================= */
.app {
  /* Simplified layout - no grid needed since sidebar is fixed */
  display: block;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

@media (max-width: 1024px) {
  .app {
    padding-bottom: 70px;
    /* Space for mobile nav */
  }
}

/* =========================================================
   SIDEBAR
========================================================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  box-shadow: 0 8px 24px var(--accent-glow);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.logo:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px var(--accent-glow);
}

.logo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.25) 100%);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

/* Navigation */
.sb-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition-base);
  margin-bottom: 4px;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: height var(--transition-base);
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--accent-glow), transparent);
  color: var(--text-primary);
}

.nav-item.active::before {
  height: 24px;
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.nav-text {
  flex: 1;
}

/* Sidebar bottom */
.sb-bottom {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
}

.account {
  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-xl);
  padding: 16px;
  transition: all var(--transition-base);
}

.account:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
}

.acc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.acc-meta {
  flex: 1;
  min-width: 0;
}

.acc-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-plan {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.acc-actions {
  display: flex;
  gap: 8px;
}

.sb-foot {
  text-align: center;
  padding-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Mobile sidebar - Completely hide on mobile by default */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    /* Keep width for animation */
    /* Ensure it doesn't take up space in flow */
    position: fixed;
    z-index: 900;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 800;
  /* Below sidebar */
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.mobile-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   MAIN CONTENT
========================================================= */
.main {
  margin-left: 280px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (max-width: 1024px) {
  .main {
    margin-left: 0;
  }
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.mobile-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   MAIN CONTENT
========================================================= */
.main {
  margin-left: 280px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: auto;
  flex: 1;
  min-width: 0;
  /* Prevent flex item from overflowing */
  position: relative;
}

@media (max-width: 1024px) {
  .main {
    margin-left: 0;
  }
}

/* =========================================================
   TOPBAR
========================================================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.tb-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tb-title .h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-only {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-only {
    display: flex;
  }
}

/* =========================================================
   CONTENT AREA
========================================================= */
.content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 768px) {
  .content {
    padding: 16px;
  }
}

/* =========================================================
   PAGE HERO
========================================================= */
.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hero-left {
  flex: 1;
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-dot {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  box-shadow: 0 8px 24px var(--accent-glow);
  animation: hero-pulse 2s ease-in-out infinite;
}

@keyframes hero-pulse {

  0%,
  100% {
    box-shadow: 0 8px 24px var(--accent-glow);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 12px 32px var(--accent-glow);
    transform: scale(1.1);
  }
}

.page-hero h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.hero-right .pills {
  justify-content: flex-end;
}

/* =========================================================
   GLASS CARDS
========================================================= */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  overflow: hidden;
  position: relative;
}

/* Gradient border effect */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent, rgba(255, 255, 255, 0.05));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

.card-inner {
  padding: 24px;
}

@media (max-width: 768px) {
  .card-inner {
    padding: 16px;
  }
}

/* Panel */
.panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 16px;
  transition: all var(--transition-base);
}

.panel:hover {
  border-color: var(--border-default);
}

/* =========================================================
   STATS WITH COUNTER ANIMATION
========================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.stat {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat:hover {
  border-color: var(--border-default);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat:hover::before {
  opacity: 1;
}

.stat .k {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat .v {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* Counter animation class */
.stat .v[data-counter] {
  transition: transform 0.3s ease;
}

.stat .v.counting {
  animation: counter-pop 0.3s ease;
}

@keyframes counter-pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

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

/* =========================================================
   GRID & FORM
========================================================= */
.grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

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

.form {
  display: flex;
  gap: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 12px;
  transition: all var(--transition-base);
}

.form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* App shorten form: keep a stable horizontal layout on desktop */
#shortenForm {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: nowrap;
}

#shortenForm #url {
  flex: 2.2;
  min-width: 280px;
}

#shortenForm #inpAlias {
  flex: 1.3;
  min-width: 180px;
}

#shortenForm #domain {
  flex: 1.1;
  min-width: 180px;
}

#shortenForm #btnShorten {
  flex: 0 0 auto;
  min-width: 86px;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  #shortenForm {
    flex-wrap: wrap;
  }

  #shortenForm #url {
    flex: 1 1 100%;
    min-width: 100%;
  }

  #shortenForm #inpAlias,
  #shortenForm #domain {
    flex: 1 1 calc(50% - 6px);
    min-width: 220px;
  }

  #shortenForm #btnShorten {
    width: 100%;
  }
}

/* =========================================================
   INPUTS
========================================================= */
.input,
.select {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-base);
}

.input:hover,
.select:hover {
  border-color: var(--border-default);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: var(--bg-surface);
}

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

.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* =========================================================
   BUTTONS WITH RIPPLE
========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

/* Ripple effect container */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-effect 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: translateY(0);
}

/* Primary button */
.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: none;
  color: white;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn.primary:hover {
  box-shadow: 0 12px 32px var(--accent-glow);
}

/* Secondary button */
.btn.secondary {
  background: transparent;
  border-color: var(--border-default);
}

.btn.secondary:hover {
  background: var(--bg-hover);
}

/* Ghost button */
.btn.ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
}

.btn.ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Size variants */
.btn.small {
  padding: 8px 14px;
  font-size: 13px;
}

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

/* Icon button */
.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.icon-btn .i {
  font-size: 18px;
}

/* =========================================================
   BADGES & PILLS
========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition-base);
}

.badge:hover {
  border-color: var(--border-default);
}

.badge.warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition-base);
}

.pill:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.dot.ok {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.dot.warn {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.dot.accent {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* =========================================================
   DIVIDER
========================================================= */
.hr {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
  margin: 24px 0;
  border: none;
}

/* =========================================================
   LISTS
========================================================= */
.hint-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hint-list li {
  position: relative;
  padding: 10px 0 10px 28px;
  color: var(--text-secondary);
  font-size: 14px;
}

.hint-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Dashboard list */
#list,
.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* =========================================================
   DASHBOARD ITEMS
========================================================= */
.item {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-base);
  animation: item-enter 0.4s ease-out forwards;
  opacity: 0;
}

@keyframes item-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

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

.item:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 32px var(--accent-glow);
}

.item .title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.item .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.item .meta .mono {
  color: var(--text-secondary);
  word-break: break-all;
}

.item .actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.item .actions .btn {
  padding: 8px 14px;
  font-size: 12px;
}

/* Staggered animation delays */
.item:nth-child(1) {
  animation-delay: 0ms;
}

.item:nth-child(2) {
  animation-delay: 50ms;
}

.item:nth-child(3) {
  animation-delay: 100ms;
}

.item:nth-child(4) {
  animation-delay: 150ms;
}

.item:nth-child(5) {
  animation-delay: 200ms;
}

.item:nth-child(6) {
  animation-delay: 250ms;
}

.item:nth-child(7) {
  animation-delay: 300ms;
}

.item:nth-child(8) {
  animation-delay: 350ms;
}

.item:nth-child(9) {
  animation-delay: 400ms;
}

.item:nth-child(10) {
  animation-delay: 450ms;
}

/* Empty state */
#list .muted,
.list .muted {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  font-size: 14px;
}

/* =========================================================
   SKELETON LOADING
========================================================= */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.medium {
  width: 80%;
}

.skeleton-text.full {
  width: 100%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-xl);
}

/* =========================================================
   PROGRESS BAR
========================================================= */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.progress-bar.active {
  opacity: 1;
}

.progress-bar .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  box-shadow: 0 0 16px var(--accent-glow);
  width: 0%;
  transition: width 0.3s ease;
  animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* Indeterminate progress */
.progress-bar.indeterminate .bar {
  width: 30%;
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(400%);
  }
}

/* =========================================================
   TOAST NOTIFICATIONS
========================================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

@media (max-width: 768px) {
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 90px;
    /* Above mobile nav */
  }
}

.toast {
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  animation: toast-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 400px;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }

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

.toast.leaving {
  animation: toast-leave 0.3s ease forwards;
}

@keyframes toast-leave {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.toast.success .toast-icon {
  background: var(--success);
}

.toast.error .toast-icon {
  background: var(--error);
}

.toast.warning .toast-icon {
  background: var(--warning);
}

.toast.info .toast-icon {
  background: var(--info);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
}

.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.toast-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* =========================================================
   FLOATING ACTION BUTTON (FAB)
========================================================= */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 32px var(--accent-glow);
  z-index: 100;
  transition: all var(--transition-base);
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px var(--accent-glow);
}

.fab:active {
  transform: scale(0.95);
}

@media (max-width: 1024px) {
  .fab {
    bottom: 90px;
    /* Above mobile nav */
  }
}

/* =========================================================
   TOOLTIP
========================================================= */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
  z-index: 1000;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* =========================================================
   CONFETTI CONTAINER
========================================================= */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confetti-fall 1.2s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* =========================================================
   THEME TOGGLE
========================================================= */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 18px;
  transition: all var(--transition-base);
}

.theme-toggle:hover {
  background: var(--bg-active);
  color: var(--text-primary);
  border-color: var(--border-default);
}

/* =========================================================
   ACCENT PICKER
========================================================= */
.accent-picker {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

.accent-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
}

.accent-option:hover {
  transform: scale(1.15);
}

.accent-option.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 12px currentColor;
}

.accent-option[data-color="indigo"] {
  background: var(--accent-indigo);
}

.accent-option[data-color="violet"] {
  background: var(--accent-violet);
}

.accent-option[data-color="rose"] {
  background: var(--accent-rose);
}

.accent-option[data-color="cyan"] {
  background: var(--accent-cyan);
}

.accent-option[data-color="emerald"] {
  background: var(--accent-emerald);
}

.accent-option[data-color="amber"] {
  background: var(--accent-amber);
}

/* =========================================================
   MOBILE BOTTOM NAVIGATION
========================================================= */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  z-index: 200;
  padding: 8px 16px;
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

@media (max-width: 1024px) {
  .mobile-nav {
    display: flex;
  }
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-base);
  flex: 1;
  max-width: 80px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.mobile-nav-item .nav-icon {
  font-size: 22px;
}

.mobile-nav-item .nav-label {
  font-size: 10px;
  font-weight: 600;
}

/* =========================================================
   MOBILE HOTFIX FINAL (highest priority)
========================================================= */
@media (max-width: 1024px) {
  .content {
    padding: 86px 12px 122px !important;
  }

  .page-hero {
    margin-bottom: 14px !important;
    gap: 12px !important;
  }

  .page-hero .hero-right {
    width: 100%;
  }

  .hero-right .pills {
    width: 100%;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .hero-right .pills::-webkit-scrollbar {
    display: none;
  }

  .stats {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  #list,
  .list {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .item {
    padding: 14px !important;
    border-radius: 16px !important;
  }

  .item .actions {
    justify-content: flex-start !important;
    flex-wrap: wrap;
    gap: 8px;
  }

  .item .actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 120px;
  }

  .form,
  #shortenForm {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  #shortenForm #url,
  #shortenForm #inpAlias,
  #shortenForm #domain,
  #shortenForm #btnShorten {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .result .row.right {
    width: 100%;
    justify-content: stretch !important;
  }

  .result .row.right .btn {
    flex: 1 1 0;
  }
}

@media (max-width: 768px) {
  .topbar {
    margin: 8px 8px 0 !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .tb-left {
    width: 100%;
    min-width: 0;
    gap: 10px;
  }

  .tb-title .muted.tiny {
    display: none !important;
  }

  .top-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .top-actions .theme-toggle,
  .top-actions .btn.ghost {
    width: 100%;
    min-height: 40px;
    border-radius: 12px !important;
    padding: 8px 6px !important;
    font-size: 12px !important;
    margin: 0 !important;
  }

  .modal {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-card {
    max-width: none !important;
    width: 100% !important;
    border-radius: 18px 18px 0 0 !important;
    max-height: 88vh;
    overflow-y: auto;
  }

  .input-row {
    flex-direction: column !important;
  }

  .input-row .btn {
    width: 100%;
  }

  .mobile-nav {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    height: 68px !important;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 16px !important;
  }

  .fab {
    right: 14px !important;
    bottom: 84px !important;
    width: 52px !important;
    height: 52px !important;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 80px 8px 118px !important;
  }

  .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #btnAccount {
    display: none !important;
  }

  .item .actions .btn,
  .modal-foot .btn {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

/* =========================================================
   MOBILE OPTIMIZATION PACK (2026-03-14)
   Final override block for phone-first UX
========================================================= */
@media (max-width: 1024px) {
  .content {
    padding: 86px 12px 122px;
  }

  .card {
    border-radius: 18px;
  }

  .card-inner {
    padding: 16px;
  }

  .page-hero {
    margin-bottom: 14px;
    gap: 12px;
  }

  .page-hero .hero-right {
    width: 100%;
  }

  .hero-right .pills {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .hero-right .pills::-webkit-scrollbar {
    display: none;
  }

  .pill,
  .badge {
    white-space: nowrap;
  }

  #list,
  .list {
    gap: 12px;
  }

  .item {
    border-radius: 16px;
    padding: 14px;
    gap: 10px;
  }

  .item .actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .item .actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 120px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat {
    padding: 16px;
  }

  .stat .v {
    font-size: clamp(24px, 8vw, 34px);
  }

  .form,
  #shortenForm {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #shortenForm #url,
  #shortenForm #inpAlias,
  #shortenForm #domain,
  #shortenForm #btnShorten {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .result .row.right {
    width: 100%;
    justify-content: stretch;
  }

  .result .row.right .btn {
    flex: 1 1 0;
  }

  .dash-controls {
    gap: 12px;
  }

  .dash-controls .ctrl .row {
    flex-wrap: wrap;
  }

  .dash-controls #pageInfo {
    margin-left: 0 !important;
  }

  .sidebar {
    width: min(88vw, 320px);
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 10px 12px;
    margin: 8px 8px 0;
    border-radius: 14px;
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .tb-left {
    width: 100%;
    min-width: 0;
    gap: 10px;
  }

  .tb-title .h1 {
    font-size: clamp(19px, 5.6vw, 24px);
  }

  .tb-title .muted.tiny {
    display: none;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .top-actions .theme-toggle,
  .top-actions .btn.ghost {
    width: 100%;
    min-height: 40px;
    margin: 0;
    border-radius: 12px;
    font-size: 12px;
    padding: 8px 6px;
  }

  .input,
  .select {
    min-height: 46px;
    font-size: 16px;
  }

  .btn {
    min-height: 42px;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    max-width: none;
    width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 88vh;
    overflow-y: auto;
  }

  .modal-head {
    padding: 16px 16px 0;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-foot {
    flex-wrap: wrap;
  }

  .modal-foot .btn {
    flex: 1 1 calc(50% - 6px);
  }

  .input-row {
    flex-direction: column;
  }

  .input-row .btn {
    width: 100%;
  }

  .mobile-nav {
    left: 8px;
    right: 8px;
    bottom: 8px;
    height: 68px;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px;
  }

  .mobile-nav-item {
    padding: 6px 8px;
    border-radius: 12px;
  }

  .mobile-nav-item .nav-icon {
    font-size: 20px;
  }

  .mobile-nav-item .nav-label {
    font-size: 9px;
  }

  .fab {
    right: 14px;
    bottom: 84px;
    width: 52px;
    height: 52px;
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 80px 8px 118px;
  }

  .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #btnAccount {
    display: none !important;
  }

  .item .actions .btn,
  .modal-foot .btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .card-inner {
    padding: 14px;
  }

  .panel,
  .stat {
    padding: 14px;
  }

  .badge,
  .pill {
    font-size: 11.5px;
    padding: 7px 10px;
  }
}

/* =========================================================
   MODERN UI REFRESH (V3)
   Layered override block to refresh shell/components
========================================================= */

:root,
[data-theme="dark"] {
  --shell-border: rgba(255, 255, 255, 0.08);
  --shell-border-strong: rgba(255, 255, 255, 0.16);
  --surface-soft: rgba(10, 16, 32, 0.74);
  --surface-strong: rgba(6, 12, 26, 0.9);
  --shadow-soft: 0 20px 48px rgba(0, 0, 0, 0.6);
  --shadow-brand: 0 24px 54px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(99, 102, 241, 0.18);
  --glass-blur: 24px;
}

body {
  background:
    radial-gradient(1200px 560px at 12% -10%, rgba(56, 189, 248, 0.15), transparent 62%),
    radial-gradient(980px 520px at 90% -14%, rgba(99, 102, 241, 0.2), transparent 68%),
    linear-gradient(180deg, #030712 0%, #050b18 52%, #020617 100%);
}

.sidebar {
  top: 14px;
  left: 14px;
  bottom: 14px;
  width: 292px;
  border-radius: 24px;
  border: 1px solid var(--shell-border);
  background: linear-gradient(180deg, rgba(10, 14, 28, 0.65) 0%, rgba(4, 8, 20, 0.75) 100%);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  box-shadow: var(--shadow-brand);
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(260px 160px at 10% 0%, rgba(56, 189, 248, 0.14), transparent 72%),
    radial-gradient(300px 180px at 90% 12%, rgba(99, 102, 241, 0.16), transparent 74%);
}

.sb-head {
  padding: 20px 16px 14px;
  margin: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sb-head .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  transition: all 0.2s;
}

.sb-head .icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sb-nav {
  padding: 12px 10px 14px;
}

.nav-item {
  border-radius: 16px;
  border: 1px solid transparent;
  padding: 12px 14px;
  gap: 14px;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  text-decoration: none !important;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.nav-item::before {
  display: none;
}

.nav-item:hover, .nav-item:focus {
  transform: translateX(4px);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  text-decoration: none !important;
}

.nav-item.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 24px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  text-decoration: none !important;
}

.nav-item.active::before {
  display: none;
}

.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.nav-item.active .nav-icon {
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  border-color: var(--accent-light);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.sb-settings {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(0, 0, 0, 0.15);
  padding: 16px;
}

.sb-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  padding: 16px;
}

.account {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 14px;
  transition: background 0.2s ease;
  min-height: 64px;
}

.account:hover {
  background: rgba(255, 255, 255, 0.08);
}

.acc-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 4px 14px var(--accent-glow);
  flex-shrink: 0;
}

.acc-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.acc-email {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.acc-actions {
  margin-top: 12px;
}

.acc-actions .btn {
  width: 100%;
}

.main {
  margin-left: 324px;
}

.topbar {
  margin: 14px 14px 0 14px;
  border-radius: 20px;
  border: 1px solid var(--shell-border);
  background: linear-gradient(165deg, rgba(17, 24, 39, 0.45), rgba(8, 12, 26, 0.55));
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  box-shadow: var(--shadow-soft);
  padding: 14px 18px;
}

.tb-title .h1 {
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.08;
  font-weight: 700;
}

.tb-title .muted.tiny {
  margin-top: 4px;
}

.top-actions .btn.ghost {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.44);
  padding: 8px 12px;
}

.content {
  max-width: 1380px;
  padding: 24px 26px 36px;
}

.page-hero {
  margin-bottom: 28px;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 44px);
  letter-spacing: -0.025em;
}

.card {
  border-radius: 26px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(10, 16, 32, 0.86), rgba(7, 12, 24, 0.9));
  box-shadow: var(--shadow-soft);
}

.card::before {
  background: linear-gradient(140deg, rgba(99, 102, 241, 0.42), transparent 40%, rgba(56, 189, 248, 0.22));
  opacity: 0.5;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--shell-border-strong);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.card-inner {
  padding: 28px;
}

.panel,
.stat,
.form {
  background: linear-gradient(170deg, rgba(13, 21, 40, 0.72), rgba(8, 14, 30, 0.68));
  border-color: rgba(148, 163, 184, 0.2);
}

.stats {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.stat {
  border-radius: 18px;
  padding: 22px 20px;
}

.stat .k {
  letter-spacing: 0.12em;
  font-size: 10.5px;
}

.stat .v {
  font-size: clamp(30px, 2.8vw, 40px);
}

.grid {
  gap: 20px;
}

#shortenForm {
  border-radius: 18px;
  padding: 10px;
  background: linear-gradient(170deg, rgba(12, 19, 37, 0.8), rgba(7, 12, 25, 0.78));
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.input,
.select {
  min-height: 48px;
  border-radius: 14px;
  font-size: 14.5px;
  background: rgba(2, 6, 23, 0.62);
  border-color: rgba(148, 163, 184, 0.2);
}

.input:focus,
.select:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.26), 0 16px 34px rgba(2, 6, 23, 0.5);
}

.btn {
  min-height: 44px;
  border-radius: 14px;
  font-weight: 700;
}

.btn.primary {
  background: linear-gradient(135deg, #22d3ee 0%, #6366f1 58%, #7c3aed 100%);
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.36);
}

.btn.primary:hover {
  box-shadow: 0 18px 34px rgba(99, 102, 241, 0.45);
}

.btn.secondary {
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(148, 163, 184, 0.28);
}

.btn.ghost {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.22);
}

.badge,
.pill {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(10, 18, 34, 0.62);
}

.result {
  border-color: rgba(56, 189, 248, 0.48);
  background: linear-gradient(120deg, rgba(34, 197, 94, 0.14), rgba(6, 182, 212, 0.14) 48%, rgba(99, 102, 241, 0.18) 100%);
}

#list,
.list {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.item {
  border-radius: 20px;
  border-color: rgba(148, 163, 184, 0.22);
  background: linear-gradient(175deg, rgba(14, 22, 40, 0.74), rgba(8, 14, 28, 0.72));
  padding: 20px 18px;
}

.item:hover {
  transform: translateY(-4px);
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.item .title {
  font-size: 15.5px;
  font-weight: 700;
}

.item .actions .btn {
  min-height: 36px;
  border-radius: 12px;
}

.mobile-nav {
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 74px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(6, 10, 22, 0.9);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.5);
}

.mobile-nav-items {
  gap: 8px;
  padding: 0 6px;
}

.mobile-nav-item {
  max-width: none;
  border-radius: 14px;
  padding: 8px 10px;
}

.mobile-nav-item.active {
  color: #fff;
  background: linear-gradient(140deg, rgba(56, 189, 248, 0.3), rgba(99, 102, 241, 0.38));
}

@media (max-width: 1280px) {
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
}

@media (max-width: 1024px) {
  .sidebar {
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    border-radius: 0 32px 32px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    background: linear-gradient(160deg, rgba(8, 12, 28, 0.88) 0%, rgba(2, 6, 16, 0.95) 100%);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.7);
    padding-top: env(safe-area-inset-top, 10px);
    padding-bottom: env(safe-area-inset-bottom, 10px);
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    margin: 10px 10px 0;
    border-radius: 16px;
    padding: 12px 14px;
  }

  .content {
    padding: 86px 12px 100px;
  }

  .card-inner {
    padding: 18px;
  }

  #list,
  .list {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .tb-title .h1 {
    font-size: clamp(20px, 5vw, 26px);
  }

  .page-hero h1 {
    font-size: clamp(24px, 8vw, 30px);
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

html[data-theme="light"] body,
body.light-mode {
  background:
    radial-gradient(1200px 560px at 12% -10%, rgba(14, 165, 233, 0.12), transparent 62%),
    radial-gradient(980px 520px at 90% -14%, rgba(99, 102, 241, 0.14), transparent 68%),
    linear-gradient(180deg, #f8fbff 0%, #f2f6ff 48%, #eef4ff 100%);
}

html[data-theme="light"] .sidebar,
body.light-mode .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 249, 255, 0.94));
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.08);
}

html[data-theme="light"] .sidebar::before,
body.light-mode .sidebar::before {
  background:
    radial-gradient(240px 150px at 10% 0%, rgba(14, 165, 233, 0.1), transparent 72%),
    radial-gradient(280px 170px at 90% 12%, rgba(99, 102, 241, 0.12), transparent 74%);
}

html[data-theme="light"] .sb-settings,
html[data-theme="light"] .sb-bottom,
body.light-mode .sb-settings,
body.light-mode .sb-bottom {
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .topbar,
body.light-mode .topbar {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.86), rgba(248, 251, 255, 0.9));
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .card,
body.light-mode .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.94));
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .panel,
html[data-theme="light"] .stat,
html[data-theme="light"] .form,
body.light-mode .panel,
body.light-mode .stat,
body.light-mode .form {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.88), rgba(248, 251, 255, 0.9));
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .input,
html[data-theme="light"] .select,
body.light-mode .input,
body.light-mode .select {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .btn.secondary,
body.light-mode .btn.secondary {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.18);
}

html[data-theme="light"] .btn.ghost,
body.light-mode .btn.ghost {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .badge,
html[data-theme="light"] .pill,
body.light-mode .badge,
body.light-mode .pill {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .item,
body.light-mode .item {
  background: linear-gradient(175deg, rgba(255, 255, 255, 0.9), rgba(246, 250, 255, 0.92));
  border-color: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .mobile-nav,
body.light-mode .mobile-nav {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

/* =========================================================
   DASHBOARD CONTROLS
========================================================= */
.dash-controls {
  display: grid;
  grid-template-columns: 1.5fr 0.6fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.dash-controls .ctrl {
  min-width: 0;
}

@media (max-width: 900px) {
  .dash-controls {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   MODAL
========================================================= */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.modal.show,
.modal.is-open {
  opacity: 1;
}

.modal[style*="flex"] {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  animation: modal-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.95);
  }

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

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.modal-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.modal-body {
  padding: 24px;
}

.modal-foot {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 16px;
}

.field {
  margin-bottom: 16px;
}

.field>span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-row {
  display: flex;
  gap: 8px;
}

.alert {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--error);
}

/* =========================================================
   RESULT BOX
========================================================= */
.result {
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: 20px;
  animation: result-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes result-enter {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

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

/* =========================================================
   QUOTA BOX
========================================================= */
#quotaBox {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
  border-color: rgba(16, 185, 129, 0.3);
  margin-top: 16px;
}

#quotaBanner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--warning);
  font-size: 14px;
}

/* =========================================================
   ADMIN PAGE SPECIFICS
========================================================= */
[data-pane] {
  animation: item-enter 0.3s ease-out;
}

[data-tab] {
  transition: all var(--transition-base);
}

[data-tab].active,
[data-tab]:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* =========================================================
   ACCOUNT PAGE SPECIFICS
========================================================= */
#acc_plan {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================================================
   SUPPORT PAGE SPECIFICS
========================================================= */
pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
}

/* =========================================================
   SCROLLBAR
========================================================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* =========================================================
   CHECKBOX STYLING
========================================================= */
input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

input[type="checkbox"]:hover {
  border-color: var(--accent);
}

input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  font-weight: 700;
}

/* =========================================================
   FOCUS VISIBLE
========================================================= */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 768px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  #list,
  .list {
    grid-template-columns: 1fr;
  }

  .form {
    flex-direction: column;
  }

  .page-hero h1 {
    font-size: 24px;
  }
}

@media (max-width: 520px) {
  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
    /* Reduce gap */
  }

  .item .actions {
    flex-direction: column;
  }

  .item .actions .btn {
    width: 100%;
  }

  /* Compact padding for mobile */
  .page-content {
    padding: 16px;
    padding-top: 12px;
  }

  .card-inner {
    padding: 16px;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 18px;
  }
}

/* =========================================================
   THEME TOGGLE
========================================================= */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 18px;
  transition: all var(--transition-base);
}

.theme-toggle:hover {
  background: var(--bg-active);
  color: var(--text-primary);
  border-color: var(--border-default);
}

/* =========================================================
   ACCENT PICKER
========================================================= */
.accent-picker {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

.accent-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
}

.accent-option:hover {
  transform: scale(1.15);
}

.accent-option.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 12px currentColor;
}

.accent-option[data-color="indigo"] {
  background: #6366f1;
}

.accent-option[data-color="violet"] {
  background: #8b5cf6;
}

.accent-option[data-color="rose"] {
  background: #f43f5e;
}

.accent-option[data-color="cyan"] {
  background: #06b6d4;
}

.accent-option[data-color="emerald"] {
  background: #10b981;
}

.accent-option[data-color="amber"] {
  background: #f59e0b;
}

/* =========================================================
   MOBILE BOTTOM NAVIGATION
========================================================= */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  z-index: 200;
  padding: 8px 16px;
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

@media (max-width: 1024px) {
  .mobile-nav {
    display: flex;
  }
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-base);
  flex: 1;
  max-width: 80px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.mobile-nav-item .nav-icon {
  font-size: 22px;
}

.mobile-nav-item .nav-label {
  font-size: 10px;
  font-weight: 600;
}


/* =========================================================
   MOBILE HOTFIX FINAL-END (guaranteed last override)
========================================================= */
@media (max-width: 1024px) {
  .content { padding: 14px 12px 122px !important; }
  .page-hero { margin-bottom: 14px !important; gap: 12px !important; }
  .page-hero .hero-right { width: 100%; }
  .hero-right .pills {
    width: 100%;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .hero-right .pills::-webkit-scrollbar { display: none; }
  .stats { grid-template-columns: 1fr !important; gap: 10px !important; }
  #list, .list { grid-template-columns: 1fr !important; gap: 12px !important; }
  .item { padding: 14px !important; border-radius: 16px !important; }
  .item .actions { justify-content: flex-start !important; flex-wrap: wrap; gap: 8px; }
  .item .actions .btn { flex: 1 1 calc(50% - 4px); min-width: 120px; }
  .form, #shortenForm { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
  #shortenForm #url, #shortenForm #inpAlias, #shortenForm #domain, #shortenForm #btnShorten {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  .result .row.right { width: 100%; justify-content: stretch !important; }
  .result .row.right .btn { flex: 1 1 0; }
}

@media (max-width: 768px) {
  .topbar {
    margin: 8px 8px 0 !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .tb-left { width: 100%; min-width: 0; gap: 10px; }
  .tb-title .muted.tiny { display: none !important; }
  .top-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .top-actions .theme-toggle,
  .top-actions .btn.ghost {
    width: 100%;
    min-height: 40px;
    border-radius: 12px !important;
    padding: 8px 6px !important;
    font-size: 12px !important;
    margin: 0 !important;
  }
  .modal { align-items: flex-end !important; padding: 0 !important; }
  .modal-card {
    max-width: none !important;
    width: 100% !important;
    border-radius: 18px 18px 0 0 !important;
    max-height: 88vh;
    overflow-y: auto;
  }
  .input-row { flex-direction: column !important; }
  .input-row .btn { width: 100%; }
  .mobile-nav {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    height: 68px !important;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 16px !important;
  }
  .fab {
    right: 14px !important;
    bottom: 84px !important;
    width: 52px !important;
    height: 52px !important;
  }
}

@media (max-width: 480px) {
  .content { padding: 12px 8px 118px !important; }
  .top-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #btnAccount { display: none !important; }
  .item .actions .btn,
  .modal-foot .btn {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

/* =========================================================
   APP-LIKE MOBILE SHELL V2 (final)
========================================================= */
body.mobile-app-ui .sidebar {
  display: block !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: min(86vw, 320px) !important;
  border-radius: 0 18px 18px 0 !important;
  border-left: none !important;
  transform: translateX(-105%);
  transition: transform 220ms ease;
  z-index: 390 !important;
  overflow-y: auto;
}

body.mobile-app-ui .sidebar.mobile-open {
  transform: translateX(0) !important;
}

body.mobile-app-ui .mobile-overlay {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 380 !important;
  background: rgba(2, 8, 18, 0.62) !important;
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

body.mobile-app-ui .mobile-overlay.visible {
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.mobile-app-ui .main {
  margin-left: 0 !important;
}

body.mobile-app-ui .topbar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 !important;
  border-radius: 0 0 18px 18px !important;
  border-left: none !important;
  border-right: none !important;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px !important;
  background: linear-gradient(170deg, rgba(8, 14, 26, 0.96), rgba(4, 9, 18, 0.95)) !important;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.52) !important;
  z-index: 350 !important;
  flex-wrap: wrap;
  row-gap: 8px;
}

body.mobile-app-ui .tb-left {
  width: 100%;
  min-width: 0;
  gap: 10px;
}

body.mobile-app-ui .tb-title .h1 {
  font-size: clamp(19px, 5.8vw, 24px) !important;
  line-height: 1.1;
}

body.mobile-app-ui .tb-title .muted.tiny {
  display: none !important;
}

body.mobile-app-ui .top-actions {
  width: 100%;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.mobile-app-ui .top-actions .theme-toggle,
body.mobile-app-ui .top-actions .btn.ghost {
  width: 100%;
  min-height: 40px;
  border-radius: 12px !important;
  font-size: 12px !important;
  padding: 8px 6px !important;
  margin: 0 !important;
}

body.mobile-app-ui .content {
  max-width: 100% !important;
  padding: calc(var(--mobile-topbar-h, 132px) + 10px) 10px calc(102px + env(safe-area-inset-bottom, 0px)) !important;
}

body.mobile-app-ui .page-hero {
  margin-bottom: 12px !important;
  gap: 10px !important;
}

body.mobile-app-ui .page-hero .hero-right {
  width: 100%;
}

body.mobile-app-ui .hero-right .pills {
  width: 100%;
  justify-content: flex-start !important;
  overflow-x: auto;
  flex-wrap: nowrap !important;
  scrollbar-width: none;
}

body.mobile-app-ui .hero-right .pills::-webkit-scrollbar {
  display: none;
}

body.mobile-app-ui .page-hero h1 {
  font-size: clamp(22px, 7vw, 30px) !important;
}

body.mobile-app-ui .card {
  border-radius: 20px !important;
}

body.mobile-app-ui .card-inner {
  padding: 14px !important;
}

body.mobile-app-ui .panel,
body.mobile-app-ui .stat,
body.mobile-app-ui .item {
  border-radius: 14px !important;
  padding: 12px !important;
}

body.mobile-app-ui .stats {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

body.mobile-app-ui #list,
body.mobile-app-ui .list {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

body.mobile-app-ui .item .actions {
  justify-content: flex-start !important;
  flex-wrap: wrap;
}

body.mobile-app-ui .item .actions .btn {
  flex: 1 1 100%;
  width: 100%;
}

body.mobile-app-ui .form,
body.mobile-app-ui #shortenForm {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
}

body.mobile-app-ui #shortenForm #url,
body.mobile-app-ui #shortenForm #inpAlias,
body.mobile-app-ui #shortenForm #domain,
body.mobile-app-ui #shortenForm #btnShorten {
  width: 100% !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

body.mobile-app-ui .input,
body.mobile-app-ui .select {
  min-height: 46px !important;
  font-size: 16px !important;
}

body.mobile-app-ui .btn {
  min-height: 42px;
}

body.mobile-app-ui .mobile-nav {
  display: flex !important;
  left: 8px !important;
  right: 8px !important;
  bottom: 8px !important;
  height: 68px !important;
  border-radius: 16px !important;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 360;
}

body.mobile-app-ui .mobile-nav-item {
  border-radius: 12px;
  padding: 6px 8px;
}

body.mobile-app-ui .mobile-nav-item .nav-icon {
  font-size: 20px;
}

body.mobile-app-ui .mobile-nav-item .nav-label {
  font-size: 9px;
}

body.mobile-app-ui .fab {
  right: 14px !important;
  bottom: 86px !important;
  width: 52px !important;
  height: 52px !important;
}

body.mobile-app-ui .modal {
  align-items: flex-end !important;
  padding: 0 !important;
}

body.mobile-app-ui .modal-card {
  width: 100% !important;
  max-width: none !important;
  max-height: 88vh;
  border-radius: 18px 18px 0 0 !important;
  overflow-y: auto;
}

body.mobile-app-ui .input-row {
  flex-direction: column !important;
}

body.mobile-app-ui .input-row .btn {
  width: 100%;
}

@media (max-width: 420px) {
  body.mobile-app-ui .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.mobile-app-ui #btnAccount {
    display: none !important;
  }
}
