/* ================================================================
   BRAND.CSS — Complete Design System
   Music Smartlink + Admin Panel
   Framework : Tailwind CSS (@layer base / components / utilities)
   Font      : Inter (Google Fonts)
   Gradient  : #7B4FD4 (top) → #5B4FCF (bottom)
   Author    : ArtistHub Design System v1.0
   ================================================================ */

/* ── Google Font ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ================================================================
   SECTION 1 — DESIGN TOKENS (CSS Variables)
   ================================================================ */
:root {

  /* ── Brand Gradient ── */
  --brand-top:              #7B4FD4;
  --brand-bottom:           #5B4FCF;
  --brand-mid:              #6A4FD1;
  --brand-gradient:         linear-gradient(180deg, #7B4FD4 0%, #5B4FCF 100%);
  --brand-gradient-h:       linear-gradient(90deg,  #7B4FD4 0%, #5B4FCF 100%);
  --brand-gradient-135:     linear-gradient(135deg, #7B4FD4 0%, #5B4FCF 100%);
  --brand-gradient-radial:  radial-gradient(circle, #7B4FD4 0%, #5B4FCF 100%);

  /* ── Brand Shades ── */
  --brand-50:               #F0EAFF;
  --brand-100:              #D9CCFF;
  --brand-200:              #B590F0;
  --brand-300:              #9B6FE4;
  --brand-400:              #7B4FD4;   /* PRIMARY */
  --brand-500:              #6A4FD1;
  --brand-600:              #5B4FCF;   /* SECONDARY */
  --brand-700:              #4A3DB4;
  --brand-800:              #3D2880;
  --brand-900:              #28184D;
  --brand-950:              #160D2A;

  /* ── Glow / Alpha ── */
  --brand-glow-xs:          rgba(123, 79, 212, 0.12);
  --brand-glow-sm:          rgba(123, 79, 212, 0.22);
  --brand-glow-md:          rgba(123, 79, 212, 0.40);
  --brand-glow-lg:          rgba(123, 79, 212, 0.60);
  --brand-glow-xl:          rgba(123, 79, 212, 0.80);

  /* ── Backgrounds ── */
  --bg-base:                #07070A;
  --bg-surface:             #0E0E14;
  --bg-elevated:            #141420;
  --bg-raised:              #1A1A28;
  --bg-overlay:             rgba(7, 7, 10, 0.92);
  --bg-card:                rgba(255, 255, 255, 0.035);
  --bg-card-hover:          rgba(255, 255, 255, 0.065);
  --bg-glass:               rgba(14, 14, 20, 0.72);
  --bg-glass-light:         rgba(255, 255, 255, 0.05);
  --bg-glass-brand:         rgba(123, 79, 212, 0.10);
  --bg-scrim:               rgba(0, 0, 0, 0.70);

  /* ── Text ── */
  --text-primary:           #FFFFFF;
  --text-secondary:         rgba(255, 255, 255, 0.72);
  --text-muted:             rgba(255, 255, 255, 0.44);
  --text-subtle:            rgba(255, 255, 255, 0.28);
  --text-disabled:          rgba(255, 255, 255, 0.18);
  --text-brand:             #9B6FE4;
  --text-accent:            #B590F0;
  --text-inverse:           #07070A;

  /* ── Borders ── */
  --border-subtle:          rgba(255, 255, 255, 0.06);
  --border-default:         rgba(255, 255, 255, 0.10);
  --border-strong:          rgba(255, 255, 255, 0.18);
  --border-brand:           rgba(123, 79, 212, 0.55);
  --border-brand-sm:        rgba(123, 79, 212, 0.28);
  --border-focus:           #7B4FD4;

  /* ── Semantic Colors ── */
  --color-success:          #22C55E;
  --color-success-bg:       rgba(34, 197, 94, 0.12);
  --color-success-border:   rgba(34, 197, 94, 0.30);
  --color-warning:          #F59E0B;
  --color-warning-bg:       rgba(245, 158, 11, 0.12);
  --color-warning-border:   rgba(245, 158, 11, 0.30);
  --color-error:            #EF4444;
  --color-error-bg:         rgba(239, 68, 68, 0.12);
  --color-error-border:     rgba(239, 68, 68, 0.30);
  --color-info:             #3B82F6;
  --color-info-bg:          rgba(59, 130, 246, 0.12);
  --color-info-border:      rgba(59, 130, 246, 0.30);

  /* ── Shadows ── */
  --shadow-xs:    0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm:    0 1px 4px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-subtle);
  --shadow-md:    0 4px 16px rgba(0, 0, 0, 0.50);
  --shadow-lg:    0 8px 32px rgba(0, 0, 0, 0.60);
  --shadow-xl:    0 16px 56px rgba(0, 0, 0, 0.70);
  --shadow-2xl:   0 24px 80px rgba(0, 0, 0, 0.80);
  --shadow-brand-sm: 0 2px 12px var(--brand-glow-sm);
  --shadow-brand:    0 4px 24px var(--brand-glow-md);
  --shadow-brand-lg: 0 8px 48px var(--brand-glow-lg);
  --shadow-inset:    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --shadow-inset-brand: inset 0 0 0 1px var(--border-brand-sm);

  /* ── Border Radius ── */
  --radius-xs:    3px;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;
  --radius-xl:    20px;
  --radius-2xl:   28px;
  --radius-3xl:   40px;
  --radius-full:  9999px;

  /* ── Typography ── */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --fs-2xs:   10px;
  --fs-xs:    11px;
  --fs-sm:    13px;
  --fs-base:  15px;
  --fs-md:    16px;
  --fs-lg:    18px;
  --fs-xl:    20px;
  --fs-2xl:   24px;
  --fs-3xl:   30px;
  --fs-4xl:   36px;
  --fs-5xl:   48px;
  --fs-6xl:   60px;
  --fs-7xl:   72px;

  --fw-light:      300;
  --fw-regular:    400;
  --fw-medium:     500;
  --fw-semibold:   600;
  --fw-bold:       700;
  --fw-extrabold:  800;
  --fw-black:      900;

  --lh-none:     1;
  --lh-tight:    1.15;
  --lh-snug:     1.30;
  --lh-normal:   1.50;
  --lh-relaxed:  1.65;
  --lh-loose:    1.80;

  --ls-tighter: -0.05em;
  --ls-tight:   -0.03em;
  --ls-snug:    -0.015em;
  --ls-normal:   0em;
  --ls-wide:     0.04em;
  --ls-wider:    0.08em;
  --ls-widest:   0.16em;

  /* ── Transitions ── */
  --ease-linear:   linear;
  --ease-in:       cubic-bezier(0.4, 0.0, 1.0, 1.0);
  --ease-out:      cubic-bezier(0.0, 0.0, 0.2, 1.0);
  --ease-in-out:   cubic-bezier(0.4, 0.0, 0.2, 1.0);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1.0);
  --ease-bounce:   cubic-bezier(0.68, -0.55, 0.27, 1.55);
  --ease-smooth:   cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --dur-instant:  80ms;
  --dur-fast:     150ms;
  --dur-base:     220ms;
  --dur-slow:     360ms;
  --dur-slower:   500ms;
  --dur-slowest:  700ms;

  /* ── Layout ── */
  --sidebar-width:         260px;
  --sidebar-collapsed:      64px;
  --topbar-height:          64px;
  --content-max-width:    1280px;
  --smartlink-max-width:   480px;

  /* ── Z-Index ── */
  --z-below:    -1;
  --z-base:      0;
  --z-raised:   10;
  --z-sticky:   20;
  --z-overlay:  30;
  --z-dropdown: 100;
  --z-modal:    200;
  --z-toast:    300;
  --z-tooltip:  400;

  /* ── Streaming Platforms ── */
  --spotify:         #1DB954;
  --spotify-bg:      rgba(29, 185, 84, 0.12);
  --apple-music:     #FC3C44;
  --apple-music-bg:  rgba(252, 60, 68, 0.12);
  --youtube-music:   #FF0000;
  --youtube-bg:      rgba(255, 0, 0, 0.12);
  --amazon-music:    #00A8E1;
  --amazon-bg:       rgba(0, 168, 225, 0.12);
  --deezer:          #A238FF;
  --deezer-bg:       rgba(162, 56, 255, 0.12);
  --tidal:           #00FFFF;
  --tidal-bg:        rgba(0, 255, 255, 0.10);
  --soundcloud:      #FF5500;
  --soundcloud-bg:   rgba(255, 85, 0, 0.12);
  --gaana:           #E72A31;
  --gaana-bg:        rgba(231, 42, 49, 0.12);
  --jiosaavn:        #2BC5B4;
  --jiosaavn-bg:     rgba(43, 197, 180, 0.12);
  --wynk:            #0057B8;
  --wynk-bg:         rgba(0, 87, 184, 0.12);
  --boomplay:        #F5A623;
  --boomplay-bg:     rgba(245, 166, 35, 0.12);
  --resso:           #FF0050;
  --resso-bg:        rgba(255, 0, 80, 0.12);
  --bandcamp:        #1DA0C3;
  --bandcamp-bg:     rgba(29, 160, 195, 0.12);
  --anghami:         #00B6DE;
  --anghami-bg:      rgba(0, 182, 222, 0.12);
}


/* ================================================================
   SECTION 2 — TAILWIND BASE LAYER
   ================================================================ */
@layer base {

  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border-width: 0;
    border-style: solid;
    border-color: var(--border-subtle);
  }

  html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    tab-size: 2;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--text-primary);
    background-color: var(--bg-base);
    min-height: 100dvh;
    overflow-x: hidden;
  }

  /* Headings */
  h1 {
    font-size: var(--fs-5xl);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
  }
  h2 {
    font-size: var(--fs-4xl);
    font-weight: var(--fw-bold);
    line-height: var(--lh-snug);
    letter-spacing: var(--ls-snug);
  }
  h3 {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-snug);
    letter-spacing: var(--ls-snug);
  }
  h4 {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-snug);
  }
  h5 {
    font-size: var(--fs-xl);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-normal);
  }
  h6 {
    font-size: var(--fs-lg);
    font-weight: var(--fw-medium);
    line-height: var(--lh-normal);
  }

  p {
    color: var(--text-secondary);
    line-height: var(--lh-relaxed);
  }

  a {
    color: inherit;
    text-decoration: none;
    transition: color var(--dur-base) var(--ease-out);
  }

  a:hover { color: var(--brand-300); }

  img, video, svg {
    display: block;
    max-width: 100%;
  }

  button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
  }

  button { cursor: pointer; }

  ul, ol { list-style: none; }

  /* Scrollbar */
  ::-webkit-scrollbar               { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track         { background: transparent; }
  ::-webkit-scrollbar-thumb         {
    background: var(--border-brand-sm);
    border-radius: var(--radius-full);
  }
  ::-webkit-scrollbar-thumb:hover   { background: var(--border-brand); }

  /* Selection */
  ::selection {
    background: rgba(123, 79, 212, 0.38);
    color: var(--text-primary);
  }

  /* Focus ring */
  :focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }

  /* HR */
  hr {
    border-color: var(--border-subtle);
    border-top-width: 1px;
  }

  /* Code */
  code, pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
  }

  code {
    background: var(--bg-glass-brand);
    color: var(--brand-300);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-brand-sm);
  }

  pre {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    overflow-x: auto;
  }

  pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-secondary);
  }

  /* Tables */
  table { width: 100%; border-collapse: collapse; }
  th, td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
  }
  th {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-widest);
    text-transform: uppercase;
    color: var(--text-muted);
  }
}


/* ================================================================
   SECTION 3 — TAILWIND COMPONENTS LAYER
   ================================================================ */
@layer components {

  /* ==============================================================
     3.1 — PAGE BACKGROUNDS & GRAIN TEXTURE
     ============================================================== */

  .bg-page {
    background-color: var(--bg-base);
    background-image:
      radial-gradient(ellipse 90% 60% at 50% -5%,  rgba(123, 79, 212, 0.18) 0%, transparent 65%),
      radial-gradient(ellipse 60% 40% at 85% 100%, rgba(91, 79, 207, 0.12) 0%, transparent 60%);
  }

  .bg-grain::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: var(--z-below);
    opacity: 0.035;
    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");
    background-size: 160px 160px;
  }

  .bg-admin {
    background-color: var(--bg-surface);
    background-image:
      radial-gradient(ellipse 70% 50% at 0% 0%, rgba(123, 79, 212, 0.09) 0%, transparent 55%);
  }


  /* ==============================================================
     3.2 — LAYOUT: ADMIN SHELL
     ============================================================== */

  .admin-shell {
    display: flex;
    min-height: 100dvh;
    background: var(--bg-surface);
  }

  .admin-sidebar {
    width: var(--sidebar-width);
    min-height: 100dvh;
    background: var(--bg-base);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: var(--z-sticky);
    transition: width var(--dur-slow) var(--ease-in-out);
    flex-shrink: 0;
  }

  .admin-sidebar.collapsed {
    width: var(--sidebar-collapsed);
  }

  .admin-topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    height: var(--topbar-height);
    background: rgba(14, 14, 20, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
  }

  .admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100dvh;
    transition: margin-left var(--dur-slow) var(--ease-in-out);
    display: flex;
    flex-direction: column;
  }

  .admin-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
  }

  .admin-main {
    flex: 1;
    padding: 2rem;
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto;
  }

  .admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
  }

  .admin-page-title {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-snug);
    color: var(--text-primary);
  }

  .admin-page-subtitle {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-top: 0.25rem;
  }


  /* ==============================================================
     3.3 — SIDEBAR NAV
     ============================================================== */

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
  }

  .sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--brand-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-brand-sm);
  }

  .sidebar-logo-text {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-tight);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
  }

  .sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.5rem;
    overflow-y: auto;
  }

  .sidebar-section-label {
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-widest);
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: 1rem 0.75rem 0.4rem;
    white-space: nowrap;
    overflow: hidden;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    text-decoration: none;
    transition:
      color var(--dur-base) var(--ease-out),
      background var(--dur-base) var(--ease-out);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
  }

  .nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
  }

  .nav-item.active {
    color: var(--text-primary);
    background: var(--bg-glass-brand);
    font-weight: var(--fw-semibold);
  }

  .nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--brand-gradient);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
  }

  .nav-item-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity var(--dur-base) var(--ease-out);
  }

  .nav-item:hover  .nav-item-icon,
  .nav-item.active .nav-item-icon { opacity: 1; }

  .nav-item-badge {
    margin-left: auto;
    background: var(--brand-gradient);
    color: white;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
  }

  .sidebar-footer {
    padding: 0.75rem 0.5rem;
    border-top: 1px solid var(--border-subtle);
  }


  /* ==============================================================
     3.4 — CARDS
     ============================================================== */

  /* Base Card */
  .card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition:
      background var(--dur-base) var(--ease-out),
      border-color var(--dur-base) var(--ease-out),
      box-shadow var(--dur-base) var(--ease-out);
  }

  .card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-default);
  }

  /* Glass Card */
  .card-glass {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-inset), var(--shadow-lg);
  }

  /* Elevated Card */
  .card-elevated {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
  }

  /* Brand Card */
  .card-brand {
    background: var(--bg-glass-brand);
    border: 1px solid var(--border-brand-sm);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-brand-sm), var(--shadow-inset-brand);
  }

  /* Stat Card (Admin) */
  .stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    transition:
      background var(--dur-base) var(--ease-out),
      border-color var(--dur-base) var(--ease-out),
      transform var(--dur-base) var(--ease-out);
  }

  .stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--brand-gradient-h);
    opacity: 0;
    transition: opacity var(--dur-base) var(--ease-out);
  }

  .stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-brand-sm);
    transform: translateY(-2px);
  }

  .stat-card:hover::before { opacity: 1; }

  .stat-card-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-glass-brand);
    border: 1px solid var(--border-brand-sm);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-300);
  }

  .stat-card-value {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-tight);
    color: var(--text-primary);
    line-height: var(--lh-none);
  }

  .stat-card-label {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-weight: var(--fw-medium);
  }

  .stat-card-delta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    padding: 2px 8px;
    border-radius: var(--radius-full);
  }

  .stat-card-delta.up {
    color: var(--color-success);
    background: var(--color-success-bg);
  }

  .stat-card-delta.down {
    color: var(--color-error);
    background: var(--color-error-bg);
  }


  /* ==============================================================
     3.5 — BUTTONS
     ============================================================== */

  /* Base */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.125rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    transition:
      background var(--dur-base) var(--ease-out),
      color var(--dur-base) var(--ease-out),
      box-shadow var(--dur-base) var(--ease-out),
      transform var(--dur-fast) var(--ease-out),
      opacity var(--dur-base) var(--ease-out);
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    overflow: hidden;
  }

  .btn:active { transform: scale(0.97); }
  .btn:disabled {
    opacity: 0.38;
    pointer-events: none;
    cursor: not-allowed;
  }

  /* Ripple shimmer */
  .btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform var(--dur-slower) var(--ease-out);
  }
  .btn:hover::after { transform: translateX(100%); }

  /* Primary */
  .btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: var(--shadow-brand-sm);
  }
  .btn-primary:hover {
    box-shadow: var(--shadow-brand);
    filter: brightness(1.08);
  }

  /* Secondary */
  .btn-secondary {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-xs);
  }
  .btn-secondary:hover {
    background: rgba(255,255,255,0.10);
    border-color: var(--border-strong);
  }

  /* Ghost */
  .btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
  }
  .btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-subtle);
  }

  /* Ghost Brand */
  .btn-ghost-brand {
    background: var(--bg-glass-brand);
    color: var(--brand-300);
    border: 1px solid var(--border-brand-sm);
  }
  .btn-ghost-brand:hover {
    background: rgba(123, 79, 212, 0.18);
    border-color: var(--border-brand);
    color: var(--brand-200);
    box-shadow: var(--shadow-brand-sm);
  }

  /* Danger */
  .btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-error);
    border: 1px solid var(--color-error-border);
  }
  .btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
  }

  /* Success */
  .btn-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
  }
  .btn-success:hover {
    background: rgba(34, 197, 94, 0.25);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.25);
  }

  /* Sizes */
  .btn-xs  { font-size: var(--fs-2xs); padding: 0.375rem 0.75rem; border-radius: var(--radius-sm); }
  .btn-sm  { font-size: var(--fs-xs);  padding: 0.5rem 0.875rem; }
  .btn-lg  { font-size: var(--fs-md);  padding: 0.875rem 1.5rem; border-radius: var(--radius-lg); }
  .btn-xl  { font-size: var(--fs-lg);  padding: 1rem 2rem; border-radius: var(--radius-xl); }

  /* Full width */
  .btn-block { width: 100%; }

  /* Icon only */
  .btn-icon {
    padding: 0.625rem;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
  }
  .btn-icon.btn-sm { padding: 0.5rem; }
  .btn-icon.btn-lg { padding: 0.75rem; border-radius: var(--radius-lg); }

  /* Pill */
  .btn-pill { border-radius: var(--radius-full); }

  /* Loading state */
  .btn.loading {
    color: transparent;
    pointer-events: none;
  }
  .btn.loading::before {
    content: '';
    position: absolute;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
  }


  /* ==============================================================
     3.6 — FORM ELEMENTS
     ============================================================== */

  .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .form-label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
  }

  .form-label-required::after {
    content: '*';
    color: var(--color-error);
    font-size: var(--fs-xs);
  }

  .form-hint {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    line-height: var(--lh-snug);
  }

  .form-error {
    font-size: var(--fs-xs);
    color: var(--color-error);
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  /* Input */
  .input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: var(--fw-regular);
    padding: 0.625rem 0.875rem;
    line-height: var(--lh-normal);
    transition:
      border-color var(--dur-base) var(--ease-out),
      box-shadow var(--dur-base) var(--ease-out),
      background var(--dur-base) var(--ease-out);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
  }

  .input::placeholder { color: var(--text-subtle); }

  .input:hover {
    border-color: var(--border-strong);
    background: var(--bg-raised);
  }

  .input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--brand-glow-xs);
    background: var(--bg-raised);
  }

  .input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
  }

  .input.error {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px var(--color-error-bg);
  }

  .input.success {
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px var(--color-success-bg);
  }

  /* Input sizes */
  .input-sm { font-size: var(--fs-xs);  padding: 0.5rem 0.75rem;  border-radius: var(--radius-sm); }
  .input-lg { font-size: var(--fs-md);  padding: 0.75rem 1rem;    border-radius: var(--radius-lg); }

  /* Input with icon */
  .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
  }

  .input-wrapper .input { padding-left: 2.5rem; }
  .input-wrapper .input-icon-left {
    position: absolute;
    left: 0.875rem;
    color: var(--text-muted);
    pointer-events: none;
    width: 16px;
    height: 16px;
  }
  .input-wrapper .input-icon-right {
    position: absolute;
    right: 0.875rem;
    color: var(--text-muted);
    width: 16px;
    height: 16px;
  }
  .input-wrapper.has-right .input { padding-right: 2.5rem; }

  /* Textarea */
  .textarea {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    padding: 0.75rem 0.875rem;
    line-height: var(--lh-relaxed);
    resize: vertical;
    min-height: 96px;
    outline: none;
    transition:
      border-color var(--dur-base) var(--ease-out),
      box-shadow var(--dur-base) var(--ease-out);
  }

  .textarea::placeholder { color: var(--text-subtle); }
  .textarea:hover  { border-color: var(--border-strong); }
  .textarea:focus  {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--brand-glow-xs);
  }

  /* Select */
  .select {
    width: 100%;
    background: var(--bg-elevated);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition:
      border-color var(--dur-base) var(--ease-out),
      box-shadow var(--dur-base) var(--ease-out);
  }

  .select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--brand-glow-xs);
  }

  .select option { background: var(--bg-elevated); color: var(--text-primary); }

  /* Checkbox */
  .checkbox {
    width: 16px;
    height: 16px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-xs);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    flex-shrink: 0;
    display: grid;
    place-content: center;
    transition:
      background var(--dur-base) var(--ease-out),
      border-color var(--dur-base) var(--ease-out);
  }

  .checkbox:checked {
    background: var(--brand-gradient);
    border-color: transparent;
  }

  .checkbox:checked::before {
    content: '';
    width: 9px;
    height: 6px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translate(1px, -1px);
    display: block;
  }

  .checkbox:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

  /* Radio */
  .radio {
    width: 16px;
    height: 16px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-default);
    border-radius: 50%;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    flex-shrink: 0;
    display: grid;
    place-content: center;
    transition:
      background var(--dur-base) var(--ease-out),
      border-color var(--dur-base) var(--ease-out);
  }

  .radio:checked { border-color: var(--brand-top); }
  .radio:checked::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--brand-gradient);
    border-radius: 50%;
  }

  /* Toggle / Switch */
  .toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
  }

  .toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
  }

  .toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-raised);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  }

  .toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform var(--dur-base) var(--ease-spring), background var(--dur-base) var(--ease-out);
  }

  .toggle input:checked + .toggle-slider {
    background: var(--bg-glass-brand);
    border-color: var(--border-brand);
  }

  .toggle input:checked + .toggle-slider::before {
    transform: translate(18px, -50%);
    background: var(--brand-gradient);
    box-shadow: var(--shadow-brand-sm);
  }

  /* Input Group */
  .input-group {
    display: flex;
    align-items: stretch;
  }

  .input-group .input {
    border-radius: 0;
    flex: 1;
  }

  .input-group-prefix,
  .input-group-suffix {
    display: flex;
    align-items: center;
    padding: 0 0.875rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .input-group-prefix { border-right: none; border-radius: var(--radius-md) 0 0 var(--radius-md); }
  .input-group-suffix { border-left:  none; border-radius: 0 var(--radius-md) var(--radius-md) 0; }

  .input-group .input:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
  .input-group .input:last-child  { border-radius: 0 var(--radius-md) var(--radius-md) 0; }


  /* ==============================================================
     3.7 — BADGES & TAGS
     ============================================================== */

  .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wide);
    white-space: nowrap;
    line-height: 1.4;
  }

  .badge-brand    { background: var(--bg-glass-brand);     color: var(--brand-300);       border: 1px solid var(--border-brand-sm); }
  .badge-success  { background: var(--color-success-bg);   color: var(--color-success);   border: 1px solid var(--color-success-border); }
  .badge-warning  { background: var(--color-warning-bg);   color: var(--color-warning);   border: 1px solid var(--color-warning-border); }
  .badge-error    { background: var(--color-error-bg);     color: var(--color-error);     border: 1px solid var(--color-error-border); }
  .badge-info     { background: var(--color-info-bg);      color: var(--color-info);      border: 1px solid var(--color-info-border); }
  .badge-muted    { background: var(--bg-elevated);        color: var(--text-muted);      border: 1px solid var(--border-default); }

  .badge-dot::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
  }

  .tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    transition:
      background var(--dur-base) var(--ease-out),
      border-color var(--dur-base) var(--ease-out),
      color var(--dur-base) var(--ease-out);
  }

  .tag:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
  }

  .tag-remove {
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color var(--dur-fast) var(--ease-out);
  }
  .tag-remove:hover { color: var(--color-error); }


  /* ==============================================================
     3.8 — ALERTS & NOTIFICATIONS
     ============================================================== */

  .alert {
    display: flex;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    border-radius: var(--radius-md);
    border-left-width: 3px;
    border-left-style: solid;
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
  }

  .alert-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
  }

  .alert-content { flex: 1; }
  .alert-title   { font-weight: var(--fw-semibold); margin-bottom: 0.2rem; }
  .alert-body    { color: inherit; opacity: 0.85; }

  .alert-brand   { background: var(--bg-glass-brand);    border-color: var(--brand-top);       color: var(--brand-200); }
  .alert-success { background: var(--color-success-bg);  border-color: var(--color-success);   color: var(--color-success); }
  .alert-warning { background: var(--color-warning-bg);  border-color: var(--color-warning);   color: var(--color-warning); }
  .alert-error   { background: var(--color-error-bg);    border-color: var(--color-error);     color: var(--color-error); }
  .alert-info    { background: var(--color-info-bg);     border-color: var(--color-info);      color: var(--color-info); }

  /* Toast */
  .toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
  }

  .toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    background: var(--bg-raised);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    font-size: var(--fs-sm);
    max-width: 360px;
    pointer-events: all;
    animation: slide-in-right var(--dur-slow) var(--ease-spring);
  }

  .toast.success { border-left: 3px solid var(--color-success); }
  .toast.warning { border-left: 3px solid var(--color-warning); }
  .toast.error   { border-left: 3px solid var(--color-error); }
  .toast.info    { border-left: 3px solid var(--brand-top); }


  /* ==============================================================
     3.9 — MODAL & DRAWER
     ============================================================== */

  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-scrim);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fade-in var(--dur-base) var(--ease-out);
  }

  .modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 520px;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scale-in var(--dur-slow) var(--ease-spring);
  }

  .modal-sm { max-width: 380px; }
  .modal-lg { max-width: 720px; }
  .modal-xl { max-width: 960px; }

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 0;
    flex-shrink: 0;
  }

  .modal-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-snug);
  }

  .modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  }

  .modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

  .modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
  }

  .modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0 1.5rem 1.5rem;
    flex-shrink: 0;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
    margin-top: 0.5rem;
  }

  /* Drawer */
  .drawer-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-scrim);
    z-index: var(--z-modal);
    animation: fade-in var(--dur-base) var(--ease-out);
  }

  .drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border-default);
    box-shadow: var(--shadow-2xl);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    animation: slide-in-right var(--dur-slow) var(--ease-spring);
  }

  .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
  }

  .drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
  }

  .drawer-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
  }


  /* ==============================================================
     3.10 — DATA TABLE (Admin)
     ============================================================== */

  .table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  .table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    gap: 1rem;
    flex-wrap: wrap;
  }

  .table-header-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
  }

  .data-table {
    width: 100%;
    border-collapse: collapse;
  }

  .data-table thead { background: var(--bg-elevated); }

  .data-table th {
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-widest);
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
    white-space: nowrap;
  }

  .data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color var(--dur-fast) var(--ease-out);
  }
  .data-table th.sortable:hover { color: var(--text-primary); }

  .data-table td {
    padding: 0.875rem 1.25rem;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
  }

  .data-table tbody tr {
    transition: background var(--dur-fast) var(--ease-out);
  }
  .data-table tbody tr:hover { background: var(--bg-card-hover); }
  .data-table tbody tr:last-child td { border-bottom: none; }

  .data-table td.primary-col {
    color: var(--text-primary);
    font-weight: var(--fw-medium);
  }

  .table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  /* Pagination */
  .pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition:
      background var(--dur-base) var(--ease-out),
      color var(--dur-base) var(--ease-out),
      border-color var(--dur-base) var(--ease-out);
  }

  .page-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-default);
  }

  .page-btn.active {
    background: var(--brand-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-brand-sm);
  }

  .page-btn:disabled { opacity: 0.35; pointer-events: none; }


  /* ==============================================================
     3.11 — TABS
     ============================================================== */

  .tabs {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    gap: 0.25rem;
  }

  .tab-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition:
      color var(--dur-base) var(--ease-out),
      border-color var(--dur-base) var(--ease-out);
    white-space: nowrap;
  }

  .tab-item:hover  { color: var(--text-secondary); }
  .tab-item.active {
    color: var(--text-primary);
    border-bottom-color: var(--brand-top);
    font-weight: var(--fw-semibold);
  }

  /* Pill Tabs */
  .tabs-pills {
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 2px;
  }

  .tab-pill {
    padding: 0.5rem 1rem;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition:
      background var(--dur-base) var(--ease-out),
      color var(--dur-base) var(--ease-out),
      box-shadow var(--dur-base) var(--ease-out);
  }

  .tab-pill:hover  { color: var(--text-primary); }
  .tab-pill.active {
    background: var(--brand-gradient);
    color: white;
    font-weight: var(--fw-semibold);
    box-shadow: var(--shadow-brand-sm);
  }


  /* ==============================================================
     3.12 — DROPDOWN MENU
     ============================================================== */

  .dropdown {
    position: relative;
    display: inline-block;
  }

  .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.375rem;
    z-index: var(--z-dropdown);
    animation: scale-in var(--dur-base) var(--ease-spring);
    transform-origin: top right;
  }

  .dropdown-menu.left { right: auto; left: 0; transform-origin: top left; }

  .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition:
      background var(--dur-fast) var(--ease-out),
      color var(--dur-fast) var(--ease-out);
    text-decoration: none;
  }

  .dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
  }

  .dropdown-item.danger { color: var(--color-error); }
  .dropdown-item.danger:hover { background: var(--color-error-bg); }

  .dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.375rem 0;
  }

  .dropdown-label {
    padding: 0.25rem 0.75rem;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--text-subtle);
  }


  /* ==============================================================
     3.13 — AVATAR
     ============================================================== */

  .avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-glass-brand);
    color: var(--brand-300);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wide);
    border: 2px solid var(--border-default);
    position: relative;
  }

  .avatar-xs  { width: 24px;  height: 24px;  font-size: var(--fs-2xs); }
  .avatar-sm  { width: 32px;  height: 32px;  font-size: var(--fs-xs);  }
  .avatar     { width: 40px;  height: 40px;  font-size: var(--fs-sm);  }
  .avatar-lg  { width: 48px;  height: 48px;  font-size: var(--fs-md);  }
  .avatar-xl  { width: 64px;  height: 64px;  font-size: var(--fs-xl);  }
  .avatar-2xl { width: 96px;  height: 96px;  font-size: var(--fs-3xl); }

  .avatar img { width: 100%; height: 100%; object-fit: cover; }

  .avatar-status {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-elevated);
  }

  .avatar-status.online  { background: var(--color-success); }
  .avatar-status.offline { background: var(--text-subtle); }
  .avatar-status.busy    { background: var(--color-error); }

  .avatar-group {
    display: flex;
    align-items: center;
  }
  .avatar-group .avatar { margin-left: -8px; border: 2px solid var(--bg-elevated); }
  .avatar-group .avatar:first-child { margin-left: 0; }


  /* ==============================================================
     3.14 — PROGRESS BAR
     ============================================================== */

  .progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
  }

  .progress-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--fs-xs);
    color: var(--text-muted);
  }

  .progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
  }

  .progress-fill {
    height: 100%;
    background: var(--brand-gradient-h);
    border-radius: var(--radius-full);
    transition: width var(--dur-slower) var(--ease-out);
    position: relative;
    overflow: hidden;
  }

  .progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: shimmer 2s infinite;
  }

  .progress-bar.sm { height: 4px; }
  .progress-bar.lg { height: 10px; }

  .progress-fill.success { background: linear-gradient(90deg, #16a34a, #22c55e); }
  .progress-fill.warning { background: linear-gradient(90deg, #d97706, #f59e0b); }
  .progress-fill.error   { background: linear-gradient(90deg, #dc2626, #ef4444); }


  /* ==============================================================
     3.15 — SKELETON LOADERS
     ============================================================== */

  .skeleton {
    background: linear-gradient(
      90deg,
      var(--bg-elevated) 25%,
      var(--bg-raised)   50%,
      var(--bg-elevated) 75%
    );
    background-size: 400% 100%;
    animation: skeleton-wave 1.6s ease-in-out infinite;
    border-radius: var(--radius-sm);
  }

  .skeleton-text { height: 14px; border-radius: var(--radius-full); }
  .skeleton-text.lg { height: 20px; }
  .skeleton-text.xl { height: 28px; }
  .skeleton-circle { border-radius: 50%; }
  .skeleton-card {
    height: 120px;
    border-radius: var(--radius-lg);
  }


  /* ==============================================================
     3.16 — TOOLTIP
     ============================================================== */

  [data-tooltip] {
    position: relative;
  }

  [data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-raised);
    color: var(--text-secondary);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    z-index: var(--z-tooltip);
    box-shadow: var(--shadow-md);
    transition: opacity var(--dur-fast) var(--ease-out);
  }

  [data-tooltip]:hover::before { opacity: 1; }


  /* ==============================================================
     3.17 — BREADCRUMB
     ============================================================== */

  .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    flex-wrap: wrap;
  }

  .breadcrumb-sep { color: var(--text-subtle); font-size: var(--fs-xs); }

  .breadcrumb a {
    color: var(--text-muted);
    transition: color var(--dur-fast) var(--ease-out);
  }
  .breadcrumb a:hover { color: var(--text-primary); }
  .breadcrumb-current { color: var(--text-primary); font-weight: var(--fw-medium); }


  /* ==============================================================
     3.18 — EMPTY STATE
     ============================================================== */

  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    gap: 1rem;
  }

  .empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-glass-brand);
    border: 1px solid var(--border-brand-sm);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-300);
    margin-bottom: 0.5rem;
  }

  .empty-state-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
  }

  .empty-state-desc {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    max-width: 360px;
    line-height: var(--lh-relaxed);
  }


  /* ==============================================================
     3.19 — SMARTLINK PAGE
     ============================================================== */

  .smartlink-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
  }

  /* Dynamic background from cover art */
  .smartlink-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
  }

  .smartlink-bg-image {
    position: absolute;
    inset: -20%;
    background-size: cover;
    background-position: center;
    filter: blur(80px) saturate(180%);
    opacity: 0.25;
    transform: scale(1.3);
  }

  .smartlink-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      180deg,
      rgba(7, 7, 10, 0.70) 0%,
      rgba(7, 7, 10, 0.85) 50%,
      rgba(7, 7, 10, 0.95) 100%
    );
  }

  /* Card */
  .smartlink-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--smartlink-max-width);
    background: var(--bg-glass);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-2xl), var(--shadow-inset);
    animation: card-rise var(--dur-slowest) var(--ease-spring);
  }

  /* Cover Art */
  .smartlink-cover-wrap {
    position: relative;
    padding: 2rem 2rem 0;
    display: flex;
    justify-content: center;
  }

  .smartlink-cover {
    width: 180px;
    height: 180px;
    border-radius: var(--radius-xl);
    object-fit: cover;
    box-shadow:
      0 0 0 1px var(--border-default),
      var(--shadow-brand),
      var(--shadow-2xl);
    flex-shrink: 0;
    animation: cover-pop var(--dur-slowest) var(--ease-spring) 0.1s both;
  }

  .smartlink-cover-square { border-radius: var(--radius-xl); }
  .smartlink-cover-round  { border-radius: 50%; }

  /* Track info */
  .smartlink-info {
    text-align: center;
    padding: 1.5rem 2rem 0.75rem;
    animation: fade-up var(--dur-slow) var(--ease-out) 0.2s both;
  }

  .smartlink-track-title {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-tight);
    color: var(--text-primary);
    line-height: var(--lh-snug);
    margin-bottom: 0.375rem;
  }

  .smartlink-artist-name {
    font-size: var(--fs-md);
    color: var(--text-secondary);
    font-weight: var(--fw-medium);
  }

  .smartlink-release-type {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-glass-brand);
    border: 1px solid var(--border-brand-sm);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--brand-300);
  }

  /* Divider */
  .smartlink-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 2rem;
    margin: 0.5rem 0;
  }

  .smartlink-divider-line {
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
  }

  .smartlink-divider-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-widest);
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
  }

  /* Platform Links */
  .smartlink-links {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.75rem 1.5rem 2rem;
    animation: fade-up var(--dur-slow) var(--ease-out) 0.3s both;
  }

  .platform-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    transition:
      background var(--dur-base) var(--ease-out),
      border-color var(--dur-base) var(--ease-out),
      transform var(--dur-fast) var(--ease-out),
      box-shadow var(--dur-base) var(--ease-out);
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }

  .platform-btn::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--platform-color, var(--brand-top));
    opacity: 0;
    transition: opacity var(--dur-base) var(--ease-out);
  }

  .platform-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-default);
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
  }

  .platform-btn:hover::before { opacity: 1; }

  .platform-btn:active { transform: translateX(1px) scale(0.99); }

  .platform-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--platform-bg, var(--bg-glass-brand));
    font-size: 1.125rem;
  }

  .platform-btn-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .platform-btn-name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    line-height: 1;
  }

  .platform-btn-action {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-weight: var(--fw-regular);
  }

  .platform-btn-arrow {
    color: var(--text-subtle);
    flex-shrink: 0;
    transition: color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  }
  .platform-btn:hover .platform-btn-arrow {
    color: var(--text-muted);
    transform: translateX(2px);
  }

  /* Platform color modifiers */
  .platform-spotify     { --platform-color: var(--spotify);      --platform-bg: var(--spotify-bg); }
  .platform-apple       { --platform-color: var(--apple-music);  --platform-bg: var(--apple-music-bg); }
  .platform-youtube     { --platform-color: var(--youtube-music); --platform-bg: var(--youtube-bg); }
  .platform-amazon      { --platform-color: var(--amazon-music); --platform-bg: var(--amazon-bg); }
  .platform-deezer      { --platform-color: var(--deezer);       --platform-bg: var(--deezer-bg); }
  .platform-tidal       { --platform-color: var(--tidal);        --platform-bg: var(--tidal-bg); }
  .platform-soundcloud  { --platform-color: var(--soundcloud);   --platform-bg: var(--soundcloud-bg); }
  .platform-gaana       { --platform-color: var(--gaana);        --platform-bg: var(--gaana-bg); }
  .platform-jiosaavn    { --platform-color: var(--jiosaavn);     --platform-bg: var(--jiosaavn-bg); }
  .platform-wynk        { --platform-color: var(--wynk);         --platform-bg: var(--wynk-bg); }
  .platform-boomplay    { --platform-color: var(--boomplay);     --platform-bg: var(--boomplay-bg); }
  .platform-resso       { --platform-color: var(--resso);        --platform-bg: var(--resso-bg); }
  .platform-bandcamp    { --platform-color: var(--bandcamp);     --platform-bg: var(--bandcamp-bg); }
  .platform-anghami     { --platform-color: var(--anghami);      --platform-bg: var(--anghami-bg); }

  /* Smartlink Footer */
  .smartlink-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border-subtle);
    font-size: var(--fs-xs);
    color: var(--text-subtle);
  }

  .smartlink-branding {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--brand-300);
    font-weight: var(--fw-semibold);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
  }
  .smartlink-branding:hover { color: var(--brand-200); }


  /* ==============================================================
     3.20 — SMARTLINK BUILDER (Admin)
     ============================================================== */

  .builder-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
  }

  .builder-preview {
    position: sticky;
    top: calc(var(--topbar-height) + 1rem);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .builder-preview-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--text-muted);
  }

  /* Platform drag row (smartlink editor) */
  .platform-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition:
      background var(--dur-fast) var(--ease-out),
      border-color var(--dur-fast) var(--ease-out);
    cursor: grab;
  }

  .platform-row:hover { border-color: var(--border-default); }
  .platform-row.dragging {
    opacity: 0.5;
    cursor: grabbing;
    box-shadow: var(--shadow-lg);
  }

  .platform-row-handle {
    color: var(--text-subtle);
    cursor: grab;
    flex-shrink: 0;
  }

  .platform-row-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .platform-row-name {
    flex: 1;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-primary);
  }


  /* ==============================================================
     3.21 — ANALYTICS CHARTS (Admin)
     ============================================================== */

  .chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  .chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .chart-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
  }

  .chart-body {
    padding: 1.5rem;
    min-height: 200px;
  }

  .chart-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0 1.5rem 1.25rem;
  }

  .chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--fs-xs);
    color: var(--text-muted);
  }

  .chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }


  /* ==============================================================
     3.22 — SEARCH BAR
     ============================================================== */

  .search-bar {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    transition:
      border-color var(--dur-base) var(--ease-out),
      box-shadow var(--dur-base) var(--ease-out),
      background var(--dur-base) var(--ease-out);
  }

  .search-bar:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--brand-glow-xs);
    background: var(--bg-raised);
  }

  .search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
  }
  .search-bar input::placeholder { color: var(--text-subtle); }

  .search-bar-icon { color: var(--text-muted); flex-shrink: 0; }
  .search-bar-clear {
    color: var(--text-subtle);
    cursor: pointer;
    flex-shrink: 0;
    transition: color var(--dur-fast) var(--ease-out);
  }
  .search-bar-clear:hover { color: var(--text-secondary); }


  /* ==============================================================
     3.23 — USER PROFILE ROW
     ============================================================== */

  .user-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    transition: background var(--dur-fast) var(--ease-out);
    cursor: pointer;
  }

  .user-row:hover { background: var(--bg-card-hover); }

  .user-row-info { flex: 1; min-width: 0; }
  .user-row-name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .user-row-sub {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }


  /* ==============================================================
     3.24 — GRADIENT TEXT & DECORATORS
     ============================================================== */

  .text-gradient {
    background: var(--brand-gradient-h);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .text-gradient-135 {
    background: var(--brand-gradient-135);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .gradient-border {
    position: relative;
  }

  .gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--brand-gradient);
    -webkit-mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
  }

  .gradient-bg {
    background: var(--brand-gradient);
  }

  .gradient-bg-h {
    background: var(--brand-gradient-h);
  }

  .glow-brand {
    box-shadow: var(--shadow-brand);
  }

  .glow-brand-lg {
    box-shadow: var(--shadow-brand-lg);
  }


  /* ==============================================================
     3.25 — DIVIDERS
     ============================================================== */

  .divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-subtle);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
  }

  .divider::before,
  .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
  }


  /* ==============================================================
     3.26 — SECTION HEADINGS (Admin)
     ============================================================== */

  .section-heading {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
  }

  .section-heading-bar {
    width: 3px;
    height: 20px;
    background: var(--brand-gradient);
    border-radius: var(--radius-full);
    flex-shrink: 0;
  }

  .section-heading-text {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-snug);
  }


  /* ==============================================================
     3.27 — GRID LAYOUTS
     ============================================================== */

  .grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
  }

  .grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
  .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

}
/* end @layer components */


/* ================================================================
   SECTION 4 — TAILWIND UTILITIES LAYER
   ================================================================ */
@layer utilities {

  /* Flex shortcuts */
  .flex-center   { display: flex; align-items: center; justify-content: center; }
  .flex-between  { display: flex; align-items: center; justify-content: space-between; }
  .flex-start    { display: flex; align-items: center; justify-content: flex-start; }
  .flex-end      { display: flex; align-items: center; justify-content: flex-end; }
  .flex-col-center { display: flex; flex-direction: column; align-items: center; justify-content: center; }

  /* Text utilities */
  .text-xs-caps {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-widest);
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .text-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Spacing helpers */
  .gap-xs  { gap: 0.375rem; }
  .gap-sm  { gap: 0.625rem; }
  .gap-md  { gap: 1rem;     }
  .gap-lg  { gap: 1.5rem;   }
  .gap-xl  { gap: 2rem;     }
  .gap-2xl { gap: 3rem;     }

  /* Visibility */
  .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;
  }

  /* Pointer */
  .cursor-grab    { cursor: grab; }
  .cursor-pointer { cursor: pointer; }
  .no-select      { user-select: none; -webkit-user-select: none; }

  /* Overflow */
  .scroll-smooth { scroll-behavior: smooth; }
  .overflow-x-scroll { overflow-x: auto; }
  .overflow-y-scroll { overflow-y: auto; }
  .overflow-hidden { overflow: hidden; }

  /* Transitions */
  .transition-all  { transition: all var(--dur-base) var(--ease-out); }
  .transition-fast { transition: all var(--dur-fast) var(--ease-out); }
  .transition-slow { transition: all var(--dur-slow) var(--ease-out); }

  /* Borders */
  .border-brand   { border: 1px solid var(--border-brand); }
  .border-default { border: 1px solid var(--border-default); }
  .border-subtle  { border: 1px solid var(--border-subtle); }
  .border-top     { border-top: 1px solid var(--border-subtle); }
  .border-bottom  { border-bottom: 1px solid var(--border-subtle); }

  /* Background utilities */
  .bg-base       { background: var(--bg-base); }
  .bg-surface    { background: var(--bg-surface); }
  .bg-elevated   { background: var(--bg-elevated); }
  .bg-card       { background: var(--bg-card); }
  .bg-glass      { background: var(--bg-glass); backdrop-filter: var(--blur-md); -webkit-backdrop-filter: var(--blur-md); }
  .bg-glass-brand { background: var(--bg-glass-brand); }

  /* Rounded */
  .rounded-sm   { border-radius: var(--radius-sm); }
  .rounded-md   { border-radius: var(--radius-md); }
  .rounded-lg   { border-radius: var(--radius-lg); }
  .rounded-xl   { border-radius: var(--radius-xl); }
  .rounded-2xl  { border-radius: var(--radius-2xl); }
  .rounded-full { border-radius: var(--radius-full); }

  /* Shadows */
  .shadow-sm       { box-shadow: var(--shadow-sm); }
  .shadow-md       { box-shadow: var(--shadow-md); }
  .shadow-lg       { box-shadow: var(--shadow-lg); }
  .shadow-xl       { box-shadow: var(--shadow-xl); }
  .shadow-brand    { box-shadow: var(--shadow-brand); }
  .shadow-brand-lg { box-shadow: var(--shadow-brand-lg); }

  /* Position helpers */
  .inset-0    { inset: 0; }
  .z-raised   { z-index: var(--z-raised); }
  .z-sticky   { z-index: var(--z-sticky); }
  .z-overlay  { z-index: var(--z-overlay); }
  .z-dropdown { z-index: var(--z-dropdown); }
  .z-modal    { z-index: var(--z-modal); }
  .z-toast    { z-index: var(--z-toast); }

  /* Number/stat display */
  .num-display {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    letter-spacing: var(--ls-tight);
    font-weight: var(--fw-semibold);
  }

  /* Color text helpers */
  .text-primary   { color: var(--text-primary); }
  .text-secondary { color: var(--text-secondary); }
  .text-muted     { color: var(--text-muted); }
  .text-subtle    { color: var(--text-subtle); }
  .text-brand     { color: var(--text-brand); }
  .text-success   { color: var(--color-success); }
  .text-warning   { color: var(--color-warning); }
  .text-error     { color: var(--color-error); }
  .text-info      { color: var(--color-info); }

  /* Aspect ratios */
  .aspect-square  { aspect-ratio: 1 / 1; }
  .aspect-video   { aspect-ratio: 16 / 9; }
  .aspect-cover   { aspect-ratio: 1 / 1; object-fit: cover; }

  /* Max widths */
  .max-w-smartlink { max-width: var(--smartlink-max-width); }
  .max-w-content   { max-width: var(--content-max-width); }
}
/* end @layer utilities */


/* ================================================================
   SECTION 5 — KEYFRAME ANIMATIONS
   ================================================================ */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@keyframes cover-pop {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes skeleton-wave {
  0%   { background-position: 100% 50%; }
  100% { background-position:   0% 50%; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--shadow-brand-sm); }
  50%       { box-shadow: var(--shadow-brand-lg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

@keyframes bounce-dot {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

/* Animation utility classes */
.animate-fade-in    { animation: fade-in      var(--dur-base) var(--ease-out) both; }
.animate-fade-up    { animation: fade-up      var(--dur-slow) var(--ease-out) both; }
.animate-scale-in   { animation: scale-in     var(--dur-slow) var(--ease-spring) both; }
.animate-slide-right { animation: slide-in-right var(--dur-slow) var(--ease-spring) both; }
.animate-pulse-glow { animation: pulse-glow   2.5s var(--ease-in-out) infinite; }
.animate-float      { animation: float        3s   var(--ease-in-out) infinite; }
.animate-spin       { animation: spin         0.7s linear infinite; }
.animate-shimmer    { animation: shimmer      1.8s var(--ease-in-out) infinite; }

/* Stagger delays */
.delay-75   { animation-delay:  75ms; }
.delay-100  { animation-delay: 100ms; }
.delay-150  { animation-delay: 150ms; }
.delay-200  { animation-delay: 200ms; }
.delay-300  { animation-delay: 300ms; }
.delay-400  { animation-delay: 400ms; }
.delay-500  { animation-delay: 500ms; }


/* ================================================================
   SECTION 6 — RESPONSIVE BREAKPOINTS
   ================================================================ */

/* Mobile  ≤ 640px */
@media (max-width: 640px) {
  :root {
    --sidebar-width: 100%;
    --topbar-height: 56px;
  }

  h1 { font-size: var(--fs-4xl); }
  h2 { font-size: var(--fs-3xl); }
  h3 { font-size: var(--fs-2xl); }

  .admin-shell        { flex-direction: column; }
  .admin-sidebar      { position: fixed; bottom: 0; top: auto; left: 0; right: 0; min-height: unset; height: 60px; flex-direction: row; width: 100%; border-right: none; border-top: 1px solid var(--border-subtle); }
  .admin-content      { margin-left: 0; padding-bottom: 60px; }
  .admin-main         { padding: 1rem; }
  .admin-page-header  { gap: 0.75rem; }

  .builder-layout     { grid-template-columns: 1fr; }
  .builder-preview    { position: relative; top: auto; }

  .modal              { border-radius: var(--radius-xl); margin: 0.5rem; }
  .drawer             { width: 100%; border-left: none; border-top: 1px solid var(--border-default); border-radius: var(--radius-xl) var(--radius-xl) 0 0; top: auto; height: 90dvh; animation: fade-up var(--dur-slow) var(--ease-spring); }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }

  .smartlink-cover    { width: 140px; height: 140px; }
  .smartlink-links    { padding: 0.75rem 1rem 1.5rem; }
  .smartlink-info     { padding: 1.25rem 1rem 0.5rem; }

  .toast-container    { bottom: 1rem; left: 1rem; right: 1rem; }
  .toast              { max-width: 100%; }

  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tab-item { flex-shrink: 0; }
}

/* Tablet  641px – 1024px */
@media (min-width: 641px) and (max-width: 1024px) {
  .admin-sidebar      { width: var(--sidebar-collapsed); }
  .admin-content      { margin-left: var(--sidebar-collapsed); }
  .sidebar-logo-text,
  .sidebar-section-label,
  .nav-item > span,
  .nav-item-badge     { display: none; }

  .grid-3, .grid-4   { grid-template-columns: repeat(2, 1fr); }
  .grid-stats         { grid-template-columns: repeat(2, 1fr); }

  .builder-layout     { grid-template-columns: 1fr 340px; }
}

/* Desktop  ≥ 1025px */
@media (min-width: 1025px) {
  .grid-stats { grid-template-columns: repeat(4, 1fr); }
}

/* Large desktop ≥ 1400px */
@media (min-width: 1400px) {
  .admin-main { padding: 2.5rem 3rem; }
}


/* ================================================================
   SECTION 7 — ACCESSIBILITY & PRINT
   ================================================================ */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:   0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.01ms !important;
  }

  .smartlink-bg-image { filter: blur(80px); }
}

/* High contrast */
@media (prefers-contrast: high) {
  :root {
    --border-default: rgba(255,255,255,0.30);
    --border-subtle:  rgba(255,255,255,0.18);
    --text-secondary: rgba(255,255,255,0.90);
    --text-muted:     rgba(255,255,255,0.65);
  }
}

/* Print */
@media print {
  body {
    background: white;
    color: black;
  }

  .admin-sidebar,
  .admin-topbar,
  .modal-backdrop,
  .toast-container { display: none !important; }

  .admin-content { margin-left: 0; }

  .card, .card-glass, .card-elevated {
    background: white;
    border: 1px solid #ddd;
    box-shadow: none;
  }
}