/* ==========================================================================
   Mini URL — Modern High-Performance Design System & Stylesheet
   Crafted with modern dark SaaS aesthetics, micro-interactions & responsiveness
   ========================================================================== */

:root {
  /* Surface & Base Colors */
  --bg-dark: #080b11;
  --bg-surface: #0e131f;
  --bg-card: #121826;
  --bg-card-hover: #172033;
  --bg-card-active: #1d273d;
  --bg-input: #151c2d;
  --bg-input-focus: #182238;

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-color: #1e293f;
  --border-hover: #2e3e5c;
  --border-focus: #38bdf8;
  --border-highlight: rgba(255, 255, 255, 0.12);

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-disabled: #475569;

  /* Brand Accents */
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-primary-glow: rgba(99, 102, 241, 0.25);

  --accent-cyan: #38bdf8;
  --accent-cyan-hover: #0ea5e9;
  --accent-cyan-glow: rgba(56, 189, 248, 0.25);

  --accent-violet: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Status Colors */
  --status-active-bg: rgba(16, 185, 129, 0.12);
  --status-active-text: #34d399;
  --status-active-border: rgba(16, 185, 129, 0.25);

  --status-disabled-bg: rgba(245, 158, 11, 0.12);
  --status-disabled-text: #fbbf24;
  --status-disabled-border: rgba(245, 158, 11, 0.25);

  --status-expired-bg: rgba(239, 68, 68, 0.12);
  --status-expired-text: #f87171;
  --status-expired-border: rgba(239, 68, 68, 0.25);

  /* Geometry & Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-card-hover: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 24px rgba(56, 189, 248, 0.12);
  --shadow-modal: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);

  /* Smooth Transitions */
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;
}

/* Tabular numbers for numerical readouts */
.stat-val, .badge, .mono {
  font-feature-settings: 'tnum' on, 'lnum' on;
}

/* Ambient Grid & Lighting Background */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 15%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 15%, black 40%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.16;
  animation: floatGlow 18s ease-in-out infinite alternate;
}

.bg-glow-1 {
  top: -120px;
  left: 15%;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
}

.bg-glow-2 {
  top: 30%;
  right: 10%;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  animation-delay: -9s;
}

@keyframes floatGlow {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */

#app {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 11, 17, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}

/* Brand Logo */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  transition: transform 0.2s ease, opacity 0.2s ease;
  user-select: none;
}

.brand:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.brand:hover .brand-icon {
  transform: rotate(6deg) scale(1.04);
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.brand-highlight {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* Nav Links & Controls */
.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Button Variants */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff !important;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7175f8 0%, #5b53ed 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-cyan {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  color: #06111f !important;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-cyan:hover {
  background: linear-gradient(135deg, #56c8f9 0%, #17b0f3 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-cyan:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.btn-ghost {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #fca5a5;
  font-weight: 600;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

/* User Pill in Navbar */
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 5px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.user-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: white;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Mobile Navigation
   ========================================================================== */

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  transition: var(--transition);
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}

.mobile-menu-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  z-index: 49;
  background: rgba(14, 19, 31, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 24px 28px;
  transform: translateY(-120%);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.mobile-nav-drawer.open {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-nav-links .nav-btn {
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  font-size: 0.98rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Views & View Switcher
   ========================================================================== */

.view-section {
  display: none;
  padding: 44px 0 64px;
  animation: viewFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-section.active {
  display: block;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   VIEW 1: Landing Page
   ========================================================================== */

.hero {
  text-align: center;
  padding: 70px 0 50px;
  max-width: 860px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: var(--accent-cyan);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 28px;
  box-shadow: 0 0 24px -4px rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(8px);
}

.hero-title {
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #ffffff 30%, #cbd5e1 75%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.65;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Landing Features Bento Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 24px;
  margin-top: 70px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: var(--shadow-card-hover);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.08) rotate(3deg);
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.6;
}

.feature-card code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent-cyan);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   VIEW 2: User Dashboard
   ========================================================================== */

/* Segmented Dash Tabs */
.dash-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: rgba(14, 19, 31, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 34px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-item {
  padding: 9px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-item.active {
  color: var(--text-primary);
  background: #1e293f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Subviews */
.dash-subview {
  animation: viewFadeIn 0.25s ease-out;
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard-title {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.platform-users-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: 0 0 16px -4px rgba(168, 85, 247, 0.2);
}

.platform-users-pill svg {
  color: #c084fc;
}

.platform-users-pill strong {
  font-weight: 700;
  color: #ffffff;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: var(--shadow-card);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-val {
  font-size: 2.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.06);
}

/* ==========================================================================
   Card Box & General Panels
   ========================================================================== */

.card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  margin-bottom: 32px;
  transition: border-color 0.2s ease;
}

.card-box:hover {
  border-color: var(--border-hover);
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.input-text, .select-dropdown, .textarea-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.94rem;
  font-family: inherit;
  transition: var(--transition);
}

.input-text::placeholder, .textarea-input::placeholder {
  color: var(--text-muted);
}

.input-text:focus, .select-dropdown:focus, .textarea-input:focus {
  outline: none;
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18), 0 0 16px rgba(56, 189, 248, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

/* Select Dropdown custom styling */
.select-dropdown {
  appearance: none;
  background-image: url("data:image/svg2+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.textarea-input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* Link Type Selector Pills */
.type-selector-pills {
  display: flex;
  gap: 8px;
  background: var(--bg-input);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 6px;
}

.type-pill {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.type-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.type-pill.active {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  color: #080b11;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
  font-weight: 700;
}

/* Builder Sections (Tasks & Ad Steps) */
.builder-section {
  background: rgba(14, 19, 31, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.builder-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.builder-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.builder-add-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.builder-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.builder-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  gap: 14px;
  transition: var(--transition);
}

.builder-item-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.builder-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder-item-url {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.builder-preview-box {
  background: #080b11;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 16px;
}

.builder-preview-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sequence-diagram-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.seq-node {
  background: #172033;
  color: var(--accent-cyan);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
}

.seq-arrow {
  color: var(--text-muted);
  font-weight: 700;
}

/* Open Graph Simulator Preview */
.og-preview-wrap {
  margin-top: 28px;
  padding: 24px;
  background: rgba(8, 11, 17, 0.6);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.og-preview-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.og-card {
  background: #172033;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 480px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.og-img-preview {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-color);
}

.og-img-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.og-card-body {
  padding: 16px 20px;
}

.og-card-host {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.og-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.35;
}

.og-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Data Tables & Toolbars
   ========================================================================== */

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input {
  width: 100%;
  padding: 11px 16px 11px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.92rem;
}

.data-table th {
  background: rgba(14, 19, 31, 0.9);
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.link-title-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.link-thumb-mini {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.short-url-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.short-url-badge:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.dest-url-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Badges & Pills
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-active {
  background: var(--status-active-bg);
  color: var(--status-active-text);
  border: 1px solid var(--status-active-border);
}

.badge-active::before {
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
}

.badge-disabled {
  background: var(--status-disabled-bg);
  color: var(--status-disabled-text);
  border: 1px solid var(--status-disabled-border);
}

.badge-disabled::before {
  background: #fbbf24;
}

.badge-expired {
  background: var(--status-expired-bg);
  color: var(--status-expired-text);
  border: 1px solid var(--status-expired-border);
}

.badge-expired::before {
  background: #f87171;
}

.badge-type-custom {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-type-custom::before {
  background: #818cf8;
}

.badge-type-task {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-type-task::before {
  background: #38bdf8;
}

.badge-type-ad {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-type-ad::before {
  background: #fbbf24;
}

/* Action Buttons & Icon Buttons */
.action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.icon-btn:active {
  transform: translateY(0);
}

/* Social Platform Icons */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

.social-icon-facebook  { background: rgba(24, 119, 242, 0.18); color: #4f8ef7; }
.social-icon-youtube   { background: rgba(255, 0, 0, 0.15);    color: #ff4444; }
.social-icon-instagram { background: rgba(225, 48, 108, 0.18); color: #e1306c; }
.social-icon-discord   { background: rgba(88, 101, 242, 0.18); color: #7289da; }
.social-icon-telegram  { background: rgba(0, 136, 204, 0.18);  color: #29b6f6; }
.social-icon-twitter   { background: rgba(255, 255, 255, 0.1); color: #e2e8f0; }

/* ==========================================================================
   Analytics Grids & Progress
   ========================================================================== */

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.chart-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-progress-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.stat-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #6366f1);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  background: #111726;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  padding: 34px;
  box-shadow: var(--shadow-modal);
  transform: scale(0.94) translateY(10px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.modal-close {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: rotate(90deg);
}

/* Confirmation Modals */
.modal-confirm-card {
  max-width: 440px;
  text-align: center;
  padding: 38px 32px;
}

.modal-confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.modal-confirm-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-confirm-body {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

.modal-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-confirm-actions .nav-btn {
  flex: 1;
  justify-content: center;
  padding: 12px 20px;
  font-size: 0.94rem;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #111726;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-cyan);
  color: var(--text-primary);
  padding: 14px 22px;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.7);
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  backdrop-filter: blur(12px);
  max-width: 400px;
}

.toast.toast-error {
  border-left-color: #ef4444;
}

.toast.toast-success {
  border-left-color: #10b981;
}

@keyframes toastSlideUp {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 36px 0;
  margin-top: auto;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: rgba(8, 11, 17, 0.5);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Adaptations
   ========================================================================== */

@media (max-width: 860px) {
  .hero-title {
    font-size: 2.8rem;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Mobile Navigation toggle */
  .mobile-menu-btn {
    display: flex;
  }
  #nav-desktop {
    display: none !important;
  }
  .mobile-nav-drawer {
    display: block;
  }

  /* Hero adjustments */
  .hero {
    padding: 44px 0 30px;
  }
  .hero-title {
    font-size: 2.3rem;
  }
  .hero-subtitle {
    font-size: 1.05rem;
    margin-bottom: 30px;
  }
  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-ctas .nav-btn {
    text-align: center;
    justify-content: center;
  }

  /* Stats cards */
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .stat-card {
    padding: 18px;
  }
  .stat-val {
    font-size: 1.85rem;
  }
  .stat-icon {
    width: 42px;
    height: 42px;
  }

  /* Table toolbar */
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group {
    flex-wrap: wrap;
  }
  .filter-group .select-dropdown {
    flex: 1;
  }

  /* Header & Containers */
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-title {
    font-size: 1.55rem;
  }
  .card-box {
    padding: 22px 18px;
  }

  /* Tabs */
  .tab-item {
    padding: 9px 14px;
    font-size: 0.85rem;
  }

  /* Builder add row */
  .builder-add-row {
    flex-direction: column;
  }
  .builder-add-row .select-dropdown,
  .builder-add-row .input-text,
  .builder-add-row .nav-btn {
    width: 100%;
    max-width: 100% !important;
  }

  /* Type selector pills */
  .type-selector-pills {
    flex-direction: column;
  }
  .type-pill {
    width: 100%;
  }

  /* Modal confirm */
  .modal-confirm-card {
    padding: 28px 20px;
  }
  .modal-confirm-actions {
    flex-direction: column-reverse;
  }

  /* Table scrollable */
  .data-table {
    min-width: 620px;
  }

  /* Toast position */
  .toast-container {
    left: 20px;
    right: 20px;
    bottom: 20px;
  }
  .toast {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  .stats-row {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 1.95rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .modal-card {
    padding: 24px 18px;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}
