/* ══════════════════════════════════════════════════════════
   SocialPulse — custom.css  (Light Theme — Purple Palette)
   ══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════
   FUTURISTIC PREMIUM UI — Background, Loader, Orbs, Grid
   ══════════════════════════════════════════════════════════ */

/* ── Animated background grid pattern ─────────────────── */
.sp-bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.06;
    background-image:
        linear-gradient(rgba(99,102,241,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.06) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 10%, transparent 70%);
}

/* ── Floating ambient orbs ────────────────────────────── */
.sp-bg-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
    animation: spOrbFloat 20s ease-in-out infinite;
}
.sp-bg-orb--1 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,0.04) 0%, transparent 70%);
    top: -5%; right: -5%;
    animation-delay: 0s;
}
.sp-bg-orb--2 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(139,92,246,0.03) 0%, transparent 70%);
    bottom: 10%; left: 5%;
    animation-delay: -7s;
}
.sp-bg-orb--3 {
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(59,130,246,0.025) 0%, transparent 70%);
    top: 40%; right: 15%;
    animation-delay: -14s;
}
@keyframes spOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(15px, -20px) scale(1.05); }
    50% { transform: translate(-10px, 15px) scale(0.95); }
    75% { transform: translate(20px, 10px) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
    .sp-bg-orb { animation: none !important; }
}

/* ── Premium page loader ring ─────────────────────────── */
.sp-loader-ring {
    position: relative;
    width: 48px; height: 48px;
}
.sp-loader-ring__inner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2.5px solid rgba(199,210,254,0.5);
    border-top-color: var(--sp-text-secondary);
    animation: spLoaderSpin 0.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.sp-loader-ring::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-top-color: rgba(99,102,241,0.15);
    animation: spLoaderSpin 2.4s linear infinite reverse;
}
.sp-loader-ring::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
    animation: spLoaderPulse 1.8s ease-in-out infinite;
}
@keyframes spLoaderSpin {
    to { transform: rotate(360deg); }
}
@keyframes spLoaderPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
}
.sp-loader-ring__inner {
    border-color: rgba(199,210,254,0.5);
    border-top-color: var(--sp-text-secondary);
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR ENHANCEMENTS — Light Theme
   ══════════════════════════════════════════════════════════ */

/* Accent line — hidden in light sidebar */
.sp-sidebar__accent-line {
    display: none;
}

/* Section badge pill style */
.sp-sidebar__section-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 6px;
    background: var(--sp-bg-subtle);
    font-size: var(--sp-text-2xs);
    font-weight: var(--sp-font-bold);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sp-text-muted);
    border: 1px solid var(--sp-border);
    transition: all var(--sp-duration-slow) var(--sp-ease);
}
.sp-sidebar__section-badge::before {
    content: '';
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--sp-accent);
    opacity: 0.5;
}

/* Avatar pulse ring — hidden in light sidebar */
.sp-sidebar__avatar {
    position: relative;
    overflow: visible;
}
.sp-sidebar__avatar-pulse {
    display: none;
}

/* ══════════════════════════════════════════════════════════
   FUTURISTIC NAVBAR ENHANCEMENTS
   ══════════════════════════════════════════════════════════ */

/* Navbar — transparent, no decorations */
.sp-navbar-futuristic {
    position: relative;
}

/* Breadcrumb home icon */
.sp-breadcrumb-home {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 7px;
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
    color: var(--sp-text-muted);
    font-size: 0.65rem;
    transition: all var(--sp-duration) var(--sp-ease);
}
.sp-breadcrumb-home:hover {
    background: var(--sp-accent-light);
    color: var(--sp-text-secondary);
    border-color: var(--sp-border);
}

.sp-breadcrumb-sep {
    color: var(--sp-border-strong);
    font-size: 0.7rem;
}

/* Navbar avatar — premium ring effect */
.sp-navbar__avatar {
    width: 32px; height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--sp-accent), var(--sp-accent-hover));
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 10px rgba(30,27,75,0.25), 0 0 0 2px rgba(99,102,241,0.08);
    transition: all var(--sp-duration-slow) var(--sp-ease);
}
.sp-navbar__avatar:hover {
    box-shadow: 0 4px 16px rgba(30,27,75,0.35), 0 0 0 3px rgba(99,102,241,0.15);
}

/* Navbar dropdown */
.sp-navbar__dropdown {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--sp-border);
    box-shadow:
        0 16px 48px -8px rgba(0,0,0,0.12),
        0 0 0 1px rgba(0,0,0,0.03);
}
.sp-navbar__dropdown::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--sp-accent), rgba(99,102,241,0.5), transparent);
    border-radius: 2xl 2xl 0 0;
    opacity: 0.6;
}

/* ── Typography — DM Sans + JetBrains Mono ────────────── */

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

html,
body,
.font-sans {
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-optical-sizing: auto;
}

/* Monospace for numbers, codes, IDs */
.sp-mono,
.sp-kpi__value,
.sp-stat-value,
.cpanel-stat-value,
.sp-counter {
    font-family: 'JetBrains Mono', 'DM Sans', monospace;
    font-variant-numeric: tabular-nums;
}

/* Page loader — never block interaction */
#page-loader {
    pointer-events: none !important;
}

/* ── Theme CSS Variables ───────────────────────────────── */
/* NOTE: Design tokens are now defined in tokens.css      */

/* Light background for the app */
body.sp-app-bg {
    background: var(--sp-bg-page);
    background-attachment: fixed;
    color: var(--sp-text);
}

/* Global select styling */
select {
    color-scheme: light;
}
select option {
    background: var(--sp-bg-card);
    color: var(--sp-text);
}

/* ── Floating island header bar ───────────────────────── */
.sp-header {
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(199,210,254,0.45);
    border-radius: 14px;
    flex-shrink: 0;
    z-index: var(--sp-z-header);
    gap: 14px;
    margin: 10px 0 0 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 16px rgba(99,102,241,0.04);
}

.sp-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.sp-header__center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}
.sp-header__right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.sp-header__logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.sp-header__logo img {
    width: 160%;
    height: 160%;
    object-fit: contain;
    margin-top: -12%;
    margin-left: -30%;
}
/* Generic header icon button */
.sp-header__icon-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--sp-text-muted);
    cursor: pointer;
    transition: all var(--sp-duration) var(--sp-ease);
    font-size: var(--sp-text-base);
    flex-shrink: 0;
}
.sp-header__icon-btn:hover {
    background: var(--sp-bg-subtle);
    color: var(--sp-text);
}
/* Separator between left section items */
.sp-header__sep {
    width: 1px;
    height: 24px;
    background: var(--sp-border);
    flex-shrink: 0;
}

@media (max-width: 639px) {
    .sp-header {
        padding: 0 12px;
        gap: 8px;
        height: 46px;
        margin: 8px 0 0 0;
        border-radius: 12px;
    }
    .sp-header__center {
        justify-content: flex-end;
    }
    .sp-header__sep {
        display: none;
    }
}

/* ── Inline topbar (legacy, now used as page-level bar) ── */
.sp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 30;
}
.sp-topbar__title {
    font-size: var(--sp-text-xl);
    font-weight: var(--sp-font-bold);
    color: var(--sp-text);
    letter-spacing: var(--sp-tracking-tight);
}
.sp-topbar__divider {
    border-right: 1px solid var(--sp-border);
}
.sp-topbar__clients-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 45vw;
    flex-shrink: 1;
    min-width: 0;
}
.sp-topbar__clients-scroll form {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin: 0;
    line-height: 0;
}
.sp-topbar__clients-scroll::-webkit-scrollbar {
    display: none;
}
@media (min-width: 640px) {
    .sp-topbar__clients-scroll {
        max-width: 60vw;
    }
}
@media (min-width: 1024px) {
    .sp-topbar__clients-scroll {
        max-width: calc(100vw - 400px);
    }
    .sidebar-expanded .sp-topbar__clients-scroll {
        max-width: calc(100vw - 550px);
    }
}
.sp-topbar__company {
    background: var(--sp-bg-subtle);
    color: var(--sp-text-secondary);
    border: 1px solid var(--sp-border);
}
.sp-topbar__company i {
    color: var(--sp-text-muted);
}
.sp-topbar__icon-btn {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    color: var(--sp-text-muted);
    transition: all var(--sp-duration) var(--sp-ease);
    background: transparent;
    border: none;
    cursor: pointer;
}
.sp-topbar__icon-btn:hover {
    background: var(--sp-bg-subtle);
    color: var(--sp-text);
}
.sp-topbar__user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 5px;
    border-radius: var(--sp-radius-md);
    transition: all var(--sp-duration) var(--sp-ease);
    font-size: var(--sp-text-base);
    color: var(--sp-text-secondary);
    font-weight: var(--sp-font-medium);
    background: transparent;
    border: none;
    cursor: pointer;
}
.sp-topbar__user-btn:hover {
    background: var(--sp-bg-subtle);
}

/* Legacy navbar glass — keep for any remaining references */
.sp-navbar-glass {
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none !important;
    box-shadow: none;
}

/* ── Scrollbar ─────────────────────────────────────────── */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    display: none;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ── Toast animations ────────────────────────────────────── */
.toast-msg {
    animation: toast-slide-in 0.3s ease-out;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.toast-slide-in {
    animation: slideInRight 0.3s ease-out forwards;
}

.toast-fade-out {
    animation: fadeOut 0.4s ease-in forwards;
}

/* ── Line clamp ──────────────────────────────────────────── */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Skeleton shimmer ──────────────────────────────────── */
.skeleton {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, var(--sp-bg-subtle) 25%, var(--sp-border) 50%, var(--sp-bg-subtle) 75%);
    background-size: 200% 100%;
}

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

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

/* ── Inbox ──────────────────────────────────────────────── */
.inbox-left {
    min-width: 320px;
}

.inbox-comment-card {
    transition: all 0.15s ease;
    cursor: pointer;
}

.inbox-comment-card:hover {
    background-color: var(--sp-bg-subtle);
}

.inbox-comment-card.active {
    background-color: #EEF2FF;
    border-left: 4px solid #6366F1;
}

/* ── Sentiment dot ───────────────────────────────────────── */
.sentiment-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.sentiment-dot.positive {
    background-color: #4ade80;
}

.sentiment-dot.negative {
    background-color: #f87171;
}

.sentiment-dot.neutral {
    background-color: var(--sp-text-muted);
}

.sentiment-dot.lead {
    background-color: #3b82f6;
}

.sentiment-dot.business {
    background-color: #fbbf24;
}

/* ── Pre-declare dynamic Tailwind sentiment badge classes ─── */
.bg-emerald-100 {
    background-color: rgba(74, 222, 128, 0.15) !important;
}

.text-emerald-700 {
    color: #4ade80 !important;
}

.bg-rose-100 {
    background-color: rgba(248, 113, 113, 0.15) !important;
}

.text-rose-700 {
    color: #f87171 !important;
}

.bg-gray-100 {
    background-color: rgba(154, 148, 148, 0.15) !important;
}

.text-gray-700 {
    color: #6272C1 !important;
}

.bg-blue-100 {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

.text-blue-700 {
    color: #3b82f6 !important;
}

.bg-violet-100 {
    background-color: rgba(251, 191, 36, 0.15) !important;
}

.text-violet-700 {
    color: #fbbf24 !important;
}

.bg-amber-100 {
    background-color: rgba(251, 191, 36, 0.15) !important;
}

.text-amber-700 {
    color: #fbbf24 !important;
}

/* ── Button spinner ──────────────────────────────────────── */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

/* ── Slide animations ────────────────────────────────────── */
@keyframes slideUp {
    from {
        transform: translateY(12px);
        opacity: 0;
    }

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

/* ── Platform icon colors ────────────────────────────────── */
.platform-facebook {
    color: var(--sp-platform-facebook);
}

.platform-instagram {
    color: var(--sp-platform-instagram);
}

.platform-youtube {
    color: var(--sp-platform-youtube);
}

.platform-linkedin {
    color: var(--sp-platform-linkedin);
}

.platform-twitter {
    color: var(--sp-platform-tiktok);
}

.platform-google_reviews {
    color: var(--sp-platform-google);
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR — Island Design (Floating top, flush bottom)
   ══════════════════════════════════════════════════════════ */

/* App layout — row: sidebar + main column side by side */
.sp-app-layout {
    display: flex;
    flex-direction: row;
    height: 100%;
}

/* Main column — header + content stacked vertically */
.sp-app-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0 1rem;
}
@media (min-width: 640px) {
    .sp-app-main { padding: 0 1.5rem; }
}
@media (min-width: 1024px) {
    .sp-app-main { padding: 0 1.75rem; }
}

/* Content area — below sidebar in stacking order so tooltips render on top */
.sp-app-content {
    position: relative;
    z-index: 1;
}

/* Base sidebar container */
.sp-sidebar {
    background: rgba(255,255,255,0.3);
    color: var(--sp-text-secondary);
    border-right: 1px solid rgba(199,210,254,0.5);
    border-radius: 0;
    position: relative;
    width: 64px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    z-index: 32;
    box-shadow: none;
    flex-shrink: 0;
}

/* Collapsed state — icon-only */
.sp-sidebar.collapsed {
    width: 64px;
    border-radius: 0;
}

/* Expanded state — icons + text labels */
.sp-sidebar.expanded {
    width: 240px;
}

/* Remove ambient glows */
.sp-sidebar::before,
.sp-sidebar::after {
    display: none;
}

/* Header (logo area) — always visible, adapts to collapsed/expanded */
.sp-sidebar__header {
    display: flex;
    height: 60px;
    align-items: center;
    justify-content: center;
    padding: 12px 8px 0 8px;
    border-bottom: none;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    gap: 8px;
    box-sizing: border-box;
}

/* Full logo — hidden in collapsed, shown in expanded */
.sp-sidebar__logo-full {
    display: none;
    width: calc(100% - 10px);
    height: auto;
    max-width: 210px;
}
.sp-sidebar.collapsed .sp-sidebar__logo-full {
    display: none;
}
.sp-sidebar.expanded .sp-sidebar__logo-full {
    display: block;
}

/* Logo link — hidden in collapsed (icon-wrap shown instead), shown in expanded */
.sp-sidebar__logo-link {
    display: none;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.sp-sidebar.expanded .sp-sidebar__logo-link {
    display: flex;
}
.sp-sidebar.expanded .sp-sidebar__header {
    justify-content: center;
    padding: 12px 8px 0 8px;
}

/* Small logo wrapper — always visible */
.sp-sidebar__logo-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: block;
    background: transparent;
}
.sp-sidebar__logo-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sp-sidebar.collapsed .sp-sidebar__logo-icon-wrap {
    display: block;
}
.sp-sidebar.expanded .sp-sidebar__logo-icon-wrap {
    display: none;
}

/* Expand/collapse toggle button — sits in footer */
.sp-sidebar__toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: none;
    color: var(--sp-text-muted);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    gap: 0;
    text-decoration: none;
}
.sp-sidebar__toggle-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sp-border);
    color: var(--sp-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.sp-sidebar__toggle-icon i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sp-sidebar__toggle-text {
    display: none;
}
.sp-sidebar__toggle:hover .sp-sidebar__toggle-icon {
    background: var(--sp-border-strong);
    color: var(--sp-text-secondary);
}

/* Expanded toggle — matches nav link layout */
.sp-sidebar.expanded .sp-sidebar__toggle {
    width: auto;
    height: auto;
    border-radius: 12px;
    padding: 6px 10px;
    gap: 11px;
    justify-content: flex-start;
}
.sp-sidebar.expanded .sp-sidebar__toggle-icon {
    width: 34px;
    height: 34px;
}
.sp-sidebar.expanded .sp-sidebar__toggle-text {
    display: inline;
}
.sp-sidebar.expanded .sp-sidebar__toggle:hover {
    background: rgba(0,0,0,0.03);
}
.sp-sidebar.expanded .sp-sidebar__toggle-icon i {
    transform: rotate(180deg);
}

.sp-sidebar__close-btn {
    color: var(--sp-text-muted);
    transition: all 0.25s ease;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 10px;
}
.sp-sidebar__close-btn:hover {
    color: var(--sp-text);
    background: var(--sp-bg-subtle);
}

/* Navigation area */
.sp-sidebar__nav {
    padding: 10px 0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    overflow-y: auto;
    overflow-x: visible;
}
.sp-sidebar.collapsed .sp-sidebar__nav {
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.sp-sidebar.expanded .sp-sidebar__nav {
    align-items: stretch;
    padding: 8px 8px;
    gap: 1px;
}

/* Section label — hidden in collapsed, shown in expanded */
.sp-sidebar__section-label {
    display: none;
}
.sp-sidebar.collapsed .sp-sidebar__section-label {
    display: none;
}
.sp-sidebar.expanded .sp-sidebar__section-label {
    display: block;
    opacity: 1;
    height: auto;
    margin-bottom: 2px;
    margin-top: 8px;
    padding: 0 6px;
}
.sp-sidebar.expanded .sp-sidebar__section-label:first-child {
    margin-top: 0;
}

/* Section divider */
.sp-sidebar__divider {
    height: 1px;
    background: var(--sp-border);
    margin: 6px auto;
    width: 36px;
}
.sp-sidebar.collapsed .sp-sidebar__divider {
    margin: 6px 10px;
    width: auto;
    opacity: 0.5;
}
.sp-sidebar.expanded .sp-sidebar__divider {
    width: auto;
    margin: 4px 6px;
    opacity: 0.5;
}

/* Navigation link — icon-only style */
.sp-sidebar__link {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sp-text-muted);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
    overflow: visible;
    width: 42px;
    height: 42px;
    gap: 0;
}

.sp-sidebar__link:hover {
    color: var(--sp-text-secondary);
}
.sp-sidebar__link:hover .sp-sidebar__icon-box {
    background: var(--sp-border-strong);
    color: var(--sp-text-secondary);
}

/* Active link */
.sp-sidebar__link.active {
    color: #ffffff;
}

/* Active indicator — no bar */
.sp-sidebar__link.active::before {
    display: none;
}

/* Collapsed: rounded square (matches expanded design) */
.sp-sidebar.collapsed .sp-sidebar__link {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px;
    border-radius: 8px;
    gap: 0;
    margin-left: auto;
    margin-right: auto;
    width: 40px;
    height: 40px;
    transition: all 0.15s ease;
}

.sp-sidebar.collapsed .sp-sidebar__link:hover {
    background: var(--sp-bg-subtle);
}
.sp-sidebar.collapsed .sp-sidebar__link:hover .sp-sidebar__icon-box {
    background: var(--sp-border);
    color: var(--sp-text-secondary);
}

.sp-sidebar.collapsed .sp-sidebar__link.active {
    background: var(--sp-accent-light);
    box-shadow: inset 3px 0 0 var(--sp-accent);
}

.sp-sidebar.collapsed .sp-sidebar__link.active::before {
    display: none;
}
.sp-sidebar.collapsed .sp-sidebar__link.active .sp-sidebar__icon-box {
    background: var(--sp-accent);
    color: #ffffff;
}

/* Link text label — hidden in collapsed, shown in expanded */
.sp-sidebar__link-text {
    display: none;
}
.sp-sidebar.collapsed .sp-sidebar__link-text {
    display: none;
}
.sp-sidebar.expanded .sp-sidebar__link-text {
    display: inline;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sp-text-body);
}

/* Expanded link layout — horizontal with text */
.sp-sidebar.expanded .sp-sidebar__link {
    justify-content: flex-start;
    padding: 5px 8px;
    gap: 8px;
    width: auto;
    height: auto;
    border-radius: 7px;
    overflow: hidden;
}
.sp-sidebar.expanded .sp-sidebar__link:hover {
    background: var(--sp-bg-subtle);
}
.sp-sidebar.expanded .sp-sidebar__link:hover .sp-sidebar__icon-box {
    background: var(--sp-border);
    color: var(--sp-text-secondary);
}
.sp-sidebar.expanded .sp-sidebar__link.active {
    color: var(--sp-accent);
    background: var(--sp-accent-light);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--sp-accent);
}
.sp-sidebar.expanded .sp-sidebar__link.active:hover {
    background: rgba(99, 102, 241, 0.12);
}
.sp-sidebar.expanded .sp-sidebar__link.active .sp-sidebar__icon-box {
    background: var(--sp-accent);
    color: #ffffff;
}
.sp-sidebar.expanded .sp-sidebar__link.active .sp-sidebar__link-text {
    color: var(--sp-accent);
}

/* Compact icon boxes in expanded state */
.sp-sidebar.expanded .sp-sidebar__icon-box {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
    border-radius: 7px;
}

/* Hide tooltips when expanded — text is visible */
.sp-sidebar.expanded .sp-sidebar__tooltip {
    display: none;
}

/* ── Icon box (rounded square icon container) ─────────── */
.sp-sidebar__icon-box {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    border-radius: 7px;
    background: var(--sp-bg-subtle);
    color: var(--sp-text-muted);
    transition: all 0.15s ease;
}
.sp-sidebar.collapsed .sp-sidebar__icon-box {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 0.7rem;
}

.sp-sidebar__link.active .sp-sidebar__icon-box {
    background: var(--sp-accent);
    color: #ffffff;
}


/* Tooltip on hover */
.sp-sidebar__tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(4px);
    background: var(--sp-text);
    color: #ffffff;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    letter-spacing: 0.01em;
}
.sp-sidebar__tooltip::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: var(--sp-text);
    border-radius: 1px;
}
.sp-sidebar__link:hover .sp-sidebar__tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Footer */
.sp-sidebar__footer {
    padding: 12px 0;
    border-top: 1px solid rgba(199,210,254,0.4);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.sp-sidebar.collapsed .sp-sidebar__footer {
    padding: 12px 0;
}
.sp-sidebar.expanded .sp-sidebar__footer {
    align-items: stretch;
    padding: 8px 8px;
}

.sp-sidebar__user-card {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    border-radius: 0;
    border: none;
    background: none;
    width: 100%;
    gap: 0;
}
.sp-sidebar.collapsed .sp-sidebar__user-card {
    padding: 0;
    border-radius: 0;
    border: none;
    background: none;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.sp-sidebar__user-card:hover {
    background: none;
}
.sp-sidebar.collapsed .sp-sidebar__user-card:hover {
    background: none;
}

.sp-sidebar__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sp-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sp-text-muted);
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.sp-sidebar__avatar:hover {
    background: var(--sp-border-strong);
    color: var(--sp-text-secondary);
}
.sp-sidebar.collapsed .sp-sidebar__avatar {
    width: 40px;
    height: 40px;
}

/* User info and logout — hidden in icon sidebar */
.sp-sidebar__user-info {
    display: none;
}
.sp-sidebar.collapsed .sp-sidebar__user-info {
    display: none;
}

.sp-sidebar__username {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sp-sidebar__email {
    font-size: 0.6875rem;
    color: var(--sp-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sp-sidebar__logout-btn {
    display: none;
}
.sp-sidebar.collapsed .sp-sidebar__logout-btn {
    display: none;
}

.sp-sidebar__logout-btn:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
}

/* ── Sidebar scrollbar ───────────────────────────────────── */
.sp-sidebar__nav::-webkit-scrollbar {
    width: 3px;
}
.sp-sidebar__nav::-webkit-scrollbar-track {
    background: transparent;
}
.sp-sidebar__nav::-webkit-scrollbar-thumb {
    background: var(--sp-border);
    border-radius: 9999px;
}
.sp-sidebar__nav::-webkit-scrollbar-thumb:hover {
    background: var(--sp-border-strong);
}

/* ── Sidebar mobile overlay ─────────────────────────────── */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 40;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#sidebar-overlay.active {
    display: block;
}

/* On small screens, sidebar slides in as expanded overlay */
@media (max-width: 1023px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 280px !important;
        max-width: 80vw;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
        display: flex !important;
        flex-direction: column;
        background: var(--sp-bg-card);
        border-right: 1px solid var(--sp-border);
        box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    }

    #sidebar.sidebar-open {
        transform: translateX(0);
    }

    /* ── Mobile sidebar header ── */
    #sidebar .sp-sidebar__header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 16px !important;
        height: 56px !important;
        border-radius: 0 !important;
        border-bottom: 1px solid var(--sp-border) !important;
        gap: 8px !important;
    }
    #sidebar .sp-sidebar__logo-link { display: flex !important; }
    #sidebar .sp-sidebar__logo-full { display: block !important; max-width: 160px !important; }
    #sidebar .sp-sidebar__logo-icon-wrap { display: none !important; }

    /* ── Mobile close button — larger tap target ── */
    #sidebar .sp-sidebar__close-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: var(--sp-radius-sm) !important;
        font-size: 1rem !important;
    }

    /* ══════════════════════════════════════════════════════
       MOBILE SIDEBAR — Compact, modern, professional
       ══════════════════════════════════════════════════════ */

    /* ── Nav container — tight padding ── */
    #sidebar.sp-sidebar .sp-sidebar__nav,
    #sidebar.sp-sidebar.collapsed .sp-sidebar__nav {
        align-items: stretch !important;
        padding: 8px 10px !important;
        gap: 1px !important;
        flex-direction: column !important;
    }

    /* ── Section labels — compact, inline ── */
    #sidebar.sp-sidebar .sp-sidebar__section-label,
    #sidebar.sp-sidebar.collapsed .sp-sidebar__section-label {
        display: block !important;
        opacity: 1 !important;
        height: auto !important;
        margin-bottom: 2px !important;
        margin-top: 10px !important;
        padding: 0 6px !important;
    }
    #sidebar .sp-sidebar__section-label:first-child {
        margin-top: 0 !important;
    }
    /* Smaller section badge on mobile */
    #sidebar.sp-sidebar .sp-sidebar__section-badge {
        font-size: 0.55rem !important;
        padding: 1px 7px !important;
        letter-spacing: 0.1em !important;
    }

    /* ── Nav links — compact, left-aligned ── */
    #sidebar.sp-sidebar .sp-sidebar__link,
    #sidebar.sp-sidebar.collapsed .sp-sidebar__link {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding: 6px 8px !important;
        gap: 8px !important;
        width: 100% !important;
        height: auto !important;
        border-radius: 7px !important;
        overflow: hidden !important;
        margin: 0 !important;
    }

    /* ── Link text — smaller, clean ── */
    #sidebar.sp-sidebar .sp-sidebar__link-text,
    #sidebar.sp-sidebar.collapsed .sp-sidebar__link-text {
        display: inline !important;
        font-size: 0.8125rem !important;
        color: var(--sp-text-body) !important;
        font-weight: 500 !important;
    }

    /* ── Icon boxes — small, subtle ── */
    #sidebar.sp-sidebar .sp-sidebar__icon-box,
    #sidebar.sp-sidebar.collapsed .sp-sidebar__icon-box {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        font-size: 0.7rem !important;
        border-radius: 7px !important;
        background: var(--sp-bg-subtle) !important;
        color: var(--sp-text-muted) !important;
    }

    /* ── Active link — bold indigo accent bar ── */
    #sidebar.sp-sidebar .sp-sidebar__link.active,
    #sidebar.sp-sidebar.collapsed .sp-sidebar__link.active {
        color: var(--sp-accent) !important;
        background: var(--sp-accent-light) !important;
        font-weight: 600 !important;
        box-shadow: inset 3px 0 0 var(--sp-accent) !important;
    }
    #sidebar .sp-sidebar__link.active::before { display: none !important; }
    #sidebar.sp-sidebar .sp-sidebar__link.active .sp-sidebar__icon-box,
    #sidebar.sp-sidebar.collapsed .sp-sidebar__link.active .sp-sidebar__icon-box {
        background: var(--sp-accent) !important;
        color: #ffffff !important;
    }
    #sidebar.sp-sidebar .sp-sidebar__link.active .sp-sidebar__link-text {
        color: var(--sp-accent) !important;
    }

    /* ── Hover — subtle bg ── */
    #sidebar.sp-sidebar .sp-sidebar__link:hover {
        background: var(--sp-bg-subtle) !important;
    }
    #sidebar.sp-sidebar .sp-sidebar__link:hover .sp-sidebar__icon-box {
        background: var(--sp-border) !important;
        color: var(--sp-text-secondary) !important;
    }

    /* ── Divider — thin, subtle ── */
    #sidebar.sp-sidebar .sp-sidebar__divider,
    #sidebar.sp-sidebar.collapsed .sp-sidebar__divider {
        width: auto !important;
        margin: 6px 6px !important;
        height: 1px !important;
        background: var(--sp-border) !important;
        opacity: 0.5 !important;
    }

    /* ── Footer — compact ── */
    #sidebar.sp-sidebar .sp-sidebar__footer,
    #sidebar.sp-sidebar.collapsed .sp-sidebar__footer {
        align-items: stretch !important;
        padding: 8px 10px !important;
        border-top: 1px solid var(--sp-border) !important;
    }

    /* ── Hide toggle and tooltips ── */
    #sidebar .sp-sidebar__toggle { display: none !important; }
    #sidebar.sp-sidebar .sp-sidebar__tooltip,
    #sidebar.sp-sidebar.collapsed .sp-sidebar__tooltip { display: none !important; }

    .sidebar-spacer {
        display: none;
    }
}

/* ── Small phones (< 375px) ── */
@media (max-width: 374px) {
    #sidebar {
        width: 100vw !important;
        max-width: 100vw !important;
    }
    #sidebar.sp-sidebar .sp-sidebar__link {
        padding: 5px 6px !important;
        gap: 6px !important;
    }
    #sidebar.sp-sidebar .sp-sidebar__icon-box {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        font-size: 0.6rem !important;
    }
    #sidebar.sp-sidebar .sp-sidebar__link-text {
        font-size: 0.75rem !important;
    }
    #sidebar .sp-sidebar__nav {
        padding: 8px 8px !important;
    }
    #sidebar .sp-sidebar__link {
        padding: 7px 8px !important;
        gap: 8px !important;
    }
    #sidebar .sp-sidebar__icon-box {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
    }
    #sidebar .sp-sidebar__link-text {
        font-size: var(--sp-text-base) !important;
    }
}

@media (min-width: 1024px) {
    #sidebar {
        position: relative;
        transform: none !important;
    }

    #sidebar-overlay {
        display: none !important;
    }

    #mobile-sidebar-toggle {
        display: none !important;
    }
}

/* ══════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════ */
.navbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--sp-text-muted);
}

.navbar-breadcrumb .crumb-active {
    color: var(--sp-text);
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   DASHBOARD — Command Center
   ══════════════════════════════════════════════════════════ */

/* ── Entrance animation ─────────────────────────────────── */
.sp-enter {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.sp-enter.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Dashboard Hero ───────────────────────────────────── */
.sp-dash-hero {
    background: linear-gradient(135deg, #ffffff 0%, #EEF2FF 30%, #EEF2FF 70%, #E0E7FF 100%);
    border-radius: 20px;
    padding: 28px 32px;
    position: relative;
    overflow: hidden;
    border: 1px solid #C7D2FE;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 6px 20px rgba(99,102,241,0.08);
}
.sp-dash-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 40%, transparent 70%);
    pointer-events: none;
    animation: spOrbFloat 25s ease-in-out infinite;
}
.sp-dash-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
    pointer-events: none;
    animation: spOrbFloat 20s ease-in-out infinite reverse;
}
.sp-dash-hero__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.sp-dash-hero__greeting {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sp-text);
    line-height: 1.2;
    letter-spacing: -0.025em;
}
.sp-dash-hero__subtitle {
    font-size: 0.875rem;
    color: var(--sp-text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}
.sp-dash-hero__date {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
    margin-top: 6px;
    font-weight: 500;
}

/* ── Date range group (in hero) ────────────────────────── */
.sp-date-range-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sp-date-range-group__label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--sp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sp-date-range-group__input {
    padding: 10px 14px;
    background: var(--sp-bg-input);
    border: 1.5px solid #C7D2FE;
    border-radius: 12px;
    color: var(--sp-text);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    color-scheme: light;
}
.sp-date-range-group__input:hover {
    border-color: #A5B4FC;
    background: var(--sp-bg-subtle);
}
.sp-date-range-group__input:focus {
    background: var(--sp-bg-card);
    border-color: var(--sp-text-secondary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.sp-date-range-group__input::-webkit-calendar-picker-indicator {
    opacity: 0.6;
}
.sp-date-range-group__clear {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--sp-bg-subtle);
    border: 1px solid var(--sp-border);
    color: var(--sp-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.sp-date-range-group__clear:hover {
    background: var(--sp-border);
    color: var(--sp-text);
}

/* ── Filter strip ────────────────────────────────────── */
.sp-filter-strip {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--sp-border);
    border-radius: 14px;
    padding: 12px 20px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.04),
        0 4px 14px rgba(99,102,241,0.06);
    position: relative;
}

/* ── Command Bar ──────────────────────────────────────── */
.sp-command-bar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--sp-border);
    border-radius: 16px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.06),
        0 4px 12px rgba(0,0,0,0.04);
    position: relative;
}
.sp-command-bar__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--sp-text);
    letter-spacing: -0.01em;
}
.sp-command-bar__date {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
    margin-top: 2px;
}

/* ── Platform filter pills ────────────────────────────── */
.sp-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--sp-border);
    background: var(--sp-bg-card);
    color: var(--sp-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.sp-pill:hover {
    border-color: #A5B4FC;
    background: var(--sp-bg-subtle);
    color: var(--sp-text);
}
.sp-pill.active {
    background: linear-gradient(135deg, #6366F1, #1E1B4B);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.sp-pill i { font-size: 0.875rem; }

/* ── Time range pills ────────────────────────────────── */
.sp-time-pill {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--sp-border);
    background: var(--sp-bg-card);
    color: var(--sp-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.02em;
}
.sp-time-pill:hover {
    border-color: #A5B4FC;
    background: var(--sp-bg-subtle);
    color: var(--sp-text);
}
.sp-time-pill.active {
    background: #6366F1;
    border-color: var(--sp-text-secondary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

/* ── Select dropdowns ────────────────────────────────── */
.sp-select {
    padding: 6px 12px;
    border: 1px solid var(--sp-border);
    border-radius: 10px;
    font-size: 0.8125rem;
    color: var(--sp-text);
    background: var(--sp-bg-card);
    min-width: 180px;
    transition: all 0.15s ease;
    outline: none;
}
.sp-select:focus {
    border-color: var(--sp-text-secondary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ── Base card ────────────────────────────────────────── */
.sp-card {
    background: var(--sp-bg-card);
    backdrop-filter: none;
    border-radius: 16px;
    border: 1px solid var(--sp-border);
    box-shadow:
        0 1px 3px rgba(0,0,0,0.05),
        0 4px 16px rgba(99,102,241,0.06);
    padding: 24px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.sp-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 12px 40px -10px rgba(99,102,241,0.14),
        0 0 0 1px rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

/* ── Section header inside cards ────────────────────────── */
.sp-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--sp-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
}
.sp-section-title i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #F5F3FF, #EEF2FF);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-right: 10px;
    color: var(--sp-text-secondary);
    flex-shrink: 0;
}
.sp-section-subtitle {
    font-size: 0.8125rem;
    color: var(--sp-text-secondary);
    line-height: 1.5;
}
.sp-section-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sp-text-secondary);
    background: linear-gradient(135deg, #F5F3FF, #EEF2FF);
    padding: 3px 12px;
    border-radius: 9999px;
}

/* ── KPI card ─────────────────────────────────────────── */
.sp-kpi {
    background: var(--sp-bg-card);
    backdrop-filter: none;
    border-radius: 14px;
    border: 1px solid var(--sp-border);
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(99,102,241,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sp-kpi::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366F1, #6272C1);
    opacity: 0.5;
    transition: opacity 0.3s;
}
.sp-kpi:hover::before {
    opacity: 1;
}
.sp-kpi:nth-child(1)::before { background: linear-gradient(90deg, #6366F1, #6272C1); }
.sp-kpi:nth-child(2)::before { background: linear-gradient(90deg, #e07050, #f4a261); }
.sp-kpi:nth-child(3)::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.sp-kpi:nth-child(4)::before { background: linear-gradient(90deg, #f87171, #fca5a5); }
.sp-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -4px rgba(99,102,241,0.1), 0 0 0 1px rgba(99,102,241,0.08);
}
.sp-kpi__body {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}
.sp-kpi__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #F5F3FF, #EEF2FF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sp-text-secondary);
    font-size: 0.9375rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.sp-kpi:nth-child(1) .sp-kpi__icon { background: linear-gradient(135deg, #F5F3FF, #E0E7FF); color: var(--sp-text-secondary); }
.sp-kpi:nth-child(2) .sp-kpi__icon { background: linear-gradient(135deg, #fde8e0, #fbd5c5); color: #e07050; }
.sp-kpi:nth-child(3) .sp-kpi__icon { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #3b82f6; }
.sp-kpi:nth-child(4) .sp-kpi__icon { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #ef4444; }
.sp-kpi:hover .sp-kpi__icon {
    transform: scale(1.08);
}
.sp-kpi__info {
    flex: 1;
    min-width: 0;
}
.sp-kpi__label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sp-text-muted);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sp-kpi__value {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--sp-text);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.sp-kpi__sparkline {
    margin-top: 8px;
    height: 24px;
    position: relative;
    z-index: 1;
}
.sp-kpi__sparkline svg {
    width: 100%;
    height: 100%;
}
.sp-kpi__trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
}
.sp-kpi__trend.trend-up {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}
.sp-kpi__trend.trend-down {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}
.sp-kpi__trend.trend-flat {
    background: rgba(138, 132, 156, 0.12);
    color: var(--sp-text-muted);
}

/* ── Sentiment mini KPI cards (accent tints) ──────────── */
.sp-kpi-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
}
.sp-kpi-mini:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -6px rgba(0,0,0,0.08);
}
.sp-kpi-mini__icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.sp-kpi-mini__icon-wrap--positive { background: rgba(22,163,74,0.12); color: #16a34a; }
.sp-kpi-mini__icon-wrap--negative { background: rgba(220,38,38,0.12); color: #dc2626; }
.sp-kpi-mini__icon-wrap--neutral  { background: rgba(138,132,156,0.12); color: var(--sp-text-secondary); }
.sp-kpi-mini__icon-wrap--lead     { background: rgba(59,130,246,0.15); color: #3b82f6; }
.sp-kpi-mini__icon-wrap--business { background: rgba(251,191,36,0.15); color: #fbbf24; }
.sp-kpi-mini__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.sp-kpi-mini__value {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.sp-kpi-mini__label {
    font-size: 0.6875rem;
    font-weight: 600;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sp-kpi-mini__pct {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.85;
    flex-shrink: 0;
    background: rgba(0,0,0,0.06);
    padding: 2px 8px;
    border-radius: 6px;
}

/* Positive */
.sp-kpi-mini--positive {
    background: linear-gradient(135deg, rgba(22,163,74,0.08), rgba(22,163,74,0.03));
    color: #16a34a;
    border-color: rgba(22,163,74,0.15);
}
/* Negative */
.sp-kpi-mini--negative {
    background: linear-gradient(135deg, rgba(220,38,38,0.08), rgba(220,38,38,0.03));
    color: #dc2626;
    border-color: rgba(220,38,38,0.15);
}
/* Neutral */
.sp-kpi-mini--neutral {
    background: linear-gradient(135deg, rgba(138,132,156,0.1), rgba(138,132,156,0.04));
    color: var(--sp-text-secondary);
    border-color: rgba(138,132,156,0.15);
}
/* Lead */
.sp-kpi-mini--lead {
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(59,130,246,0.05));
    color: #3b82f6;
    border-color: rgba(59,130,246,0.12);
}
/* Business */
.sp-kpi-mini--business {
    background: linear-gradient(135deg, rgba(251,191,36,0.1), rgba(251,191,36,0.05));
    color: #fbbf24;
    border-color: rgba(251,191,36,0.12);
}


/* ── Sentiment horizontal bars ────────────────────────── */
.sp-sentiment-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.sp-sentiment-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sp-sentiment-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--sp-text-muted);
    width: 60px;
    flex-shrink: 0;
}
.sp-sentiment-bar {
    flex: 1;
    height: 6px;
    background: var(--sp-bg-subtle);
    border-radius: 9999px;
    overflow: hidden;
}
.sp-sentiment-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.sp-sentiment-pct {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sp-text-secondary);
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

/* ── Top Posts leaderboard ────────────────────────────── */
.sp-post-rank {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    transition: background 0.15s ease;
    text-decoration: none;
}
.sp-post-rank:hover {
    background: var(--sp-bg-subtle);
}
.sp-medal {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}
.sp-medal--gold   { background: linear-gradient(135deg, #6366F1, #1E1B4B); color: #fff; }
.sp-medal--silver { background: linear-gradient(135deg, #6272C1, #6272C1); color: #ffffff; }
.sp-medal--bronze { background: linear-gradient(135deg, #A5B4FC, #C7D2FE); color: var(--sp-text-secondary); }
.sp-medal--default { background: var(--sp-bg-subtle); color: var(--sp-text-muted); }

/* ── Lead Tracker ────────────────────────────────────── */
.sp-lead-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--sp-text);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.sp-lead-label {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
    font-weight: 500;
}
.sp-lead-type {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
}
.sp-lead-type__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sp-lead-type__bar {
    flex: 1;
    height: 4px;
    background: var(--sp-bg-subtle);
    border-radius: 9999px;
    overflow: hidden;
}
.sp-lead-type__fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.6s ease;
}

/* ── Shimmer skeleton ────────────────────────────────── */
.sp-skeleton {
    background: linear-gradient(90deg, #EEF2FF 25%, #C7D2FE 50%, #EEF2FF 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* ── Peak hour label ─────────────────────────────────── */
.sp-peak-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sp-text-secondary);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

/* ── Card header ──────────────────────────────────────── */
.sp-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid #F5F3FF;
}

/* ── Chart card variant ────────────────────────────────── */
.sp-card--chart {
    padding-bottom: 20px;
}

/* ── Lead card variant ────────────────────────────────── */
.sp-card--lead {
    background: linear-gradient(135deg, #ffffff 0%, #F5F7FF 50%, #EEF2FF 100%);
    border-color: rgba(99,102,241,0.12);
}

/* ── Empty state ──────────────────────────────────────── */
.sp-empty-state {
    text-align: center;
    padding: 48px 24px;
}
.sp-empty-state--sm {
    padding: 24px 16px;
}
.sp-empty-state__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--sp-bg-subtle);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--sp-text-muted);
    margin-bottom: 12px;
}
.sp-empty-state__text {
    font-size: 0.8125rem;
    color: var(--sp-text-muted);
    font-weight: 500;
}

/* ── Keyword pill ───────────────────────────────────────── */
.keyword-pct {
    font-size: 0.65em;
}

/* ── Link style ───────────────────────────────────────── */
.sp-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sp-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 3px 10px;
    border-radius: 8px;
    background: transparent;
}
.sp-link:hover {
    color: var(--sp-text);
    background: var(--sp-bg-input);
}

/* ── Platform icon buttons ────────────────────────────── */
.platform-icon-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    min-height: 40px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px !important;
    border: 2px solid #C7D2FE;
    background: var(--sp-bg-card);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
    outline: none;
    aspect-ratio: 1;
    box-sizing: border-box;
}
.platform-icon-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* ══════════════════════════════════════════════════════════
   REUSABLE UI COMPONENTS
   ══════════════════════════════════════════════════════════ */

/* ── Unified Table Design System ─────────────────────── */

/* Table wrapper — card container with shadow */
.sp-table-wrapper {
    background: var(--sp-bg-card);
    border-radius: var(--sp-radius-lg);
    border: 1px solid var(--sp-border);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(99,102,241,0.04);
}
.sp-table-wrapper .overflow-x-auto {
    scrollbar-width: thin;
    scrollbar-color: var(--sp-border-strong) transparent;
}

/* Base table */
.sp-table {
    width: 100%;
    font-size: var(--sp-text-md);
    border-collapse: separate;
    border-spacing: 0;
}

/* ── Table Header ── */
.sp-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}
.sp-table thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: var(--sp-text-2xs);
    font-weight: 700;
    color: var(--sp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--sp-bg-subtle);
    border-bottom: 1px solid var(--sp-border);
    white-space: nowrap;
}
.sp-table thead th:first-child { padding-left: 20px; }
.sp-table thead th:last-child { padding-right: 20px; }

/* ── Table Body Rows ── */
.sp-table tbody tr {
    transition: background-color 0.15s ease;
    border-bottom: 1px solid rgba(199,210,254,0.3);
}
.sp-table tbody tr:last-child {
    border-bottom: none;
}
.sp-table tbody tr:hover {
    background-color: var(--sp-bg-subtle);
}

/* ── Table Body Cells ── */
.sp-table tbody td {
    padding: 12px 16px;
    color: var(--sp-text-body);
    border-bottom: 1px solid rgba(199,210,254,0.3);
    vertical-align: middle;
    line-height: 1.5;
    font-size: var(--sp-text-base);
}
.sp-table tbody td:first-child { padding-left: 20px; }
.sp-table tbody td:last-child { padding-right: 20px; }
.sp-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Table Variants ── */

/* Striped rows (opt-in with .sp-table--striped) */
.sp-table--striped tbody tr:nth-child(even) {
    background-color: rgba(238,242,255,0.5);
}

/* Compact table (opt-in with .sp-table--compact) */
.sp-table--compact thead th {
    padding: 8px 12px;
    font-size: 0.6rem;
}
.sp-table--compact tbody td {
    padding: 8px 12px;
    font-size: var(--sp-text-sm);
}
.sp-table--compact tbody td:first-child { padding-left: 14px; }
.sp-table--compact tbody td:last-child { padding-right: 14px; }
.sp-table--compact thead th:first-child { padding-left: 14px; }
.sp-table--compact thead th:last-child { padding-right: 14px; }

/* Clickable rows (opt-in with .sp-table--clickable) */
.sp-table--clickable tbody tr {
    cursor: pointer;
}
.sp-table--clickable tbody tr:hover {
    background-color: var(--sp-bg-subtle);
    box-shadow: inset 3px 0 0 var(--sp-accent);
}

/* ── Table Status Badges ── */
.sp-table-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--sp-radius-full);
    font-size: var(--sp-text-2xs);
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
}
.sp-table-badge--success { background: var(--sp-success-bg); color: var(--sp-success); border-color: var(--sp-success-border); }
.sp-table-badge--danger  { background: var(--sp-danger-bg); color: var(--sp-danger); border-color: var(--sp-danger-border); }
.sp-table-badge--warning { background: var(--sp-warning-bg); color: var(--sp-warning); border-color: var(--sp-warning-border); }
.sp-table-badge--info    { background: var(--sp-info-bg); color: var(--sp-info); border-color: var(--sp-info-border); }
.sp-table-badge--neutral { background: var(--sp-bg-subtle); color: var(--sp-text-muted); border-color: var(--sp-border); }

/* ── Table Action Buttons ── */
.sp-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--sp-radius-sm);
    color: var(--sp-text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: var(--sp-text-sm);
}
.sp-table-action:hover {
    background: var(--sp-bg-subtle);
    color: var(--sp-accent);
    border-color: var(--sp-border);
}
.sp-table-action--danger:hover {
    background: var(--sp-danger-bg);
    color: var(--sp-danger);
    border-color: var(--sp-danger-border);
}

/* ── Table Empty State ── */
.sp-table-empty {
    padding: 48px 24px;
    text-align: center;
}
.sp-table-empty__icon {
    font-size: 2rem;
    color: var(--sp-border-strong);
    margin-bottom: 12px;
}
.sp-table-empty__text {
    font-size: var(--sp-text-md);
    color: var(--sp-text-muted);
    font-weight: 500;
}

/* ── Table Header Bar (filters + search above table) ── */
.sp-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--sp-border);
    gap: 12px;
    flex-wrap: wrap;
}
.sp-table-header__title {
    font-size: var(--sp-text-md);
    font-weight: 700;
    color: var(--sp-text);
}
.sp-table-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Table Footer (pagination) ── */
.sp-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--sp-border);
    gap: 12px;
    flex-wrap: wrap;
}
.sp-table-footer__info {
    font-size: var(--sp-text-sm);
    color: var(--sp-text-muted);
}

/* ── Mobile Table Responsive ── */
@media (max-width: 639px) {
    .sp-table thead th,
    .sp-table tbody td {
        padding: 8px 10px;
        font-size: var(--sp-text-sm);
    }
    .sp-table thead th:first-child,
    .sp-table tbody td:first-child { padding-left: 12px; }
    .sp-table thead th:last-child,
    .sp-table tbody td:last-child { padding-right: 12px; }
    .sp-table-header {
        padding: 10px 12px;
    }
    .sp-table-footer {
        padding: 10px 12px;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .sp-table-wrapper {
        border-radius: var(--sp-radius-md);
    }
}
@media (max-width: 374px) {
    .sp-table thead th,
    .sp-table tbody td {
        padding: 6px 8px;
    }
}

/* ── Form Inputs ─────────────────────────────────────── */
.sp-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--sp-bg-input);
    border: 1.5px solid #C7D2FE;
    border-radius: 12px;
    font-size: 0.875rem;
    color: var(--sp-text);
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}
.sp-input:hover {
    border-color: #A5B4FC;
    background: var(--sp-bg-input);
}
.sp-input:focus {
    border-color: var(--sp-text-secondary);
    background: var(--sp-bg-card);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 0 0 1px rgba(99, 102, 241, 0.2);
}
.sp-input::placeholder {
    color: var(--sp-text-muted);
}
.sp-input:disabled {
    background: var(--sp-bg-subtle);
    color: var(--sp-text-muted);
    cursor: not-allowed;
    border-color: var(--sp-border);
}

/* Select variant */
.sp-input-select {
    padding: 10px 36px 10px 14px;
    background-color: var(--sp-bg-input);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a849c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    color: var(--sp-text);
    border: 1.5px solid #C7D2FE;
    border-radius: 12px;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}
.sp-input-select:hover {
    border-color: #A5B4FC;
    background-color: #EEF2FF;
}
.sp-input-select:focus {
    border-color: var(--sp-text-secondary);
    background-color: var(--sp-bg-card);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.sp-input-select option,
.sp-input option,
.sp-select option {
    background: var(--sp-bg-card);
    color: var(--sp-text);
}

/* Labels */
.sp-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sp-text);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

/* ── Buttons (orange accent) ─────────────────────────── */
.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}
.sp-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}
.sp-btn:active {
    transform: scale(0.97);
}

/* Sizes */
.sp-btn-sm, .sp-btn--sm {
    padding: 6px 14px;
    font-size: 0.75rem;
    border-radius: 10px;
}
.sp-btn-md, .sp-btn--md {
    padding: 10px 20px;
    font-size: 0.8125rem;
}
.sp-btn-lg, .sp-btn--lg {
    padding: 12px 24px;
    font-size: 0.9375rem;
}

/* Variants */
.sp-btn-primary, .sp-btn--primary {
    background: linear-gradient(135deg, #6366F1, #1E1B4B);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25),
                0 0 0 1px rgba(99, 102, 241, 0.1);
}
.sp-btn-primary:hover, .sp-btn--primary:hover {
    background: linear-gradient(135deg, #6b6590, #6366F1);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35),
                0 0 0 1px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.sp-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 50px;
    background: var(--sp-bg-card);
    color: var(--sp-text);
    border: 1.5px solid var(--sp-border);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sp-btn-secondary:hover {
    background: var(--sp-bg-subtle);
    border-color: var(--sp-border-strong);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.sp-btn-danger {
    background: linear-gradient(135deg, #f87171, #dc2626);
    color: #fff;
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.3);
}
.sp-btn-danger:hover {
    box-shadow: 0 4px 16px rgba(248, 113, 113, 0.4);
    transform: translateY(-1px);
}

.sp-btn-ghost, .sp-btn--ghost {
    background: transparent;
    color: var(--sp-text-secondary);
    border: none;
}
.sp-btn-ghost:hover, .sp-btn--ghost:hover {
    background: var(--sp-bg-subtle);
    color: var(--sp-text);
}

/* Icon-only button */
.sp-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* ── Badges ──────────────────────────────────────────── */
.sp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.4;
}
.sp-badge-success { background: rgba(74,222,128,0.15); color: #4ade80; }
.sp-badge-danger  { background: rgba(248,113,113,0.15); color: #f87171; }
.sp-badge-warning { background: rgba(251,191,36,0.15); color: #fbbf24; }
.sp-badge-info    { background: rgba(99,102,241,0.15); color: var(--sp-text-secondary); }
.sp-badge-neutral { background: rgba(154,148,148,0.15); color: var(--sp-text-muted); }
.sp-badge-purple  { background: rgba(167,139,250,0.15); color: #a78bfa; }

/* ── Modals ──────────────────────────────────────────── */
.sp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.sp-modal-backdrop.active {
    opacity: 1;
}

.sp-modal-panel {
    background: var(--sp-bg-card);
    border-radius: 20px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.15),
                0 8px 24px -8px rgba(0, 0, 0, 0.08),
                0 0 0 1px #C7D2FE;
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
    overflow: hidden;
}
.sp-modal-panel.active {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.sp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--sp-border);
}
.sp-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--sp-text);
}
.sp-modal-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--sp-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1rem;
}
.sp-modal-close:hover {
    background: var(--sp-bg-subtle);
    color: var(--sp-text);
}
.sp-modal-body {
    padding: 24px;
}
.sp-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #C7D2FE;
    background: var(--sp-bg-input);
    border-radius: 0 0 20px 20px;
}

/* ── Filter bar container ────────────────────────────── */
.sp-filter-bar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-radius: 16px;
    border: 1px solid var(--sp-border);
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

/* ── Action button ───────────────────────────────────── */
.sp-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
}
.sp-action-btn:hover {
    transform: scale(1.08);
}
.sp-action-btn-view { color: var(--sp-text-secondary); }
.sp-action-btn-view:hover { background: rgba(99,102,241,0.12); }
.sp-action-btn-edit { color: #fbbf24; }
.sp-action-btn-edit:hover { background: rgba(251,191,36,0.12); }
.sp-action-btn-delete { color: #f87171; }
.sp-action-btn-delete:hover { background: rgba(248,113,113,0.12); }
.sp-action-btn-comments { color: var(--sp-text-secondary); }
.sp-action-btn-comments:hover { background: rgba(99,102,241,0.12); }
.sp-action-btn-chart { color: #4ade80; }
.sp-action-btn-chart:hover { background: rgba(74,222,128,0.12); }
.sp-action-btn-link { color: var(--sp-text-secondary); }
.sp-action-btn-link:hover { background: var(--sp-bg-subtle); color: var(--sp-text); }

/* ── Page header ──────────────────────────────────────── */
.sp-page-header {
    margin-bottom: 24px;
}
.sp-page-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sp-text);
    letter-spacing: -0.01em;
}
.sp-page-header p {
    font-size: 0.8125rem;
    color: var(--sp-text-muted);
    margin-top: 4px;
}

/* ── Page Hero (orange accent) ───────────────────────── */
.sp-page-hero {
    border-radius: 20px;
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}
.sp-page-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
    pointer-events: none;
}
.sp-page-hero__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.sp-page-hero__title {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--sp-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sp-page-hero__title i {
    font-size: 1.125rem;
    opacity: 0.7;
}
.sp-page-hero__subtitle {
    font-size: 0.8125rem;
    color: var(--sp-text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}
.sp-page-hero__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Hero color variants — white-to-purple gradient (left to right) */
.sp-page-hero--sky,
.sp-page-hero--emerald,
.sp-page-hero--violet,
.sp-page-hero--rose,
.sp-page-hero--amber,
.sp-page-hero--slate,
.sp-page-hero--cyan {
    background: linear-gradient(to right, #ffffff 0%, #F5F3FF 35%, #EEF2FF 70%, #C7D2FE 100%);
    border: 1px solid var(--sp-border);
    box-shadow: 0 2px 12px -4px rgba(0,0,0,0.06);
}

/* Hero buttons */
.sp-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}
.sp-hero-btn--primary {
    background: linear-gradient(135deg, #6366F1, #1E1B4B);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.sp-hero-btn--primary:hover {
    background: linear-gradient(135deg, #6b6590, #6366F1);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.sp-hero-btn--ghost {
    background: rgba(0,0,0,0.04);
    color: var(--sp-text-secondary);
    border: 1px solid var(--sp-border);
}
.sp-hero-btn--ghost:hover {
    background: var(--sp-bg-subtle);
    color: var(--sp-text);
}

/* ── Step badge ──────────────────────────────────────── */
.sp-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}
.sp-step-badge--sky { background: rgba(99,102,241,0.15); color: var(--sp-text-secondary); }
.sp-step-badge--cyan { background: rgba(99,102,241,0.12); color: var(--sp-text-secondary); }
.sp-step-badge--emerald { background: rgba(74,222,128,0.15); color: #4ade80; }
.sp-step-badge--amber { background: rgba(251,191,36,0.15); color: #fbbf24; }

/* ── AI suggestion box ───────────────────────────────── */
.sp-ai-box {
    background: linear-gradient(135deg, #F5F3FF, #EEF2FF);
    border: 1px solid var(--sp-border);
    border-radius: 12px;
    padding: 14px 16px;
}
.sp-ai-box__label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Translation box ─────────────────────────────────── */
.sp-translate-box {
    background: linear-gradient(135deg, #F5F3FF, #EEF2FF);
    border: 1px solid var(--sp-border);
    border-radius: 12px;
    padding: 14px 16px;
}

/* ── Progress bar ────────────────────────────────────── */
.sp-progress {
    width: 100%;
    height: 8px;
    background: var(--sp-bg-subtle);
    border-radius: 9999px;
    overflow: hidden;
}
.sp-progress__fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #6366F1, #1E1B4B);
    transition: width 0.4s ease;
}
.sp-progress__fill--emerald {
    background: linear-gradient(90deg, #4ade80, #22c55e);
}

/* ── Error page ──────────────────────────────────────── */
.sp-error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sp-bg-subtle);
}
.sp-error-card {
    text-align: center;
    padding: 48px;
    max-width: 480px;
}
.sp-error-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 24px;
}
.sp-error-icon--red { background: rgba(248,113,113,0.15); color: #f87171; }
.sp-error-icon--amber { background: rgba(251,191,36,0.15); color: #fbbf24; }
.sp-error-icon--gray { background: rgba(154,148,148,0.15); color: var(--sp-text-muted); }
.sp-error-code {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #6366F1, #6b6590);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sp-error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sp-text);
    margin-bottom: 8px;
}
.sp-error-text {
    font-size: 0.875rem;
    color: var(--sp-text-muted);
    margin-bottom: 28px;
    line-height: 1.6;
}

/* ── Utility ────────────────────────────────────────────── */
.sync-progress-zero { width: 0%; }

/* ══════════════════════════════════════════════════════════
   AUTH — Full-page split · Landing-hero art LEFT · Form RIGHT
   ══════════════════════════════════════════════════════════ */

/* ── Full-page wrapper ──────────────────────────────────── */
.sp-auth {
    display: flex;
    min-height: 100vh;
}

/* Card shell — full viewport, no card styling */
.sp-auth__card {
    display: flex;
    width: 100%;
    min-height: 100vh;
    animation: sp-auth-in 0.4s ease-out both;
}
@keyframes sp-auth-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Art side (LEFT) — landing page hero style ──────────── */
.sp-auth__art-side {
    flex: 0 0 60%;
    order: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    min-height: 100vh;
    background: linear-gradient(160deg, #fef9f6 0%, #ffffff 35%, #f4f0ff 65%, #eef5ff 100%);
}

/* Grid pattern (mirrors landing page hero grid) */
.sp-auth__art-side::before {
    content: '';
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 15%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 15%, transparent 70%);
}

/* Floating dots (same as landing page hero) */
.sp-auth__float-dot {
    position: absolute; border-radius: 50%; pointer-events: none; z-index: 1;
    animation: sp-auth-float 6s ease-in-out infinite;
}
.sp-auth__float-dot--1 { width: 8px;  height: 8px;  background: rgba(99,102,241,0.25); top: 18%; left: 8%;   animation-delay: 0s;   }
.sp-auth__float-dot--2 { width: 12px; height: 12px; background: rgba(139,92,246,0.18); top: 30%; right: 8%;  animation-delay: 1.5s; }
.sp-auth__float-dot--3 { width: 6px;  height: 6px;  background: rgba(59,130,246,0.20); bottom: 28%; left: 12%; animation-delay: 3s;   }
.sp-auth__float-dot--4 { width: 10px; height: 10px; background: rgba(16,185,129,0.18); bottom: 20%; right: 8%; animation-delay: 4.5s; }
@keyframes sp-auth-float {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50%       { transform: translateY(-14px); opacity: 1; }
}

/* Art content wrapper */
.sp-auth__art-content {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    width: 100%;
}

/* Badge pill */
.sp-auth__art-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 14px; border-radius: 20px;
    background: rgba(99,102,241,0.12); color: var(--sp-text-secondary);
    font-size: 12px; font-weight: 600; margin-bottom: 14px;
}
.sp-auth__art-badge-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #6366F1;
    animation: sp-auth-pulse 2s infinite;
}
@keyframes sp-auth-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

/* Art heading / sub */
.sp-auth__art-heading {
    font-size: 1.75rem; font-weight: 900;
    margin: 0 0 10px; line-height: 1.15; letter-spacing: -0.025em;
    color: #1e293b;
}
.sp-auth__art-sub {
    font-size: 0.875rem; line-height: 1.65;
    margin: 0 0 28px; max-width: 240px;
    color: #64748b;
}

/* ── Orbit system (self-contained, no landing.css dependency) ── */
.sp-auth-orbit {
    position: relative; width: 100%; max-width: 360px;
    aspect-ratio: 1; margin: 0 auto;
}
.sp-auth-orbit__ring {
    position: absolute; border-radius: 50%;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.sp-auth-orbit__ring--1 { width: 94%; height: 94%; border: 1.5px solid  rgba(99,102,241,0.15); }
.sp-auth-orbit__ring--2 { width: 66%; height: 66%; border: 1px   dashed rgba(59,130,246,0.12); }
.sp-auth-orbit__ring--3 { width: 38%; height: 38%; border: 1px   solid  rgba(139,92,246,0.12); }

.sp-auth-orbit__center {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 100px; height: 100px; border-radius: 50%;
    background: var(--sp-bg-card);
    border: 2px solid rgba(99,102,241,0.2);
    box-shadow: 0 0 0 8px rgba(99,102,241,0.05), 0 8px 24px rgba(0,0,0,0.08);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 5; text-align: center;
}
.sp-auth-orbit__center-num {
    font-size: 1.75rem; font-weight: 900; line-height: 1;
    background: linear-gradient(135deg, #6366F1, #1E1B4B);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sp-auth-orbit__center-label {
    font-size: 10px; font-weight: 600; margin-top: 2px; color: #64748b;
}

/* Rotating tracks */
.sp-auth-orbit__track {
    position: absolute; border-radius: 50%; top: 50%; left: 50%; z-index: 4;
}
.sp-auth-orbit__track--outer {
    width: 94%; height: 94%;
    transform: translate(-50%, -50%);
    animation: sp-auth-orbit-spin 40s linear infinite;
}
.sp-auth-orbit__track--middle {
    width: 66%; height: 66%;
    transform: translate(-50%, -50%);
    animation: sp-auth-orbit-spin 30s linear infinite reverse;
}
@keyframes sp-auth-orbit-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Node positioning (outer) */
.sp-auth-orbit__node { position: absolute; display: flex; align-items: center; justify-content: center; }
.sp-auth-orbit__node--o1 { top: -27px; left: 50%; transform: translateX(-50%); }
.sp-auth-orbit__node--o2 { top: 50%; right: -27px; transform: translateY(-50%); }
.sp-auth-orbit__node--o3 { bottom: -27px; left: 50%; transform: translateX(-50%); }
.sp-auth-orbit__node--o4 { top: 50%; left: -27px; transform: translateY(-50%); }
/* Node positioning (middle) */
.sp-auth-orbit__node--m1 { top: -26px; left: 50%; transform: translateX(-50%); }
.sp-auth-orbit__node--m2 { top: 75%; left: 93.3%; transform: translate(-50%, -50%); }
.sp-auth-orbit__node--m3 { top: 75%; left: 6.7%;  transform: translate(-50%, -50%); }

/* Counter-rotation keeps icons upright */
.sp-auth-orbit__inner { display: flex; align-items: center; justify-content: center; }
.sp-auth-orbit__track--outer  .sp-auth-orbit__inner { animation: sp-auth-orbit-counter 40s linear infinite; }
.sp-auth-orbit__track--middle .sp-auth-orbit__inner { animation: sp-auth-orbit-counter 30s linear infinite reverse; }
@keyframes sp-auth-orbit-counter {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

/* Platform icon styles */
.sp-auth-orbit__avatar {
    width: 54px; height: 54px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.88);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
}
.sp-auth-orbit__icon {
    width: 52px; height: 52px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
/* Pause on hover */
.sp-auth-orbit:hover .sp-auth-orbit__track,
.sp-auth-orbit:hover .sp-auth-orbit__inner { animation-play-state: paused; }

/* ── Form side (RIGHT) ──────────────────────────────────── */
.sp-auth__form-side {
    flex: 1;
    order: 2;
    padding: 60px 56px;
    display: flex; flex-direction: column; justify-content: center;
    position: relative;
    min-height: 100vh; overflow-y: auto;
    background: var(--sp-bg-card);
}

/* Theme toggle (top-right of form side) */
.sp-auth__theme-toggle {
    position: absolute; top: 22px; right: 22px;
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid #e2e8f0; background: #f1f5f9;
    color: #64748b; cursor: pointer; font-size: 0.875rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.sp-auth__theme-toggle:hover { color: var(--sp-text-secondary); border-color: var(--sp-text-secondary); }

/* Logo */
.sp-auth__logo {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 40px; text-decoration: none;
}
.sp-auth__logo-img { height: 30px; width: auto; }
.sp-auth__logo-name {
    font-size: 1.05rem; font-weight: 700;
    background: linear-gradient(135deg, #6366F1, #6b6590);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Headings */
.sp-auth__title {
    font-size: 1.75rem; font-weight: 700;
    color: #1e293b; margin: 0 0 6px; line-height: 1.2;
}
.sp-auth__subtitle { font-size: 0.875rem; color: #64748b; margin: 0 0 32px; }

/* Form */
.sp-auth__form { display: flex; flex-direction: column; gap: 16px; }

.sp-auth__input-box {
    display: flex; align-items: center;
    border-radius: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    background: #f8fafc; border: 1.5px solid #e2e8f0;
}
.sp-auth__input-box:focus-within {
    border-color: var(--sp-text-secondary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    background: var(--sp-bg-card);
}

.sp-auth__input-icon { width: 46px; text-align: center; color: #94a3b8; font-size: 0.85rem; flex-shrink: 0; }

.sp-auth__input {
    flex: 1; border: none; background: transparent;
    padding: 13px 14px 13px 0; font-size: 0.875rem;
    color: #1e293b; outline: none; font-family: inherit;
}
.sp-auth__input::placeholder { color: #94a3b8; }

.sp-auth__input:-webkit-autofill,
.sp-auth__input:-webkit-autofill:hover,
.sp-auth__input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
    -webkit-text-fill-color: #1e293b !important;
    caret-color: #1e293b; transition: background-color 5000s ease-in-out 0s;
}

.sp-auth__field-row { display: flex; gap: 12px; }
.sp-auth__field-row > .sp-auth__field { flex: 1; min-width: 0; }
.sp-auth__select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 14px; }
.sp-auth__select option { background: var(--sp-bg-card); color: #1e293b; }

.sp-auth__pw-toggle {
    width: 42px; display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: #94a3b8;
    cursor: pointer; font-size: 0.85rem; flex-shrink: 0; transition: color 0.15s;
}
.sp-auth__pw-toggle:hover { color: var(--sp-text-secondary); }

/* Remember / Forgot row */
.sp-auth__row { display: flex; align-items: center; justify-content: space-between; }
.sp-auth__check { display: flex; align-items: center; gap: 7px; font-size: 0.8125rem; color: #64748b; cursor: pointer; }
.sp-auth__check input { width: 16px; height: 16px; accent-color: var(--sp-text-secondary); cursor: pointer; }
.sp-auth__link-sm { font-size: 0.8125rem; font-weight: 500; color: var(--sp-text-secondary); text-decoration: none; }
.sp-auth__link-sm:hover { text-decoration: underline; }

/* Submit */
.sp-auth__submit {
    width: 100%; padding: 13px; border: none; border-radius: 50px;
    font-family: inherit; font-size: 0.95rem; font-weight: 600; color: #fff;
    background: linear-gradient(135deg, #6366F1 0%, #1E1B4B 100%);
    cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 18px rgba(99,102,241,0.35); margin-top: 4px;
}
.sp-auth__submit:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(99,102,241,0.45); }
.sp-auth__submit:active { transform: translateY(0); }

/* Footer text */
.sp-auth__footer-text { text-align: center; font-size: 0.8125rem; color: #64748b; margin: 6px 0 0; }
.sp-auth__link { color: var(--sp-text-secondary); font-weight: 600; text-decoration: none; }
.sp-auth__link:hover { text-decoration: underline; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 960px) {
    .sp-auth__card { flex-direction: column; }
    .sp-auth__art-side {
        flex: 0 0 auto; width: 100%; min-height: 0; height: 300px;
        order: 1; padding: 40px 40px;
    }
    .sp-auth__art-content { flex-direction: row; align-items: center; gap: 28px; text-align: left; }
    .sp-auth__art-sub { margin-bottom: 0; }
    .sp-auth-orbit { max-width: 240px; flex-shrink: 0; }
    .sp-auth__form-side { flex: 1; order: 2; min-height: 0; padding: 48px 40px 60px; }
    .sp-auth__field-row { flex-direction: column; gap: 16px; }
    .sp-auth__title { font-size: 1.5rem; }
    .sp-auth__logo { margin-bottom: 28px; }
    .sp-auth__subtitle { margin-bottom: 24px; }
}
@media (max-width: 600px) {
    .sp-auth__art-side { height: 240px; padding: 28px 24px; }
    .sp-auth__art-content { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
    .sp-auth-orbit { max-width: 170px; }
    .sp-auth__art-badge { display: none; }
    .sp-auth__art-sub { display: none; }
    .sp-auth__art-heading { font-size: 1.3rem; margin-bottom: 0; }
    .sp-auth__form-side { padding: 32px 20px 48px; }
    .sp-auth__title { font-size: 1.35rem; }
}


/* ══════════════════════════════════════════════════════════
   LANDING PAGE (Dark)
   ══════════════════════════════════════════════════════════ */

/* ── Body & Container ──────────────────────────────────── */
/* ══════════════════════════════════════════════════════════
   LANDING PAGE — CSS Custom Properties (Light / Dark)
   ══════════════════════════════════════════════════════════ */
.sp-landing-body {
    /* Light theme (default) */
    --sl-bg-primary: #ffffff;
    --sl-bg-secondary: #f8fafc;
    --sl-bg-tertiary: #f1f5f9;
    --sl-bg-card: #ffffff;
    --sl-bg-card-hover: #f8fafc;
    --sl-bg-hero: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 40%, #f1f5f9 100%);
    --sl-bg-features: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    --sl-bg-platforms: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 50%, #f1f5f9 100%);
    --sl-bg-steps: #f8fafc;
    --sl-bg-cta: linear-gradient(135deg, #1e293b 0%, #334155 40%, #475569 100%);
    --sl-bg-footer: #0f172a;
    --sl-bg-proof: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    --sl-bg-showcase: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
    --sl-bg-why: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    --sl-text-primary: #1e293b;
    --sl-text-secondary: #64748b;
    --sl-text-muted: #94a3b8;
    --sl-text-subtle: rgba(30, 41, 59, 0.6);
    --sl-border: rgba(0, 0, 0, 0.08);
    --sl-border-light: rgba(0, 0, 0, 0.05);
    --sl-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --sl-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --sl-shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.12);
    --sl-shadow-mockup: 0 30px 80px rgba(0, 0, 0, 0.15);
    --sl-nav-scrolled-bg: rgba(255, 255, 255, 0.9);
    --sl-nav-scrolled-border: rgba(0, 0, 0, 0.06);
    --sl-nav-scrolled-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --sl-nav-link: #64748b;
    --sl-nav-link-hover: #1e293b;
    --sl-nav-link-hover-bg: rgba(0, 0, 0, 0.04);
    --sl-nav-links-pill-bg: rgba(0, 0, 0, 0.03);
    --sl-mobile-bg: rgba(255, 255, 255, 0.97);
    --sl-mobile-border: rgba(0, 0, 0, 0.06);
    --sl-mobile-link: #64748b;
    --sl-mobile-hover-bg: #f1f5f9;
    --sl-outline-color: #1e293b;
    --sl-outline-border: rgba(30, 41, 59, 0.2);
    --sl-outline-hover-bg: rgba(0, 0, 0, 0.04);
    --sl-outline-hover-border: rgba(30, 41, 59, 0.35);
    --sl-floating-bg: rgba(0, 0, 0, 0.04);
    --sl-floating-border: rgba(0, 0, 0, 0.06);
    --sl-floating-twitter-color: #1e293b;
    --sl-proof-divider: rgba(0, 0, 0, 0.08);
    --sl-circle-1: rgba(99, 102, 241, 0.06);
    --sl-circle-2: rgba(99, 102, 241, 0.04);
    --sl-blob-1: rgba(99, 102, 241, 0.07);
    --sl-blob-2: rgba(99, 102, 241, 0.05);
    --sl-blob-3: rgba(251, 191, 36, 0.08);
    --sl-mockup-browser: #e2e8f0;
    --sl-mockup-body: #f1f5f9;
    --sl-mockup-sidebar: #e2e8f0;
    --sl-mockup-url: rgba(0, 0, 0, 0.06);
    --sl-mockup-dot: rgba(0, 0, 0, 0.08);
    --sl-mockup-bar: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    --sl-mockup-card-bg: #ffffff;
    --sl-mockup-card-line: #e2e8f0;
    --sl-mockup-card-num: #cbd5e1;
    --sl-mockup-chart-bg: #ffffff;
    --sl-steps-line: linear-gradient(90deg, #e2e8f0, #6366F1, #1E1B4B, #e2e8f0);
    --sl-inbox-hover: rgba(0, 0, 0, 0.02);
    --sl-footer-logo-filter: none;
    --sl-hamburger-color: #64748b;
    --sl-showcase-mock-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    --sl-social-icon-bg: rgba(0, 0, 0, 0.06);
    --sl-social-icon-color: #64748b;
    --sl-footer-tagline: rgba(148, 163, 184, 0.8);
    --sl-footer-link: rgba(148, 163, 184, 0.7);
    --sl-footer-heading: #e2e8f0;
    --sl-footer-border: rgba(255, 255, 255, 0.08);
    --sl-footer-bottom: rgba(148, 163, 184, 0.4);

    /* Shorthand aliases used by blog/stories templates */
    --sl-text: var(--sl-text-primary);
    --sl-muted: var(--sl-text-secondary);
    --sl-accent: #6366F1;
    --sl-card-bg: var(--sl-bg-card);
}



.sp-landing-body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    overflow-x: hidden;
    background: var(--sl-bg-primary);
    margin: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

.sp-landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Desktop nav links & actions (hidden on mobile) ─── */
.sp-landing-nav__links,
.sp-landing-nav__actions {
    display: none;
}
.sp-landing-nav__links {
    gap: 2px;
    align-items: center;
    background: var(--sl-nav-links-pill-bg, rgba(0,0,0,0.04));
    border-radius: 12px;
    padding: 4px;
}
.sp-landing-nav__actions {
    gap: 10px;
    align-items: center;
}
@media (min-width: 1024px) {
    .sp-landing-nav__links,
    .sp-landing-nav__actions {
        display: flex;
    }
}

/* ── Mobile nav buttons (hidden on desktop >= 1024px) ── */
.sp-landing-nav__mobile-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}
@media (min-width: 1024px) {
    .sp-landing-nav__mobile-btns {
        display: none;
    }
}

/* ── Theme Toggle ─────────────────────────────────────── */
/* ── Navbar ─────────────────────────────────────────────── */
.sp-landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 10px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.sp-landing-nav--scrolled {
    background: var(--sl-nav-scrolled-bg);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--sl-nav-scrolled-border);
    box-shadow: var(--sl-nav-scrolled-shadow);
    padding: 6px 0;
}

.sp-landing-nav--scrolled .sp-landing-nav__link { color: var(--sl-nav-link); }
.sp-landing-nav--scrolled .sp-landing-nav__link:hover { color: var(--sl-nav-link-hover); }
.sp-landing-nav--scrolled .sp-landing-nav__login { color: var(--sl-nav-link); border-color: var(--sl-border); }
.sp-landing-nav--scrolled .sp-landing-nav__login:hover { color: var(--sl-nav-link-hover); border-color: var(--sl-nav-link-hover); }
.sp-landing-nav--scrolled .sp-landing-nav__hamburger { color: var(--sl-nav-link); }
.sp-landing-nav--scrolled .sp-landing-nav__signup {
    background: linear-gradient(135deg, #6366F1, #1E1B4B);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}
.sp-landing-nav--scrolled .sp-landing-nav__signup:hover {
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
}

.sp-landing-nav__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.sp-landing-nav__logo img {
    height: 88px;
    width: auto;
    object-fit: contain;
    margin: -12px 0;
}

.sp-landing-nav__link {
    color: var(--sl-nav-link);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 7px 16px;
    border-radius: 9px;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
    position: relative;
}
.sp-landing-nav__link:hover {
    color: var(--sl-nav-link-hover);
    background: var(--sl-nav-link-hover-bg);
}
.sp-landing-nav__link.active {
    color: var(--sp-text-secondary);
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
}

.sp-landing-nav__login {
    color: var(--sl-nav-link);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 9px;
    border: 1.5px solid var(--sl-border);
    transition: all 0.2s ease;
    background: transparent;
}
.sp-landing-nav__login:hover {
    color: var(--sl-nav-link-hover);
    border-color: var(--sl-nav-link-hover);
    background: var(--sl-nav-link-hover-bg);
}

.sp-landing-nav__signup {
    display: inline-flex;
    align-items: center;
    padding: 8px 22px;
    background: linear-gradient(135deg, #6366F1, #1E1B4B);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.sp-landing-nav__signup:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.sp-landing-nav__hamburger {
    background: none;
    border: none;
    color: var(--sl-hamburger-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
}

.sp-landing-nav__mobile {
    background: var(--sl-mobile-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 16px 24px;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid var(--sl-mobile-border);
    display: none;
}
.sp-landing-nav__mobile.sp-landing-nav__mobile--open {
    display: flex;
}
@media (min-width: 1024px) {
    .sp-landing-nav__mobile,
    .sp-landing-nav__mobile.sp-landing-nav__mobile--open {
        display: none !important;
    }
}
.sp-landing-nav__mobile a {
    display: block;
    padding: 10px 16px;
    color: var(--sl-mobile-link);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s;
}
.sp-landing-nav__mobile a:hover { background: var(--sl-mobile-hover-bg); color: var(--sl-text-primary); }

/* ── Hero ───────────────────────────────────────────────── */
.sp-landing-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--sl-bg-hero);
    position: relative;
    overflow: hidden;
    padding: 120px 0 80px;
}

.sp-landing-hero__circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.sp-landing-hero__circle--1 {
    width: 600px;
    height: 600px;
    bottom: -200px;
    right: -150px;
    background: var(--sl-circle-1);
}
.sp-landing-hero__circle--2 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    background: var(--sl-circle-2);
}

.sp-landing-hero__blob { position: absolute; border-radius: 50%; z-index: 0; }
.sp-landing-hero__blob--1 {
    width: 80px; height: 80px;
    top: 15%; right: 10%;
    background: var(--sl-blob-1);
    animation: sp-bob 8s ease-in-out infinite;
}
.sp-landing-hero__blob--2 {
    width: 50px; height: 50px;
    bottom: 20%; left: 5%;
    background: var(--sl-blob-2);
    animation: sp-bob 10s ease-in-out infinite 1s;
}
.sp-landing-hero__blob--3 {
    width: 30px; height: 30px;
    top: 35%; left: 15%;
    background: var(--sl-blob-3);
    animation: sp-bob 6s ease-in-out infinite 0.5s;
}

.sp-landing-hero__content {
    display: flex;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 1;
}

.sp-landing-hero__text { flex: 1; max-width: 600px; }

.sp-landing-hero__title {
    font-size: 3.25rem;
    font-weight: 800;
    color: var(--sl-text-primary);
    line-height: 1.15;
    margin: 0 0 24px;
}
.sp-landing-hero__title-accent {
    display: block;
    background: linear-gradient(135deg, #6366F1, #6b6590);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sp-landing-hero__subtitle {
    font-size: 1.125rem;
    color: var(--sl-text-subtle);
    line-height: 1.7;
    margin: 0 0 36px;
}

.sp-landing-hero__ctas {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.sp-landing-hero__illustration { flex: 0 0 auto; }
@media (min-width: 1024px) {
    .sp-landing-hero__illustration {
        flex: 1 1 50%;
        max-width: 560px;
    }
}

/* ── Buttons ────────────────────────────────────────────── */
.sp-landing-btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.sp-landing-btn--primary {
    background: linear-gradient(135deg, #6366F1, #1E1B4B);
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}
.sp-landing-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

.sp-landing-btn--outline {
    background: transparent;
    color: var(--sl-outline-color);
    border: 2px solid var(--sl-outline-border);
}
.sp-landing-btn--outline:hover {
    background: var(--sl-outline-hover-bg);
    border-color: var(--sl-outline-hover-border);
}

.sp-landing-btn--white {
    background: linear-gradient(135deg, #6366F1, #1E1B4B);
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}
.sp-landing-btn--white:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

/* ── Section Headers ──────────────────────────────────── */
.sp-landing-section-header {
    text-align: center;
    margin-bottom: 56px;
}

.sp-landing-section-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--sp-text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 9999px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sp-landing-section-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--sl-text-primary);
    margin: 0 0 16px;
    line-height: 1.2;
}

.sp-landing-section-subtitle {
    font-size: 1.0625rem;
    color: var(--sl-text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Features ──────────────────────────────────────────── */
.sp-landing-features {
    padding: 100px 0;
    background: var(--sl-bg-features);
}

.sp-landing-features__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.sp-landing-feature {
    background: var(--sl-bg-card);
    border-radius: 20px;
    border: 1px solid var(--sl-border);
    box-shadow: var(--sl-shadow-sm);
    padding: 36px 28px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}
.sp-landing-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--sl-shadow-lg);
    border-color: rgba(99, 102, 241, 0.15);
}

.sp-landing-feature__icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    margin: 0 auto 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.sp-landing-feature:hover .sp-landing-feature__icon {
    transform: scale(1.1);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 25%, transparent);
}

.sp-landing-feature__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--sl-text-primary);
    margin: 0 0 10px;
}

.sp-landing-feature__desc {
    font-size: 0.875rem;
    color: var(--sl-text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* ── Platforms ─────────────────────────────────────────── */
.sp-landing-platforms {
    padding: 100px 0;
    background: var(--sl-bg-platforms);
}

.sp-landing-platforms__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
}

.sp-landing-platform {
    background: var(--sl-bg-card);
    border-radius: 20px;
    padding: 36px 16px;
    text-align: center;
    border: 1px solid var(--sl-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--sl-shadow-sm);
}
.sp-landing-platform:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -10px color-mix(in srgb, var(--brand) 20%, transparent);
    border-color: color-mix(in srgb, var(--brand) 25%, transparent);
}

.sp-landing-platform__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 16px;
    transition: all 0.3s ease;
}
.sp-landing-platform:hover .sp-landing-platform__icon {
    background: var(--brand);
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 30%, transparent);
}

.sp-landing-platform__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sl-text-muted);
}

/* ── How It Works Steps ──────────────────────────────── */
.sp-landing-steps {
    padding: 100px 0;
    background: var(--sl-bg-steps);
}

.sp-landing-steps__track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    position: relative;
}

.sp-landing-steps__track::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: var(--sl-steps-line);
    z-index: 0;
}

.sp-landing-step {
    text-align: center;
    position: relative;
    z-index: 1;
}

.sp-landing-step__number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366F1, #1E1B4B);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.sp-landing-step__icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--sp-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 20px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    transition: all 0.3s ease;
}
.sp-landing-step:hover .sp-landing-step__icon {
    background: linear-gradient(135deg, #6366F1, #1E1B4B);
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.3);
    border-color: transparent;
}

.sp-landing-step__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sl-text-primary);
    margin: 0 0 8px;
}

.sp-landing-step__desc {
    font-size: 0.8125rem;
    color: var(--sl-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ── CTA Banner ──────────────────────────────────────── */
.sp-landing-cta {
    padding: 80px 0;
    background: var(--sl-bg-cta);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sp-landing-cta__title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--sp-text);
    margin: 0 0 16px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.25;
}

.sp-landing-cta__text {
    font-size: 1.0625rem;
    color: rgba(234, 230, 225, 0.55);
    margin: 0 0 36px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Footer ──────────────────────────────────────────── */
.sp-landing-footer {
    background: var(--sl-bg-footer);
    padding: 56px 0 0;
    color: var(--sl-text-secondary);
}

.sp-landing-footer__brand {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--sl-footer-border);
}
.sp-landing-footer__links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--sl-footer-border);
}
/* Legacy grid fallback — kept for compat */
.sp-landing-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--sl-footer-border);
}

.sp-landing-footer__tagline {
    font-size: 0.875rem;
    color: var(--sl-footer-tagline);
    line-height: 1.65;
    max-width: 280px;
    margin: 0;
}

.sp-landing-footer__heading {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--sl-footer-heading);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 16px;
}

.sp-landing-footer__grid a,
.sp-landing-footer__links a {
    display: block;
    color: var(--sl-footer-link);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 4px 0;
    transition: color 0.15s;
}
.sp-landing-footer__grid a:hover,
.sp-landing-footer__links a:hover { color: var(--sp-text-secondary); }

.sp-landing-footer__bottom {
    padding: 24px 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--sl-footer-bottom);
}

/* ── Scroll Reveal ─────────────────────────────────────── */
.sp-landing-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--reveal-delay, 0ms);
}
.sp-landing-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes sp-landing-failsafe {
    to { opacity: 1; transform: translateY(0); }
}
.sp-landing-reveal {
    animation: sp-landing-failsafe 0s 1.5s forwards;
}
.sp-landing-reveal.visible {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    .sp-landing-reveal {
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }
}

.sp-landing-section-header {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

/* ── Dashboard Mockup ────────────────────────────────── */
.sp-landing-mockup {
    width: 480px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--sl-shadow-mockup);
    transform: perspective(1000px) rotateY(-8deg) rotateX(4deg);
    transition: transform 0.4s ease;
}
.sp-landing-mockup:hover {
    transform: perspective(1000px) rotateY(-4deg) rotateX(2deg);
}

.sp-landing-mockup__browser {
    background: var(--sl-mockup-browser);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sp-landing-mockup__dots { display: flex; gap: 6px; }
.sp-landing-mockup__dots b {
    width: 10px; height: 10px;
    border-radius: 50%; display: block;
}
.sp-landing-mockup__dots b:nth-child(1) { background: #f87171; }
.sp-landing-mockup__dots b:nth-child(2) { background: #6272C1; }
.sp-landing-mockup__dots b:nth-child(3) { background: #4ade80; }

.sp-landing-mockup__url {
    flex: 1;
    height: 24px;
    background: var(--sl-mockup-url);
    border-radius: 6px;
}

.sp-landing-mockup__body {
    display: flex;
    background: var(--sl-mockup-body);
    min-height: 260px;
}

.sp-landing-mockup__sidebar {
    width: 50px;
    background: var(--sl-mockup-sidebar);
    flex-shrink: 0;
}
.sp-landing-mockup__sidebar-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
}
.sp-landing-mockup__sidebar-dot {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--sl-mockup-dot);
}
.sp-landing-mockup__sidebar-dot--active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(200, 90, 58, 0.3));
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

.sp-landing-mockup__main {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-landing-mockup__bar {
    height: 24px;
    background: var(--sl-mockup-bar);
    border-radius: 8px;
}

.sp-landing-mockup__cards {
    display: flex;
    gap: 8px;
}
.sp-landing-mockup__card {
    flex: 1;
    height: 64px;
    background: var(--sl-mockup-card-bg);
    border-radius: 8px;
    box-shadow: var(--sl-shadow-sm);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}
.sp-landing-mockup__card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 8px 8px 0 0;
}
.sp-landing-mockup__card-line {
    height: 6px;
    background: var(--sl-mockup-card-line);
    border-radius: 3px;
    margin-top: 6px;
}
.sp-landing-mockup__card-num {
    width: 40%;
    height: 10px;
    background: var(--sl-mockup-card-num);
    border-radius: 3px;
}

.sp-landing-mockup__chart {
    flex: 1;
    background: var(--sl-mockup-chart-bg);
    border-radius: 8px;
    box-shadow: var(--sl-shadow-sm);
    padding: 12px;
    display: flex;
    align-items: flex-end;
    min-height: 100px;
}
.sp-landing-mockup__chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    width: 100%;
    height: 100%;
}
.sp-landing-mockup__chart-bar {
    flex: 1;
    background: linear-gradient(180deg, #6366F1, #1E1B4B);
    border-radius: 4px 4px 0 0;
    animation: sp-landing-bar-pulse 3s ease-in-out infinite alternate;
}
.sp-landing-mockup__chart-bar:nth-child(even) {
    background: linear-gradient(180deg, #6b6590, #6366F1);
    animation-delay: 0.5s;
}

@keyframes sp-landing-bar-pulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* ── Hero Badge ──────────────────────────────────────── */
.sp-landing-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sp-text-secondary);
    margin-bottom: 24px;
}
.sp-landing-hero__badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: sp-badge-pulse 2s ease-in-out infinite;
}
@keyframes sp-badge-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ── Hero Mini Stats ────────────────────────────────── */
.sp-landing-hero__mini-stats {
    display: flex;
    gap: 24px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.sp-landing-hero__mini-stat {
    font-size: 0.8125rem;
    color: var(--sl-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sp-landing-hero__mini-stat i {
    color: var(--sp-text-secondary);
    font-size: 0.75rem;
}

/* ── Floating Platform Icons ─────────────────────────── */
.sp-landing-hero__floating {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--sl-floating-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--sl-floating-border);
    z-index: 0;
    animation: sp-float 6s ease-in-out infinite;
}
.sp-landing-hero__floating--1 { top: 18%; left: 8%; animation-delay: 0s; color: #1877F2; }
.sp-landing-hero__floating--2 { top: 30%; right: 5%; animation-delay: 1s; color: #E4405F; }
.sp-landing-hero__floating--3 { bottom: 25%; left: 3%; animation-delay: 2s; color: #FF0000; }
.sp-landing-hero__floating--4 { top: 12%; right: 15%; animation-delay: 0.5s; color: #0A66C2; }
.sp-landing-hero__floating--5 { bottom: 15%; right: 8%; animation-delay: 1.5s; color: var(--sl-floating-twitter-color); }
@keyframes sp-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@media (max-width: 1024px) {
    .sp-landing-hero__floating { display: none; }
}

/* ── Proof Strip ─────────────────────────────────────── */
.sp-landing-proof {
    padding: 48px 0;
    background: var(--sl-bg-proof);
    border-top: 1px solid var(--sl-border-light);
    border-bottom: 1px solid var(--sl-border-light);
}
.sp-landing-proof__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}
.sp-landing-proof__stat {
    text-align: center;
    min-width: 120px;
}
.sp-landing-proof__number {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--sp-text-secondary);
    line-height: 1;
    margin-bottom: 8px;
}
.sp-landing-proof__label {
    font-size: 0.8125rem;
    color: var(--sl-text-secondary);
    font-weight: 500;
}
.sp-landing-proof__divider {
    width: 1px;
    height: 48px;
    background: var(--sl-proof-divider);
}
@media (max-width: 640px) {
    .sp-landing-proof__inner { gap: 24px; }
    .sp-landing-proof__divider { display: none; }
    .sp-landing-proof__stat { min-width: 100px; }
    .sp-landing-proof__number { font-size: 1.75rem; }
}

/* ── Feature Showcase (alternating rows) ─────────────── */
.sp-landing-showcase {
    padding: 80px 0;
    background: var(--sl-bg-showcase);
}
.sp-landing-showcase__row {
    display: flex;
    align-items: center;
    gap: 60px;
    margin-bottom: 80px;
}
.sp-landing-showcase__row:last-child { margin-bottom: 0; }
.sp-landing-showcase__row--reverse { flex-direction: row-reverse; }
.sp-landing-showcase__text { flex: 1; }
.sp-landing-showcase__visual { flex: 1; }
.sp-landing-showcase__title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--sl-text-primary);
    margin: 16px 0 16px;
    line-height: 1.25;
}
.sp-landing-showcase__desc {
    font-size: 0.9375rem;
    color: var(--sl-text-secondary);
    line-height: 1.7;
    margin: 0 0 24px;
}
.sp-landing-showcase__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sp-landing-showcase__list li {
    font-size: 0.875rem;
    color: var(--sl-text-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sp-landing-showcase__list li i {
    color: #10b981;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Inbox Mock */
.sp-landing-showcase__inbox-mock {
    background: var(--sl-bg-card);
    border-radius: 16px;
    border: 1px solid var(--sl-border);
    padding: 8px;
    box-shadow: var(--sl-showcase-mock-shadow);
}
.sp-landing-showcase__inbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}
.sp-landing-showcase__inbox-item:hover { background: var(--sl-inbox-hover); }
.sp-landing-showcase__inbox-item--positive { border-left-color: #10b981; }
.sp-landing-showcase__inbox-item--negative { border-left-color: #f43f5e; }
.sp-landing-showcase__inbox-item--lead { border-left-color: var(--sp-text-secondary); }
.sp-landing-showcase__inbox-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.sp-landing-showcase__inbox-content { flex: 1; min-width: 0; }
.sp-landing-showcase__inbox-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sl-text-primary);
    margin-bottom: 2px;
}
.sp-landing-showcase__inbox-preview {
    font-size: 0.75rem;
    color: var(--sl-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-landing-showcase__inbox-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px;
    flex-shrink: 0;
}
.sp-landing-showcase__inbox-badge--positive { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.sp-landing-showcase__inbox-badge--negative { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }
.sp-landing-showcase__inbox-badge--lead { background: rgba(99, 102, 241, 0.15); color: var(--sp-text-secondary); }

/* Sentiment Mock */
.sp-landing-showcase__sentiment-mock {
    background: var(--sl-bg-card);
    border-radius: 16px;
    border: 1px solid var(--sl-border);
    padding: 28px;
    box-shadow: var(--sl-showcase-mock-shadow);
}
.sp-landing-showcase__sentiment-bar {
    display: flex;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    gap: 2px;
    margin-bottom: 16px;
}
.sp-landing-showcase__sentiment-fill {
    width: 0%;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    position: relative;
}
.sp-landing-showcase__sentiment-mock--active .sp-landing-showcase__sentiment-fill {
    width: var(--target-width);
}
.sp-landing-showcase__sentiment-fill::after {
    content: attr(data-label);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.625rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s 1s;
}
.sp-landing-showcase__sentiment-mock--active .sp-landing-showcase__sentiment-fill::after {
    opacity: 1;
}
.sp-landing-showcase__sentiment-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.sp-landing-showcase__sentiment-legend span {
    font-size: 0.75rem;
    color: var(--sl-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.sp-landing-showcase__sentiment-keywords {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.sp-landing-showcase__keyword {
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--sp-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid rgba(99, 102, 241, 0.12);
}

@media (max-width: 1024px) {
    .sp-landing-showcase__row,
    .sp-landing-showcase__row--reverse {
        flex-direction: column;
        gap: 40px;
    }
}
@media (max-width: 640px) {
    .sp-landing-showcase { padding: 60px 0; }
    .sp-landing-showcase__row { margin-bottom: 60px; }
    .sp-landing-showcase__title { font-size: 1.375rem; }
    .sp-landing-hero__mini-stats { flex-direction: column; gap: 12px; }
}

/* ── Why SocialPulse ─────────────────────────────────── */
.sp-landing-why {
    padding: 100px 0;
    background: var(--sl-bg-why);
}
.sp-landing-why__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.sp-landing-why__card {
    background: var(--sl-bg-card);
    border-radius: 20px;
    border: 1px solid var(--sl-border);
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sp-landing-why__card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.15);
    box-shadow: var(--sl-shadow-lg);
}
.sp-landing-why__card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--sp-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin: 0 auto 18px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
}
.sp-landing-why__card:hover .sp-landing-why__card-icon {
    background: linear-gradient(135deg, #6366F1, #1E1B4B);
    color: #fff;
    border-color: transparent;
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}
.sp-landing-why__card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sl-text-primary);
    margin: 0 0 10px;
}
.sp-landing-why__card-desc {
    font-size: 0.8125rem;
    color: var(--sl-text-secondary);
    line-height: 1.6;
    margin: 0;
}
@media (max-width: 1024px) {
    .sp-landing-why__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .sp-landing-why { padding: 60px 0; }
    .sp-landing-why__grid { grid-template-columns: 1fr; }
}

/* ── CTA Buttons row ─────────────────────────────────── */
.sp-landing-cta__buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Platform detail text ────────────────────────────── */
.sp-landing-platform__detail {
    display: block;
    font-size: 0.6875rem;
    color: var(--sl-text-secondary);
    margin-top: 4px;
}

/* ── Footer Social Icons ─────────────────────────────── */
.sp-landing-footer__socials {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}
.sp-landing-footer__socials a {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--sl-social-icon-bg);
    color: var(--sl-social-icon-color);
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    text-decoration: none;
    padding: 0 !important;
}
.sp-landing-footer__socials a:hover {
    background: #6366F1;
    color: #fff;
}

/* ── Footer logo ─────────────────────────────────────── */
.sp-landing-footer__logo {
    height: 56px;
    width: auto;
    object-fit: contain;
    margin-bottom: 16px;
    filter: var(--sl-footer-logo-filter);
}

/* ── Responsive – Landing Page ───────────────────────── */
@media (max-width: 1024px) {
    .sp-landing-hero__content {
        flex-direction: column;
        text-align: center;
    }
    .sp-landing-hero__text { max-width: 100%; }
    .sp-landing-hero__ctas { justify-content: center; }
    .sp-landing-hero__title { font-size: 2.5rem; }
    .sp-landing-mockup {
        width: 100%;
        max-width: 420px;
        transform: perspective(1000px) rotateY(0deg) rotateX(4deg);
    }
    .sp-landing-features__grid { grid-template-columns: repeat(2, 1fr); }
    .sp-landing-platforms__grid { grid-template-columns: repeat(3, 1fr); }
    .sp-landing-steps__track { grid-template-columns: repeat(2, 1fr); gap: 40px 32px; }
    .sp-landing-steps__track::before { display: none; }
    .sp-landing-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 767px) {
    .sp-landing-footer { padding: 40px 0 0; }
    .sp-landing-footer__brand { margin-bottom: 20px; padding-bottom: 16px; }
    .sp-landing-footer__links { gap: 16px; padding-bottom: 20px; }
    .sp-landing-footer__links .sp-landing-footer__heading { font-size: 0.6875rem; margin-bottom: 8px; }
    .sp-landing-footer__links a { font-size: 0.75rem; }
    .sp-landing-footer__logo { height: 40px; margin-bottom: 10px; }
    .sp-landing-footer__tagline { font-size: 0.75rem; }
    .sp-landing-footer__socials a { width: 32px; height: 32px; font-size: 13px; }
}

@media (max-width: 640px) {
    .sp-landing-hero { padding: 100px 0 60px; }
    .sp-landing-hero__title { font-size: 2rem; }
    .sp-landing-hero__subtitle { font-size: 1rem; }
    .sp-landing-hero__ctas { flex-direction: column; align-items: center; }
    .sp-landing-btn { width: 100%; justify-content: center; }
    .sp-landing-section-title { font-size: 1.75rem; }
    .sp-landing-features { padding: 60px 0; }
    .sp-landing-features__grid { grid-template-columns: 1fr; }
    .sp-landing-platforms { padding: 60px 0; }
    .sp-landing-platforms__grid { grid-template-columns: repeat(2, 1fr); }
    .sp-landing-steps { padding: 60px 0; }
    .sp-landing-steps__track { grid-template-columns: 1fr; gap: 32px; }
    .sp-landing-cta { padding: 60px 0; }
    .sp-landing-cta__title { font-size: 1.5rem; }
    .sp-landing-footer__grid { grid-template-columns: 1fr; gap: 24px; }
    .sp-landing-nav__logo img { height: 64px; margin: -8px 0; }
}

/* ── Leaflet Map (popup & tooltip overrides) ──────────── */
.sp-map-popup .leaflet-popup-content-wrapper {
    background: var(--sp-bg-subtle);
    color: var(--sp-text);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--sp-border);
}
.sp-map-popup .leaflet-popup-tip {
    background: var(--sp-bg-subtle);
    border: 1px solid var(--sp-border);
}
.sp-map-tooltip {
    background: #ffffff !important;
    color: #1E1B4B !important;
    border: 1px solid #C7D2FE !important;
    border-radius: 6px !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}
.sp-map-tooltip::before {
    border-top-color: #ffffff !important;
}
#locationMap .leaflet-control-zoom a {
    background: var(--sp-bg-subtle);
    color: var(--sp-text);
    border-color: var(--sp-border);
}
#locationMap .leaflet-control-zoom a:hover {
    background: var(--sp-border);
}
/* Ensure Leaflet tiles render properly on all viewports */
#locationMap .leaflet-tile-pane { z-index: 1; }
#locationMap .leaflet-tile { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
#locationMap { -webkit-transform: translateZ(0); transform: translateZ(0); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — App Pages (Tablet & Mobile)
   ══════════════════════════════════════════════════════════ */

/* ── Tablet (max 768px) ────────────────────────────────── */
@media (max-width: 768px) {
    /* Hero sections: stack title + actions vertically */
    .sp-page-hero__content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .sp-page-hero__actions {
        width: 100%;
    }
    .sp-page-hero__actions .sp-hero-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    .sp-page-hero {
        padding: 18px 16px;
        border-radius: 14px;
    }
    .sp-page-hero__title {
        font-size: 1.15rem;
    }

    /* Dashboard hero: stack greeting + date range vertically */
    .sp-dash-hero {
        padding: 20px 16px;
        border-radius: 14px;
    }
    .sp-dash-hero__content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .sp-dash-hero__greeting {
        font-size: 1.25rem;
    }
    .sp-dash-hero__actions {
        width: 100%;
    }
    .sp-dash-hero__actions > .flex {
        flex-wrap: wrap;
        width: 100%;
    }
    .sp-date-range-group {
        flex: 1;
        min-width: 0;
    }
    .sp-date-range-group__input {
        width: 100%;
    }

    /* Filter bars: stack items better on tablet */
    .sp-filter-strip {
        padding: 12px;
    }

    /* Inbox left panel min-width override */
    .inbox-left {
        min-width: 0;
    }

    /* Cards: reduce padding on mobile */
    .sp-card {
        border-radius: 14px;
    }

    /* KPI cards: smaller on mobile */
    .sp-kpi {
        border-radius: 14px;
    }

    /* Modal panels: ensure full width minus padding */
    .sp-modal-panel {
        max-width: calc(100vw - 32px) !important;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }

    /* Admin modal grid: stack on mobile */
    .sp-modal-body .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}

/* ── Small Mobile (max 480px) ──────────────────────────── */
@media (max-width: 480px) {
    .sp-page-hero {
        padding: 14px 12px;
        border-radius: 12px;
        margin-bottom: 16px;
    }
    .sp-page-hero__title {
        font-size: 1.05rem;
        gap: 6px;
    }
    .sp-page-hero__title i {
        font-size: 0.9rem;
    }
    .sp-page-hero__subtitle {
        font-size: 0.75rem;
    }
    .sp-page-hero__actions {
        flex-direction: column;
        gap: 8px;
    }
    .sp-page-hero__actions .sp-hero-btn {
        width: 100%;
        justify-content: center;
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    /* Dashboard hero smaller */
    .sp-dash-hero {
        padding: 16px 12px;
        border-radius: 12px;
    }
    .sp-dash-hero__greeting {
        font-size: 1.1rem;
    }
    .sp-dash-hero__subtitle {
        font-size: 0.75rem;
    }

    /* Filter strip: full-width items */
    .sp-filter-strip {
        padding: 10px;
    }
    .sp-filter-strip .sp-input-select,
    .sp-filter-strip .sp-input {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Filter tabs (pills): scrollable horizontally */
    .sp-pill {
        font-size: 0.7rem;
        padding: 5px 10px;
        white-space: nowrap;
    }

    /* KPI cards: tighter spacing */
    .sp-kpi__body {
        gap: 8px;
    }
    .sp-kpi__icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        font-size: 0.75rem;
    }
    .sp-kpi__label {
        font-size: 0.6rem;
    }
    .sp-kpi__value {
        font-size: 1.125rem;
    }

    /* Sentiment mini cards */
    .sp-kpi-mini {
        padding: 10px;
        border-radius: 12px;
    }

    /* Charts: smaller height on mobile */
    .sp-card--chart canvas {
        max-height: 220px;
    }

    /* Map: shorter on mobile */
    #locationMap {
        height: 240px !important;
    }

    /* Inbox: full-screen panels */
    #inbox-left,
    #inbox-right {
        max-height: 70vh;
    }

    /* Comment action buttons: smaller */
    .sp-card .flex.items-center.gap-2.mt-3 button {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    /* Modals: near full-screen on very small phones */
    .sp-modal-panel {
        border-radius: 12px !important;
    }

    /* Bulk action bar: stack */
    #bulkActionsBar {
        flex-direction: column;
        gap: 10px;
    }
    #bulkActionsBar > div {
        width: 100%;
    }

    /* Auto-reply dropdowns */
    #arChannelWrap select,
    #arPostWrap select {
        min-width: 0 !important;
        width: 100%;
    }

    /* Table improvements for mobile */
    .sp-table th,
    .sp-table td {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    /* Hide less important table columns on very small screens */
    .sp-table .hidden-xs {
        display: none;
    }
}

/* ── Filter tabs horizontal scroll on mobile ──────────── */
@media (max-width: 640px) {
    .flex.gap-2.mb-4.sp-enter {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
    .flex.gap-2.mb-4.sp-enter::-webkit-scrollbar {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════════
   CONTRAST IMPROVEMENTS (WCAG AA)
   ══════════════════════════════════════════════════════════ */

/* Boost muted text and secondary labels for better readability */
.sp-filter-strip .text-\[\#6272C1\],
.sp-card .text-\[\#6272C1\],
.sp-kpi .text-\[\#6272C1\] {
    color: #7f7a8a;
}

/* Chart axis labels — prevent overlap on small screens */
.sp-card canvas {
    max-width: 100%;
}

/* KPI mini stat cards — interactive hover cursor */
.sp-kpi-mini {
    cursor: default;
}

/* Sentiment/status badge contrast improvement */
.sp-badge {
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ── Issue #16: Contrast boost (WCAG AA) ─────────────── */
.sp-filter-strip .text-\[\#6272C1\],
.sp-card .text-\[\#6272C1\],
.sp-kpi .text-\[\#6272C1\],
.sp-kpi-mini .text-\[\#6272C1\],
.sp-page-hero .text-\[\#6272C1\],
.sp-table-wrapper .text-\[\#6272C1\],
.sp-sidebar .text-\[\#6272C1\] {
    color: #8a8494;
}

/* ── Issue #12: Page hero title overflow ─────────────── */
.sp-page-hero__title {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ── Issue #4: Map container mobile dimensions ───────── */
#locationMap {
    min-height: 300px;
    width: 100% !important;
}
@media (max-width: 768px) {
    #locationMap {
        height: 280px !important;
    }
}

/* ── Issue #19: Sidebar collapse animation smoothing ─── */
.sp-sidebar__link-text {
    transition: opacity 0.25s ease, width 0.3s ease;
}
.sp-sidebar__section-label {
    transition: opacity 0.25s ease;
}
.sp-sidebar__user-info,
.sp-sidebar__email {
    transition: opacity 0.25s ease;
}


/* ── Theme toggle button ───────────────────────────────── */

/* ══════════════════════════════════════════════════════════
   Tailwind Arbitrary-Value Color Overrides
   These override the hardcoded bg-[#xxx] / text-[#xxx] /
   border-[#xxx] classes used throughout the templates.
   ══════════════════════════════════════════════════════════ */

/* ── Background colours ────────────────────────────────── */
.bg-\[#EEF2FF\]     { background-color: #f8f7fb !important; }
.bg-\[#1E1B4B\]     { background-color: #f8f7fb !important; }
.bg-\[#0f0d16\]     { background-color: #ffffff !important; }
.bg-\[#ffffff\]     { background-color: #ffffff !important; }
.bg-\[#18161e\]     { background-color: #faf9fd !important; }
.bg-\[#F5F3FF\]     { background-color: #F5F3FF !important; }
.bg-\[#EEF2FF\]     { background-color: #EEF2FF !important; }
.bg-\[#C7D2FE\]     { background-color: #eceaf4 !important; }
.bg-\[#6366F1\]     { background-color: #C7D2FE !important; }
.bg-\[#4e4b5c\]     { background-color: #A5B4FC !important; }

/* With opacity variants */
.bg-\[#EEF2FF\]\/90  { background-color: rgba(248,247,251,0.90) !important; }
.bg-\[#1E1B4B\]\/90  { background-color: rgba(248,247,251,0.90) !important; }
.bg-\[#ffffff\]\/90  { background-color: rgba(255,255,255,0.90) !important; }

/* ── Hover background ──────────────────────────────────── */
.hover\:bg-\[#EEF2FF\]:hover { background-color: #EEF2FF !important; }
.hover\:bg-\[#C7D2FE\]:hover { background-color: #eceaf4 !important; }

/* ── Text colours ──────────────────────────────────────── */
.text-\[#1E1B4B\]   { color: #1E1B4B !important; }
.text-\[#6272C1\]   { color: #6366F1 !important; }
.text-\[#6272C1\]   { color: #6272C1 !important; }
.text-\[#4e4b5c\]   { color: #6272C1 !important; }
.text-\[#6366F1\]   { color: #b0acc4 !important; }

/* Hover text */
.hover\:text-\[#1E1B4B\]:hover { color: #1E1B4B !important; }

/* ── Border colours ────────────────────────────────────── */
.border-\[#C7D2FE\] { border-color: #C7D2FE !important; }
.border-\[#6366F1\] { border-color: #A5B4FC !important; }
.border-\[#4e4b5c\] { border-color: #dddae8 !important; }

/* Divider bars (div used as visual separator) */
.bg-\[#C7D2FE\].w-px,
.w-px.bg-\[#C7D2FE\] { background-color: #C7D2FE !important; }
.h-px.bg-\[#C7D2FE\],
.bg-\[#C7D2FE\].h-px { background-color: #C7D2FE !important; }

/* ── Page loader (base.html uses inline Tailwind) ──────── */
#page-loader.bg-\[#1E1B4B\]\/90,
#page-loader.bg-\[#EEF2FF\]\/90 {
    background-color: rgba(248,247,251,0.90) !important;
}
#page-loader .border-\[#C7D2FE\] {
    border-color: #dddae8 !important;
}
#page-loader .text-\[#6272C1\] {
    color: #6272C1 !important;
}

/* ── Navbar dropdown (navbar.html hardcoded classes) ───── */
header .bg-\[#ffffff\]   { background-color: #ffffff !important; }
header .border-\[#C7D2FE\]{ border-color: #e8e3f0 !important; }
header .text-\[#1E1B4B\]  { color: #1E1B4B !important; }
header .text-\[#6272C1\]  { color: #6366F1 !important; }
header .text-\[#6272C1\]  { color: #6272C1 !important; }
header .hover\:bg-\[#EEF2FF\]:hover { background-color: #EEF2FF !important; }
header .text-\[#f87171\]  { color: #dc2626 !important; }
header .hover\:bg-\[rgba\(248\,113\,113\,0\.08\)\]:hover {
    background-color: rgba(248,113,113,0.08) !important;
}

/* ── Sidebar (sidebar.html hardcoded classes) ──────────── */
aside .bg-\[#ffffff\]    { background-color: #ffffff !important; }
aside .bg-\[#EEF2FF\]    { background-color: #EEF2FF !important; }
aside .border-\[#C7D2FE\] { border-color: #C7D2FE !important; }
aside .text-\[#1E1B4B\]  { color: #1E1B4B !important; }
aside .text-\[#6272C1\]  { color: #6366F1 !important; }
aside .text-\[#6272C1\]  { color: #6272C1 !important; }

/* ── Dashboard & general page content ──────────────────── */
main .bg-\[#ffffff\]     { background-color: #ffffff !important; }
main .bg-\[#F5F3FF\]     { background-color: #F5F3FF !important; }
main .bg-\[#EEF2FF\]     { background-color: #EEF2FF !important; }
main .bg-\[#C7D2FE\]     { background-color: #eceaf4 !important; }
main .bg-\[#18161e\]     { background-color: #faf9fd !important; }
main .text-\[#1E1B4B\]   { color: #1E1B4B !important; }
main .text-\[#6272C1\]   { color: #6366F1 !important; }
main .text-\[#6272C1\]   { color: #6272C1 !important; }
main .text-\[#4e4b5c\]   { color: #6272C1 !important; }
main .text-\[#6366F1\]   { color: #b0acc4 !important; }
main .border-\[#C7D2FE\] { border-color: #C7D2FE !important; }
main .border-\[#6366F1\] { border-color: #A5B4FC !important; }
main .hover\:bg-\[#EEF2FF\]:hover { background-color: #EEF2FF !important; }
main .hover\:text-\[#1E1B4B\]:hover { color: #1E1B4B !important; }
main .hover\:bg-\[#C7D2FE\]:hover { background-color: #eceaf4 !important; }

/* ── Modal panels (anywhere on page) ──────────────────── */
.bg-\[#ffffff\].rounded-xl,
.bg-\[#ffffff\].rounded-2xl,
.bg-\[#ffffff\].rounded-\[20px\] { background-color: #ffffff !important; }

/* ── Auto-reply textarea / comment boxes ───────────────── */
textarea.bg-\[#ffffff\],
textarea.bg-\[#F5F3FF\],
textarea.bg-\[#EEF2FF\] {
    background-color: #F5F3FF !important;
    color: #1E1B4B !important;
    border-color: #C7D2FE !important;
}
textarea {
    color-scheme: light;
}

/* ── Inline box shadow overrides ────────────────────────── */
.shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.06\)\] {
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06) !important;
}

/* ── Dividers using bg colour as border ─────────────────── */
[class*="bg-[#C7D2FE]"][class*="h-px"],
[class*="h-px"][class*="bg-[#C7D2FE]"],
[class*="bg-[#C7D2FE]"][class*="w-px"],
[class*="w-px"][class*="bg-[#C7D2FE]"] {
    background-color: #C7D2FE !important;
}

/* ── Breadcrumb home icon ───────────────────────────────── */
.text-\[#6366F1\] { color: #A5B4FC !important; }

/* ── Scrollbar colour override ────────────────────────── */
.scrollbar-color-\[#6366F1\] {
    scrollbar-color: #A5B4FC transparent !important;
}

/* ══════════════════════════════════════════════════════════
   Targeted fixes for inline-style CSS vars
   and dynamically generated content
   ══════════════════════════════════════════════════════════ */


/* ── sp-card--lead gradient override ────────────────────── */
.sp-card--lead {
    background: linear-gradient(135deg, #ffffff 0%, #F5F7FF 50%, #EEF2FF 100%) !important;
    border-color: rgba(99,102,241,0.12) !important;
}

/* ── Modal backdrops (bg-[#0a0818]/70, bg-[#1E1B4B]) ───── */
.bg-\[#0a0818\]\/70 {
    background-color: rgba(200,195,220,0.55) !important;
}
.bg-\[#0a0818\]\/60 {
    background-color: rgba(200,195,220,0.45) !important;
}

/* ── Placeholder text colour override ─────────────────── */
.placeholder-\[#6272C1\]::placeholder {
    color: #6272C1 !important;
    opacity: 1;
}
input::placeholder,
textarea::placeholder {
    color: var(--sp-text-muted);
    opacity: 1;
}

/* ── API keys: JS-generated input fields ───────────────── */
main input[class*="bg-[#F5F3FF]"],
main input[class*="bg-[#ffffff]"] {
    background-color: #F5F3FF !important;
    color: #1E1B4B !important;
    border-color: #C7D2FE !important;
}

/* ── Stepper inactive badges (inline Tailwind on bg color) */
main .rounded-full.bg-\[#C7D2FE\] {
    background-color: #eceaf4 !important;
}
main .rounded-full.bg-\[#C7D2FE\].text-\[#6272C1\] {
    color: #6272C1 !important;
}

/* ── Auto-reply step progress divider (h-px bg-[#C7D2FE]) */
main .h-px.bg-\[#C7D2FE\] {
    background-color: #C7D2FE !important;
}
main .flex-1.h-px.bg-\[#C7D2FE\] {
    background-color: #C7D2FE !important;
}

/* ── Vertical divider (w-px) ────────────────────────────── */
main .h-6.w-px.bg-\[#C7D2FE\],
main .w-px.h-6.bg-\[#C7D2FE\],
main .h-px.w-full.bg-\[#C7D2FE\] {
    background-color: #C7D2FE !important;
}

/* ── Spinner icon colour override ──────────────────────── */
main .text-\[#C7D2FE\] {
    color: #A5B4FC !important;
}

/* ── Auto-reply queue items (JS-generated) bg+border ─────── */
main .border.border-\[#C7D2FE\] {
    border-color: #C7D2FE !important;
}
main .hover\:bg-\[#F5F3FF\]:hover {
    background-color: #f5f3f9 !important;
}

/* ── Connected Pages buttons (inline Tailwind combos) ────── */
main button.bg-\[#F5F3FF\] {
    background-color: #f5f3f9 !important;
    color: #6366F1 !important;
}
main button.bg-\[#F5F3FF\]:hover {
    background-color: #eceaf4 !important;
}

/* ── Icon containers (small rounded square bg) ──────────── */
main .w-10.h-10.rounded-lg.bg-\[#F5F3FF\],
main .w-11.h-11.rounded-xl.bg-\[#F5F3FF\] {
    background-color: #EEF2FF !important;
}

/* ── Sticky header in JS-generated content ──────────────── */
main .sticky.bg-\[#ffffff\] {
    background-color: #ffffff !important;
}

/* ── Modal footer bar (bg-[#F5F3FF] at bottom of modals) ── */
main .bg-\[#F5F3FF\].border-t,
main .border-t.bg-\[#F5F3FF\] {
    background-color: #faf9fd !important;
    border-top-color: #e8e3f0 !important;
}

/* ── Filter divider (bg-[#C7D2FE] used as a | char) ─────── */
main span.text-\[#C7D2FE\] {
    color: #dddae8 !important;
}

/* ── Pages: platform icon area ──────────────────────────── */
main .bg-\[#F5F3FF\].rounded-lg {
    background-color: #EEF2FF !important;
}

/* ── Page hero text colour overrides (Tailwind classes) ──── */
.sp-page-hero .text-\[#1E1B4B\],
.sp-dash-hero .text-\[#1E1B4B\] {
    color: #1E1B4B !important;
}
.sp-page-hero .text-\[#6272C1\],
.sp-dash-hero .text-\[#6272C1\] {
    color: #6272C1 !important;
}
.sp-page-hero .text-\[#6272C1\],
.sp-dash-hero .text-\[#6272C1\] {
    color: #6366F1 !important;
}

/* ── Navbar company badge (inline Tailwind) ─────────────── */
header .bg-\[#EEF2FF\].text-\[#6272C1\] {
    background-color: #EEF2FF !important;
    color: #6366F1 !important;
    border-color: #C7D2FE !important;
}

/* ── Tables with inline text coloring ───────────────────── */
.sp-table .text-\[#1E1B4B\] { color: #1E1B4B !important; }
.sp-table .text-\[#6272C1\] { color: #6366F1 !important; }
.sp-table .text-\[#6272C1\] { color: #6272C1 !important; }

/* ── Tailwind border-b colour override (tabs) ───────────── */
.border-b.border-\[#C7D2FE\] {
    border-color: #C7D2FE !important;
}

/* ── Auto-reply JS-generated step stepper via className ─── */
span.bg-\[#C7D2FE\].text-\[#6272C1\] {
    background-color: #eceaf4 !important;
    color: #6272C1 !important;
}


/* ══════════════════════════════════════════════════════════
   Robust Attribute-Selector Overrides
   Uses [class~="value"] word-matching so that Tailwind
   arbitrary-value classes containing # and [ characters are
   reliably targeted without needing CSS identifier escaping.
   These run AFTER all earlier rules and use !important, so
   they win regardless of specificity or escaping support.
   ══════════════════════════════════════════════════════════ */

/* ── Background colours (main content) ────────────────── */
main [class~="bg-[#EEF2FF]"]  { background-color: #f8f7fb !important; }
main [class~="bg-[#1E1B4B]"]  { background-color: #f8f7fb !important; }
main [class~="bg-[#0f0d16]"]  { background-color: #f9f8fd !important; }
main [class~="bg-[#ffffff]"]  { background-color: #ffffff !important; }
main [class~="bg-[#18161e]"]  { background-color: #faf9fd !important; }
main [class~="bg-[#F5F3FF]"]  { background-color: #f5f3f9 !important; }
main [class~="bg-[#EEF2FF]"]  { background-color: #EEF2FF !important; }
main [class~="bg-[#C7D2FE]"]  { background-color: #eceaf4 !important; }
main [class~="bg-[#6366F1]"]  { background-color: #C7D2FE !important; }
main [class~="bg-[#4e4b5c]"]  { background-color: #A5B4FC !important; }

/* ── Icon containers (fixed-size square divs) get a stronger accent tint ── */
main [class~="w-8"][class~="h-8"][class~="bg-[#F5F3FF]"]   { background-color: #EEF2FF !important; }
main [class~="w-9"][class~="h-9"][class~="bg-[#F5F3FF]"]   { background-color: #EEF2FF !important; }
main [class~="w-10"][class~="h-10"][class~="bg-[#F5F3FF]"] { background-color: #EEF2FF !important; }
main [class~="w-11"][class~="h-11"][class~="bg-[#F5F3FF]"] { background-color: #EEF2FF !important; }
main [class~="w-12"][class~="h-12"][class~="bg-[#F5F3FF]"] { background-color: #EEF2FF !important; }
main [class~="w-14"][class~="h-14"][class~="bg-[#F5F3FF]"] { background-color: #EEF2FF !important; }

/* ── Opacity-variant backgrounds (modal backdrops) ─────── */
[class~="bg-[#0a0818]/70"] { background-color: rgba(200,195,220,0.55) !important; }
[class~="bg-[#0a0818]/60"] { background-color: rgba(200,195,220,0.45) !important; }
[class~="bg-[#EEF2FF]/90"] { background-color: rgba(248,247,251,0.90) !important; }
[class~="bg-[#1E1B4B]/90"] { background-color: rgba(248,247,251,0.90) !important; }
[class~="bg-[#ffffff]/90"] { background-color: rgba(255,255,255,0.90) !important; }

/* ── Hover backgrounds ──────────────────────────────────── */
main [class~="hover:bg-[#F5F3FF]"]:hover  { background-color: #eceaf4 !important; }
main [class~="hover:bg-[#EEF2FF]"]:hover  { background-color: #EEF2FF !important; }
main [class~="hover:bg-[#C7D2FE]"]:hover  { background-color: #eceaf4 !important; }

/* ── Text colours ───────────────────────────────────────── */
main [class~="text-[#1E1B4B]"] { color: #1E1B4B !important; }
main [class~="text-[#6272C1]"] { color: #6366F1 !important; }
main [class~="text-[#6272C1]"] { color: #6272C1 !important; }
main [class~="text-[#4e4b5c]"] { color: #6272C1 !important; }
main [class~="text-[#6366F1]"] { color: #b0acc4 !important; }
main [class~="text-[#C7D2FE]"] { color: #A5B4FC !important; }

/* ── Hover text ─────────────────────────────────────────── */
main [class~="hover:text-[#1E1B4B]"]:hover { color: #1E1B4B !important; }

/* ── Border colours ─────────────────────────────────────── */
main [class~="border-[#C7D2FE]"] { border-color: #C7D2FE !important; }
main [class~="border-[#6366F1]"] { border-color: #A5B4FC !important; }
main [class~="border-[#4e4b5c]"] { border-color: #dddae8 !important; }

/* ── Placeholder ────────────────────────────────────────── */
main [class~="placeholder-[#6272C1]"]::placeholder { color: #6272C1 !important; opacity: 1; }

/* ── Focus ring / border ────────────────────────────────── */
main [class~="focus:ring-[#C7D2FE]"]:focus  { box-shadow: 0 0 0 2px rgba(99,102,241,0.20) !important; }
main [class~="focus:border-[#C7D2FE]"]:focus { border-color: #6366F1 !important; }

/* ── Header / navbar (attribute-selector variants) ─────── */
header [class~="bg-[#ffffff]"]            { background-color: #ffffff !important; }
header [class~="bg-[#EEF2FF]"]            { background-color: #EEF2FF !important; }
header [class~="border-[#C7D2FE]"]        { border-color: #e8e3f0 !important; }
header [class~="text-[#1E1B4B]"]          { color: #1E1B4B !important; }
header [class~="text-[#6272C1]"]          { color: #6366F1 !important; }
header [class~="text-[#6272C1]"]          { color: #6272C1 !important; }
header [class~="text-[#f87171]"]          { color: #dc2626 !important; }
header [class~="hover:bg-[#EEF2FF]"]:hover { background-color: #EEF2FF !important; }

/* ── Connected Pages card — action button refinements ───── */
/* Sync Now / Clear Data / Remove buttons need light bg + visible border */
main button[class~="bg-[#F5F3FF]"] {
    background-color: #f5f3f9 !important;
    color: #6366F1 !important;
    border-color: #C7D2FE !important;
}
main button[class~="bg-[#F5F3FF]"]:hover {
    background-color: #eceaf4 !important;
    color: #1E1B4B !important;
}

/* ── Modal & overlay content (fixed-positioned, still in main DOM) ── */
/* Confirm / Sync / Connect modals */
[class~="bg-[#ffffff]"][class~="rounded-xl"],
[class~="bg-[#ffffff]"][class~="rounded-2xl"] {
    background-color: #ffffff !important;
    box-shadow: 0 20px 60px -10px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.06) !important;
}
main [class~="border-b"][class~="border-[#C7D2FE]"] { border-color: #e8e3f0 !important; }
main [class~="border-t"][class~="border-[#C7D2FE]"] { border-color: #e8e3f0 !important; }

/* ── Scrollbar inside panels ───────────────────────────── */
main [class~="bg-[#ffffff]"] ::-webkit-scrollbar-thumb,
main [class~="bg-[#F5F3FF]"] ::-webkit-scrollbar-thumb {
    background: var(--sp-border-strong);
}


/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE — ROUND 5: Fixed modals, selects, textareas & more
   ═══════════════════════════════════════════════════════════════ */

/* ── Fixed overlay modals: panel & all content ──────────────── */
.fixed.inset-0 .bg-\[#ffffff\],
.fixed.inset-0 .bg-\[#1E1B4B\] {
    background-color: #ffffff !important;
}
.fixed.inset-0 .bg-\[#F5F3FF\] {
    background-color: #f5f3f9 !important;
}
.fixed.inset-0 .bg-\[#EEF2FF\] {
    background-color: #EEF2FF !important;
}
.fixed.inset-0 .text-\[#1E1B4B\] {
    color: #1E1B4B !important;
}
.fixed.inset-0 .text-\[#6272C1\] {
    color: #6366F1 !important;
}
.fixed.inset-0 .text-\[#6272C1\] {
    color: #6272C1 !important;
}
.fixed.inset-0 .border-\[#C7D2FE\] {
    border-color: #C7D2FE !important;
}
.fixed.inset-0 .border-b.border-\[#C7D2FE\] {
    border-bottom-color: #C7D2FE !important;
}
.fixed.inset-0 .border-t.border-\[#C7D2FE\] {
    border-top-color: #C7D2FE !important;
}
.fixed.inset-0 .hover\:bg-\[#EEF2FF\]:hover {
    background-color: #EEF2FF !important;
}
.fixed.inset-0 .hover\:text-\[#1E1B4B\]:hover {
    color: #1E1B4B !important;
}
.fixed.inset-0 .sticky.bg-\[#ffffff\] {
    background-color: #ffffff !important;
}

/* ── Fixed modal: all form inputs, textareas, selects ────────── */
.fixed.inset-0 input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.fixed.inset-0 textarea,
.fixed.inset-0 select {
    background-color: #F5F3FF !important;
    color: #1E1B4B !important;
    border-color: #C7D2FE !important;
}
.fixed.inset-0 input::placeholder,
.fixed.inset-0 textarea::placeholder {
    color: #6272C1 !important;
}

/* ── Main area: select and textarea background overrides ────── */
main select[class*="bg-[#ffffff]"],
main select[class*="bg-[#1E1B4B]"],
main select[class*="bg-[#F5F3FF]"],
main textarea[class*="bg-[#ffffff]"],
main textarea[class*="bg-[#1E1B4B]"] {
    background-color: #F5F3FF !important;
    color: #1E1B4B !important;
    border-color: #C7D2FE !important;
}
main textarea[class*="placeholder-[#6272C1]"]::placeholder,
main textarea::placeholder {
    color: #6272C1 !important;
}

/* ── bg-[#C7D2FE] used as background (icon containers, avatars) */
main .bg-\[#C7D2FE\] {
    background-color: #eceaf4 !important;
}

/* ── border-t / border-l / border-r / border-b colour override ─ */
main .border-t.border-\[#C7D2FE\] {
    border-top-color: #C7D2FE !important;
}
main .border-l-2.border-\[#C7D2FE\],
main .border-l-4.border-\[#C7D2FE\] {
    border-left-color: #C7D2FE !important;
}
main .border-r.border-\[#C7D2FE\],
main .lg\:border-r.border-\[#C7D2FE\] {
    border-right-color: #C7D2FE !important;
}
main .border-b.border-\[#C7D2FE\] {
    border-bottom-color: #C7D2FE !important;
}

/* ── Inline platform/language badge spans ────────────────────── */
main span.bg-\[#F5F3FF\] {
    background-color: #EEF2FF !important;
    color: #6366F1 !important;
}
main .rounded-full.bg-\[#F5F3FF\],
main .rounded-full.bg-\[#F5F3FF\] .text-\[#6272C1\] {
    background-color: #EEF2FF !important;
    color: #6366F1 !important;
}

/* ── hover:bg-[#EEF2FF] (list items, buttons) ────────────────── */
main .hover\:bg-\[#EEF2FF\]:hover {
    background-color: #EEF2FF !important;
}

/* ── Inbox left panel: border-b on each item ─────────────────── */
main .border-b.border-\[#C7D2FE\].hover\:bg-\[#EEF2FF\] {
    border-bottom-color: #C7D2FE !important;
}

/* ═══════════════════════════════════════════════════════════════
   Blue colour-variant overrides
   (classes like bg-blue-950/30, text-blue-400, etc.
    remapped to light-friendly equivalents)
   ═══════════════════════════════════════════════════════════════ */

/* ── bg-blue-950/30 → light blue bg ──────────────────────────── */
.bg-blue-950\/30,
main .bg-blue-950\/30 {
    background-color: #eff6ff !important; /* blue-50 */
}
.bg-blue-950\/20,
main .bg-blue-950\/20 {
    background-color: #eff6ff !important;
}

/* ── border-blue-800/40, border-blue-800/30, border-blue-900/40 ── */
.border-blue-800\/40,
main .border-blue-800\/40 {
    border-color: #bfdbfe !important; /* blue-200 */
}
.border-blue-800\/30,
main .border-blue-800\/30 {
    border-color: #bfdbfe !important;
}
.border-blue-900\/40,
main .border-blue-900\/40 {
    border-color: #bfdbfe !important;
}

/* ── hover:bg-blue-900/40, hover:bg-blue-900/20 ─────────────── */
.hover\:bg-blue-900\/40:hover,
main .hover\:bg-blue-900\/40:hover {
    background-color: #dbeafe !important; /* blue-100 */
}
.hover\:bg-blue-900\/20:hover,
main .hover\:bg-blue-900\/20:hover {
    background-color: #dbeafe !important;
}

/* ── hover:bg-blue-950/20 (pages connect btn) ────────────────── */
.hover\:bg-blue-950\/20:hover,
main .hover\:bg-blue-950\/20:hover {
    background-color: #eff6ff !important;
}
.hover\:border-blue-700:hover,
main .hover\:border-blue-700:hover {
    border-color: #3b82f6 !important;
}

/* ── text-blue-400 → darker blue for light bg ────────────────── */
.text-blue-400,
main .text-blue-400 {
    color: #2563eb !important; /* blue-600 */
}

/* ── text-blue-300 → deeper blue for light bg ────────────────── */
.text-blue-300,
main .text-blue-300 {
    color: #1d4ed8 !important; /* blue-700 */
}

/* ── hover:text-blue-300 ─────────────────────────────────────── */
.hover\:text-blue-300:hover,
main .hover\:text-blue-300:hover {
    color: #1e40af !important; /* blue-800 */
}
.hover\:text-blue-400:hover,
main .hover\:text-blue-400:hover {
    color: #1d4ed8 !important;
}

/* ── bg-blue-900/30, bg-blue-900/40, bg-blue-900/20 (badges) ── */
.bg-blue-900\/30,
main .bg-blue-900\/30 {
    background-color: #dbeafe !important; /* blue-100 */
}
.bg-blue-900\/40,
main .bg-blue-900\/40 {
    background-color: #dbeafe !important;
}
.bg-blue-900\/20,
main .bg-blue-900\/20 {
    background-color: #eff6ff !important;
}

/* ── bg-gray-600 / hover:bg-gray-700 (Send Reply btn) ───────── */
main .bg-gray-600 {
    background-color: #1E1B4B !important; /* prominent button */
    color: #ffffff !important;
}
main .hover\:bg-gray-700:hover {
    background-color: #C7D2FE !important;
}

/* ── Teal focus rings (translate section) ────────────────────── */
.focus\:ring-teal-500:focus {
    --tw-ring-color: #14b8a6 !important;
}
.focus\:border-teal-500:focus {
    border-color: #14b8a6 !important;
}

/* ── Blue focus rings ────────────────────────────────────────── */
.focus\:ring-blue-500:focus {
    --tw-ring-color: #3b82f6 !important;
}

/* ── Auto-reply scan UI overrides ────────────────────────────── */
.border-t-blue-500 {
    border-top-color: #3b82f6 !important;
}

/* ── Checkbox accent ─────────────────────────────────────────── */
.text-blue-600 {
    color: #2563eb !important;
}

/* ═══════════════════════════════════════════════════════════════
   Emerald colour-variant overrides (positive/active)
   ═══════════════════════════════════════════════════════════════ */
.bg-emerald-900\/30,
main .bg-emerald-900\/30 {
    background-color: #d1fae5 !important; /* emerald-100 */
}
.bg-emerald-900\/40,
main .bg-emerald-900\/40 {
    background-color: #d1fae5 !important;
}
.bg-emerald-950\/30,
main .bg-emerald-950\/30 {
    background-color: #ecfdf5 !important; /* emerald-50 */
}
.text-emerald-400,
main .text-emerald-400 {
    color: #059669 !important; /* emerald-600 */
}
.hover\:bg-emerald-950\/30:hover,
main .hover\:bg-emerald-950\/30:hover {
    background-color: #d1fae5 !important;
}
.hover\:text-emerald-400:hover,
main .hover\:text-emerald-400:hover {
    color: #047857 !important; /* emerald-700 */
}

/* ═══════════════════════════════════════════════════════════════
   Rose colour-variant overrides (negative/delete)
   ═══════════════════════════════════════════════════════════════ */
.bg-rose-900\/30,
main .bg-rose-900\/30 {
    background-color: #ffe4e6 !important; /* rose-100 */
}
.bg-rose-900\/40,
main .bg-rose-900\/40 {
    background-color: #ffe4e6 !important;
}
.bg-rose-950\/30,
main .bg-rose-950\/30 {
    background-color: #fff1f2 !important; /* rose-50 */
}
.border-rose-800\/40,
main .border-rose-800\/40 {
    border-color: #fecdd3 !important; /* rose-200 */
}
.text-rose-400,
main .text-rose-400 {
    color: #e11d48 !important; /* rose-600 */
}
.hover\:bg-rose-900\/30:hover,
main .hover\:bg-rose-900\/30:hover {
    background-color: #ffe4e6 !important;
}
.hover\:bg-rose-900\/40:hover,
main .hover\:bg-rose-900\/40:hover {
    background-color: #fecdd3 !important;
}
.hover\:text-rose-400:hover,
main .hover\:text-rose-400:hover {
    color: #be123c !important; /* rose-700 */
}
.hover\:bg-rose-500\/10:hover,
main .hover\:bg-rose-500\/10:hover {
    background-color: #fff1f2 !important;
}
.hover\:border-rose-500\/20:hover,
main .hover\:border-rose-500\/20:hover {
    border-color: #fecdd3 !important;
}

/* ═══════════════════════════════════════════════════════════════
   Purple colour-variant overrides (business)
   ═══════════════════════════════════════════════════════════════ */
.bg-purple-900\/30,
main .bg-purple-900\/30 {
    background-color: #f3e8ff !important; /* purple-100 */
}
.bg-purple-900\/40,
main .bg-purple-900\/40 {
    background-color: #f3e8ff !important;
}
.text-purple-400,
main .text-purple-400 {
    color: #9333ea !important; /* purple-600 */
}

/* ═══════════════════════════════════════════════════════════════
   Orange colour-variant overrides (flagged/warning)
   ═══════════════════════════════════════════════════════════════ */
.bg-orange-900\/30,
main .bg-orange-900\/30 {
    background-color: #ffedd5 !important; /* orange-100 */
}
.bg-orange-500\/15,
main .bg-orange-500\/15 {
    background-color: #fff7ed !important; /* orange-50 */
}
.text-orange-400,
main .text-orange-400 {
    color: #ea580c !important; /* orange-600 */
}
.hover\:text-orange-400:hover,
main .hover\:text-orange-400:hover {
    color: #c2410c !important; /* orange-700 */
}
.hover\:bg-orange-500\/10:hover,
main .hover\:bg-orange-500\/10:hover {
    background-color: #fff7ed !important;
}
.hover\:border-orange-500\/20:hover,
main .hover\:border-orange-500\/20:hover {
    border-color: #fed7aa !important; /* orange-200 */
}

/* ═══════════════════════════════════════════════════════════════
   Gray colour-variant overrides (neutral)
   ═══════════════════════════════════════════════════════════════ */
.bg-gray-700\/30,
main .bg-gray-700\/30 {
    background-color: #f3f4f6 !important; /* gray-100 */
}
.text-gray-400,
main .text-gray-400 {
    color: #4b5563 !important; /* gray-600 */
}

/* ═══════════════════════════════════════════════════════════════
   Rose/Emerald 500/15 icon badge overrides
   ═══════════════════════════════════════════════════════════════ */
.bg-rose-500\/15,
main .bg-rose-500\/15 {
    background-color: #fff1f2 !important; /* rose-50 */
}
.hover\:bg-rose-950\/30:hover,
main .hover\:bg-rose-950\/30:hover {
    background-color: #ffe4e6 !important;
}

/* ═══════════════════════════════════════════════════════════════
   Amber colour-variant overrides (warning/flagged)
   ═══════════════════════════════════════════════════════════════ */
.bg-amber-900\/30,
main .bg-amber-900\/30 {
    background-color: #fef3c7 !important; /* amber-100 */
}
.bg-amber-900\/40,
main .bg-amber-900\/40 {
    background-color: #fef3c7 !important;
}
.bg-amber-950\/40,
main .bg-amber-950\/40 {
    background-color: #fffbeb !important; /* amber-50 */
}
.bg-amber-500\/10,
main .bg-amber-500\/10 {
    background-color: #fffbeb !important;
}
.text-amber-400,
main .text-amber-400 {
    color: #d97706 !important; /* amber-600 */
}
.text-amber-300,
main .text-amber-300 {
    color: #b45309 !important; /* amber-700 */
}
.border-amber-800,
main .border-amber-800 {
    border-color: #fcd34d !important; /* amber-300 */
}
.border-amber-500\/20,
main .border-amber-500\/20 {
    border-color: #fde68a !important; /* amber-200 */
}
.hover\:bg-amber-500\/20:hover,
main .hover\:bg-amber-500\/20:hover {
    background-color: #fef3c7 !important;
}
.hover\:bg-amber-900\/40:hover,
main .hover\:bg-amber-900\/40:hover {
    background-color: #fde68a !important;
}

/* ═══════════════════════════════════════════════════════════════
   LinkedIn blue-950/30 in API keys
   ═══════════════════════════════════════════════════════════════ */
.border-blue-800,
main .border-blue-800 {
    border-color: #bfdbfe !important; /* blue-200 */
}

/* ═══════════════════════════════════════════════════════════════
   Auto Sync — Info box
   ═══════════════════════════════════════════════════════════════ */
.sp-sync-info-box {
    background: #eef2ff; /* indigo-50 */
    border: 1px solid #c7d2fe; /* indigo-200 */
}
.sp-sync-icon-circle {
    background: #e0e7ff; /* indigo-100 */
}
.sp-sync-icon {
    color: #4f46e5; /* indigo-600 */
}
.sp-sync-title {
    color: #1e1b4b; /* indigo-950 */
}
.sp-sync-next-run {
    color: var(--sp-text);
}

/* ── Indigo colour-variant overrides ─────────────────────────── */
.bg-indigo-500\/20,
main .bg-indigo-500\/20 {
    background-color: #e0e7ff !important; /* indigo-100 */
}
.text-indigo-400,
main .text-indigo-400 {
    color: #4f46e5 !important; /* indigo-600 */
}


/* ══════════════════════════════════════════════════════════
   BILLING — Theme-aware utility classes
   ══════════════════════════════════════════════════════════ */

.sp-bill-surface {
    background: var(--sp-bg-card);
    border: 1px solid #e0dced;
    border-radius: 16px;
}
.sp-bill-surface-inner {
    background: #f5f3f9;
}
.sp-bill-text { color: var(--sp-text); }
.sp-bill-text-muted { color: var(--sp-text-secondary); }
.sp-bill-text-dim { color: #8b85a0; }
.sp-bill-border { border-color: #e0dced; }
.sp-bill-divider { border-top: 1px solid #e0dced; }

.sp-bill-chip {
    background: #ede9f5;
    color: var(--sp-text-secondary);
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background 0.15s ease, color 0.15s ease;
    border: none;
    cursor: pointer;
}
.sp-bill-chip:hover { background: #e0dced; color: var(--sp-text); }

.sp-bill-tab {
    color: var(--sp-text-secondary);
    border-bottom: 2px solid transparent;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    white-space: nowrap;
}
.sp-bill-tab:hover { color: var(--sp-text); }
.sp-bill-tab.active { color: var(--sp-text-secondary); border-bottom-color: var(--sp-text-secondary); }

.sp-bill-table { width: 100%; font-size: 0.875rem; }
.sp-bill-table thead th {
    color: var(--sp-text-secondary);
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #e0dced;
    background: #f5f3f9;
    font-size: 0.8125rem;
    text-align: left;
}
.sp-bill-table tbody tr { border-bottom: 1px solid #e0dced; transition: background 0.1s ease; }
.sp-bill-table tbody tr:hover { background: #f8f6fc; }
.sp-bill-table tbody td { padding: 0.875rem 1.25rem; color: var(--sp-text-secondary); }

.sp-bill-plan-card {
    background: var(--sp-bg-card);
    border: 1px solid #e0dced;
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.15s ease;
}
.sp-bill-plan-card:hover { border-color: #b0acc4; }
.sp-bill-plan-card.featured { border-color: var(--sp-text-secondary); box-shadow: 0 0 24px rgba(99,102,241,0.12); }
.sp-bill-plan-card.current { border-color: #16a34a; }

/* ═══════════════════════════════════════════════════════════════
   Clients page & table overrides
   ═══════════════════════════════════════════════════════════════ */

/* ── Table row hover (hover:bg-[#EEF2FF]) ─────────────────── */
main [class~="hover:bg-[#EEF2FF]"]:hover { background-color: #f5f3f9 !important; }

/* ── Table dividers (divide-[#C7D2FE]) ─────────────────────── */
main [class~="divide-[#C7D2FE]"] > * + * { border-color: #C7D2FE !important; }
main .divide-y[class~="divide-[#C7D2FE]"] > * + * { border-color: #C7D2FE !important; }

/* ── Platform badges in tables ────────────────────────────── */
main [class*="bg-blue-900/40"]  { background-color: rgba(59,130,246,0.1) !important; }
main [class*="bg-pink-900/40"]  { background-color: rgba(236,72,153,0.1) !important; }
main [class*="bg-red-900/40"]   { background-color: rgba(239,68,68,0.1) !important; }
main [class*="bg-yellow-900/40"]{ background-color: rgba(234,179,8,0.1) !important; }

/* ── Inline action buttons on client rows ──────────────────── */
main .hover\:bg-\[#EEF2FF\]:hover { background-color: #EEF2FF !important; }
main [class~="hover:text-[#1E1B4B]"]:hover { color: #1E1B4B !important; }

/* ── Delete modal with rounded-2xl panel ───────────────────── */
.fixed.inset-0 [class~="bg-[#ffffff]"][class~="rounded-2xl"] {
    background-color: #ffffff !important;
}
.fixed.inset-0 [class~="bg-[#F5F3FF]"][class~="border-t"] {
    background-color: #faf9fd !important;
    border-top-color: #e8e3f0 !important;
}

/* ══════════════════════════════════════════════════════════
   PREMIUM ENHANCEMENTS — Global refinements
   ══════════════════════════════════════════════════════════ */

/* ── Premium entrance animation for all pages ─────────── */
main > *:first-child {
    animation: sp-premium-enter 0.35s ease-out;
}
@keyframes sp-premium-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Hidden scrollbar (keep scroll functionality) ────── */
::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    display: none;
}

/* ── Premium text rendering ──────────────────────────── */
body.sp-app-bg {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ── Premium card top accent strip ──────────────────── */
.sp-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366F1, #6272C1, #A5B4FC);
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
    transition: opacity 0.3s;
}
.sp-card:hover::after {
    opacity: 0.8;
}


/* ── Premium table wrapper top highlight ─────────────── */
.sp-table-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    pointer-events: none;
    z-index: 3;
}
.sp-table-wrapper {
    position: relative;
}

/* ── Premium badge refinements ───────────────────────── */
.sp-badge {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ── Premium button press effect ─────────────────────── */
.sp-btn:active,
.sp-hero-btn:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

/* (tooltip shadows moved into main sidebar block) */

/* ── Premium input select refinement ─────────────────── */
.sp-input-select {
    border: 1.5px solid rgba(0,0,0,0.08);
}
.sp-input-select:hover {
    border-color: rgba(0,0,0,0.12);
}
.sp-input-select:focus {
    border-color: var(--sp-text-secondary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.08), 0 0 0 1px rgba(99,102,241,0.15);
}

/* ── Premium select dropdown ─────────────────────────── */
.sp-select {
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.sp-select:focus {
    border-color: var(--sp-text-secondary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}

/* ── Premium sidebar overlay ─────────────────────────── */
#sidebar-overlay {
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ── Premium page loader ─────────────────────────────── */
#page-loader {
    background: rgba(248,247,251,0.90) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* ── Premium billing cards ───────────────────────────── */
.sp-bill-surface {
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px -8px rgba(0,0,0,0.03);
}

.sp-bill-plan-card {
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px -8px rgba(0,0,0,0.03);
}

/* ── Premium inbox refinements ───────────────────────── */
.inbox-comment-card {
    border-radius: 12px;
    margin-bottom: 2px;
}
.inbox-comment-card.active {
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.08);
}

/* ── Premium empty state ─────────────────────────────── */
.sp-empty-state__icon {
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ── Premium selection color ─────────────────────────── */
::selection {
    background: rgba(99, 102, 241, 0.15);
    color: inherit;
}

/* ══════════════════════════════════════════════════════════
   COMPREHENSIVE MOBILE & RESPONSIVE FIXES
   ══════════════════════════════════════════════════════════ */

/* ── Topbar responsive ────────────────────────────────── */
.sp-topbar {
    flex-wrap: wrap;
}

@media (max-width: 639px) {
    /* Topbar: compact on mobile */
    .sp-topbar {
        gap: 8px;
        margin-bottom: 14px;
    }

    /* Main content: tighter padding on mobile */
    main.overflow-y-auto {
        padding: 12px !important;
    }

}

@media (max-width: 479px) {
    main.overflow-y-auto {
        padding: 10px !important;
    }
}

/* ── Dropdown: constrain to viewport on mobile ────────── */
@media (max-width: 639px) {
    .sp-navbar__dropdown {
        position: fixed !important;
        right: 10px !important;
        left: 10px !important;
        top: auto !important;
        bottom: 10px !important;
        width: auto !important;
        max-width: none;
        border-radius: 16px;
    }
}

/* ── Dashboard hero responsive ────────────────────────── */
@media (max-width: 639px) {
    .sp-dash-hero__content {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .sp-dash-hero__actions {
        width: 100%;
    }
    .sp-dash-hero__actions .flex {
        width: 100%;
    }
    .sp-date-range-group {
        flex: 1;
        min-width: 0;
    }
    .sp-date-range-group__input {
        width: 100%;
    }
}

/* ── KPI grid responsive ──────────────────────────────── */
@media (max-width: 479px) {
    .grid.grid-cols-2.lg\:grid-cols-4 {
        gap: 8px !important;
    }
    .sp-kpi {
        padding: 10px 12px;
        border-radius: 10px;
    }
}

/* ── Sentiment mini-cards responsive ──────────────────── */
@media (max-width: 479px) {
    .grid.grid-cols-2.sm\:grid-cols-3.lg\:grid-cols-5 {
        gap: 8px !important;
    }
    .sp-kpi-mini {
        padding: 8px;
    }
    .sp-kpi-mini__value {
        font-size: 1.1rem;
    }
    .sp-kpi-mini__label {
        font-size: 0.6rem;
    }
}

/* ── Filter strip responsive ──────────────────────────── */
@media (max-width: 639px) {
    .sp-filter-strip {
        padding: 10px 12px;
        border-radius: 12px;
    }
    .sp-filter-strip .flex.items-center.gap-4 {
        gap: 8px;
    }
    /* Platform icon buttons: scrollable row */
    .sp-filter-strip .flex.items-center.gap-2.flex-shrink-0 {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        max-width: 100%;
        padding-bottom: 2px;
    }
    .sp-filter-strip .flex.items-center.gap-2.flex-shrink-0::-webkit-scrollbar {
        display: none;
    }
    /* Dropdowns: full width */
    .sp-filter-strip #channelFilterWrapper,
    .sp-filter-strip #postFilterWrapper {
        width: 100%;
    }
    .sp-filter-strip .sp-input-select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    /* Divider: hidden on mobile */
    .sp-filter-strip .h-6.w-px {
        display: none;
    }
    .sp-filter-strip .flex.items-center.gap-4.flex-wrap {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ── Command bar responsive ───────────────────────────── */
@media (max-width: 639px) {
    .sp-command-bar {
        padding: 10px 12px;
        gap: 8px;
        border-radius: 12px;
    }
    .sp-command-bar__title {
        font-size: 0.9375rem;
    }
}

/* ── Charts responsive (tablet + mobile) ──────────────── */
@media (max-width: 767px) {
    .sp-card--chart canvas {
        max-height: 250px;
    }
    /* Analytics grid: single column */
    .grid.grid-cols-12 {
        display: flex !important;
        flex-direction: column;
    }
    .grid.grid-cols-12 > [class*="col-span-"] {
        grid-column: span 12 / span 12 !important;
    }
}

@media (max-width: 479px) {
    .sp-card--chart canvas {
        max-height: 200px;
    }
}

/* ── Tables responsive ────────────────────────────────── */
.sp-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
    /* Make table scrollable with min-width */
    .sp-table-wrapper table {
        min-width: 600px;
    }
    .sp-table th,
    .sp-table td {
        padding: 8px 10px;
        font-size: 0.8125rem;
        white-space: nowrap;
    }
}

@media (max-width: 479px) {
    .sp-table-wrapper table {
        min-width: 520px;
    }
    .sp-table th,
    .sp-table td {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
}

/* ── Cards general responsive ─────────────────────────── */
@media (max-width: 479px) {
    .sp-card {
        padding: 14px;
        border-radius: 12px;
    }
    .sp-section-title {
        font-size: 0.75rem;
    }
    .sp-section-title i {
        width: 24px;
        height: 24px;
        font-size: 0.6rem;
        border-radius: 6px;
        margin-right: 8px;
    }
    .sp-card__header {
        padding-bottom: 10px;
        margin-bottom: 14px;
    }
}

/* ── Page hero responsive ─────────────────────────────── */
@media (max-width: 639px) {
    .sp-page-hero {
        padding: 16px 14px;
        border-radius: 14px;
    }
    .sp-page-hero__title {
        font-size: 1.1rem;
    }
    .sp-page-hero__subtitle {
        font-size: 0.8rem;
    }
    .sp-page-hero__actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    .sp-hero-btn {
        padding: 7px 12px;
        font-size: 0.75rem;
    }
}

/* ── Modals responsive ────────────────────────────────── */
@media (max-width: 639px) {
    .sp-modal-panel {
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 20px);
        margin: 10px;
        border-radius: 14px !important;
    }
    .sp-modal-panel .p-6,
    .sp-modal-panel .px-6 {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}

@media (max-width: 374px) {
    .sp-modal-panel {
        max-width: calc(100vw - 12px) !important;
        margin: 6px;
    }
}

/* ── Sidebar mobile: smaller on tiny phones ───────────── */
@media (max-width: 374px) {
    #sidebar {
        width: 240px !important;
        left: 8px;
        top: 8px;
        height: calc(100% - 8px);
    }
    .sp-sidebar__link {
        font-size: 0.75rem;
    }
    .sp-sidebar__icon-box {
        width: 30px;
        height: 30px;
    }
}

/* ── Subscription alert banner responsive ─────────────── */
@media (max-width: 479px) {
    .flex.items-center.justify-between.gap-4.rounded-xl.border {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px !important;
    }
    .flex.items-center.justify-between.gap-4.rounded-xl.border a {
        width: 100%;
        text-align: center;
    }
}

/* ── Inbox responsive ─────────────────────────────────── */
@media (max-width: 767px) {
    .inbox-left {
        min-width: 0 !important;
        width: 100%;
    }
}

/* ── Posts page select cards responsive ────────────────── */
@media (max-width: 479px) {
    .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        gap: 10px !important;
    }
}

/* ── Contacts table: hide columns progressively ──────── */
@media (max-width: 767px) {
    .sp-table .col-phone,
    .sp-table .col-contacted {
        display: none;
    }
}

@media (max-width: 479px) {
    .sp-table .col-type,
    .sp-table .col-date {
        display: none;
    }
}

/* ── Pagination responsive ────────────────────────────── */
@media (max-width: 479px) {
    .sp-pagination {
        gap: 4px;
    }
    .sp-pagination button,
    .sp-pagination a {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
        padding: 0 6px;
    }
}

/* ── OAuth connect buttons: better tap targets ────────── */
@media (max-width: 374px) {
    .grid.grid-cols-2 button,
    .grid.grid-cols-2 a {
        min-height: 44px;
        font-size: 0.8rem;
    }
}

/* ── Settings pages responsive ────────────────────────── */
@media (max-width: 639px) {
    .sp-settings-card {
        padding: 14px;
    }
    .sp-settings-card .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}

/* ── Empty state responsive ───────────────────────────── */
@media (max-width: 479px) {
    .sp-empty-state__icon,
    .sp-empty i.text-4xl,
    .sp-empty i.text-5xl {
        font-size: 2rem !important;
    }
    .sp-empty-state__title {
        font-size: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   CREATE POST PAGE
   ═══════════════════════════════════════════════════════════ */

.sp-create-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #C7D2FE;
    border-radius: 12px;
    background: #faf6fb;
    color: var(--sp-text);
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.sp-create-textarea:focus {
    outline: none;
    border-color: var(--sp-text-muted);
    box-shadow: 0 0 0 3px rgba(150, 129, 161, 0.15);
    background: #fff;
}
.sp-create-textarea::placeholder {
    color: #b8a6bc;
}

.sp-create-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #C7D2FE;
    border-radius: 10px;
    background: #faf6fb;
    color: var(--sp-text);
    font-size: 0.8125rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.sp-create-input:focus {
    outline: none;
    border-color: var(--sp-text-muted);
    box-shadow: 0 0 0 3px rgba(150, 129, 161, 0.15);
    background: #fff;
}
.sp-create-input::placeholder {
    color: #b8a6bc;
}

/* Page selection item */
.sp-page-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1.5px solid #F5F3FF;
    background: #faf6fb;
    cursor: pointer;
    transition: all 0.2s;
}
.sp-page-select-item:hover {
    border-color: var(--sp-border);
    background: #f5eef6;
}
.sp-page-select-item:has(.sp-page-checkbox:checked) {
    border-color: var(--sp-text-muted);
    background: var(--sp-bg-input);
}

.sp-page-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sp-page-check-indicator {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 1.5px solid #C7D2FE;
    background: #faf6fb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    color: transparent;
}
.sp-page-select-item:has(.sp-page-checkbox:checked) .sp-page-check-indicator {
    background: var(--sp-text);
    border-color: var(--sp-text);
    color: #fff;
}

/* Publish button — inherits from .sp-btn-primary above, just layout tweaks */
.sp-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--sp-accent), var(--sp-accent-hover));
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.sp-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* ── Drag & Drop Zone ──────────────────────────────────── */
.sp-drop-zone {
    border: 2px dashed #C7D2FE;
    border-radius: 14px;
    background: #faf6fb;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
}
.sp-drop-zone:hover {
    border-color: var(--sp-text-muted);
    background: #f5eef6;
}
.sp-drop-zone.dragover {
    border-color: var(--sp-text);
    background: var(--sp-bg-input);
    box-shadow: 0 0 0 4px rgba(30, 27, 75, 0.08);
}
.sp-drop-zone.has-file {
    border-style: solid;
    border-color: var(--sp-text-muted);
    cursor: default;
    padding: 16px;
}

.sp-drop-zone__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.sp-drop-zone__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--sp-bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: var(--sp-text-muted);
    font-size: 1.25rem;
}

.sp-drop-zone__preview {
    display: flex;
    align-items: center;
    gap: 14px;
}
.sp-drop-zone__preview img,
.sp-drop-zone__preview video {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--sp-bg-input);
    flex-shrink: 0;
}
.sp-drop-zone__preview video {
    width: 120px;
    height: 80px;
}
.sp-drop-zone__preview-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
    text-align: left;
}
.sp-drop-zone__remove {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1.5px solid #C7D2FE;
    background: #faf6fb;
    color: var(--sp-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
}
.sp-drop-zone__remove:hover {
    background: #fde8e8;
    border-color: #f87171;
    color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════
   LIVE PREVIEW CARDS
   ═══════════════════════════════════════════════════════════ */
.sp-pv {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--sp-border);
    overflow: hidden;
}
.sp-pv__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0e8f2;
}
.sp-pv__badge {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.625rem;
    flex-shrink: 0;
}
.sp-pv__platform-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--sp-text);
}
.sp-pv__char-count {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--sp-text-muted);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.sp-pv__char-count.warning { color: #f59e0b; }
.sp-pv__char-count.over-limit { color: #ef4444; font-weight: 700; }

.sp-pv__body {
    padding: 12px 14px;
}
.sp-pv__author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.sp-pv__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--sp-bg-input);
}
.sp-pv__avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}
.sp-pv__author-info { min-width: 0; }
.sp-pv__name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sp-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-pv__time {
    font-size: 0.65rem;
    color: var(--sp-text-muted);
    line-height: 1.3;
}

/* Text */
.sp-pv__text {
    font-size: 0.8rem;
    color: var(--sp-text);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px;
    overflow: hidden;
    position: relative;
}
.sp-pv__text:empty { display: none; }

/* Instagram caption */
.sp-pv__caption-ig {
    font-size: 0.8rem;
    color: var(--sp-text);
    line-height: 1.5;
    padding: 0 2px;
    max-height: 60px;
    overflow: hidden;
}
.sp-pv__caption-ig strong {
    font-weight: 600;
    margin-right: 4px;
}

/* Media */
.sp-pv__media {
    margin: 8px -14px 0;
    overflow: hidden;
}
.sp-pv__media img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
}
.sp-pv__media--ig {
    margin: 0 -14px 8px;
}
.sp-pv__video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 120px;
    background: var(--sp-bg-input);
    color: var(--sp-text-muted);
    font-size: 0.8rem;
}
.sp-pv__video-placeholder i { font-size: 1.5rem; }

/* Actions */
.sp-pv__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid #f0e8f2;
    font-size: 0.7rem;
    color: var(--sp-text-muted);
}
.sp-pv__actions span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.sp-pv__actions .ml-auto { margin-left: auto; }

/* ── Platform-specific tweaks ─────────────────────────────── */
.sp-pv--facebook .sp-pv__actions span { flex: 1; justify-content: center; }
.sp-pv--linkedin .sp-pv__actions span { flex: 1; justify-content: center; }
.sp-pv--twitter .sp-pv__text { font-size: 0.9rem; }
.sp-pv--twitter .sp-pv__actions { justify-content: space-between; }
.sp-pv--instagram .sp-pv__actions { font-size: 1rem; gap: 14px; }
.sp-pv--instagram .sp-pv__avatar { border-radius: 50%; border: 2px solid var(--sp-border); }

/* ═══════════════════════════════════════════════════════
   CPanel (Admin Panel) Styles — merged from cpanel.css
   ═══════════════════════════════════════════════════════ */

/* ── Sidebar ─────────────────────────────────────────── */
.cpanel-sidebar {
    width: 260px;
    background: var(--sp-bg-sidebar);
    border-right: 1px solid var(--sp-border);
    transition: transform var(--sp-duration-slow) var(--sp-ease);
}

@media (max-width: 1023px) {
    .cpanel-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: var(--sp-z-sidebar);
        transform: translateX(-100%);
        width: 280px;
        max-width: 85vw;
    }
    .cpanel-sidebar.sidebar-open {
        transform: translateX(0);
    }
}

@media (max-width: 767px) {
    .cpanel-table-wrap table {
        min-width: 600px;
    }
}

@media (max-width: 639px) {
    .cpanel-modal-container {
        max-width: 100% !important;
    }
}

@media (max-width: 374px) {
    .cpanel-stat-card {
        padding: 0.625rem;
    }
    .cpanel-stat-value {
        font-size: 1.125rem;
    }
    .cpanel-stat-icon {
        width: 2rem;
        height: 2rem;
        font-size: var(--sp-text-sm);
    }
}

/* ── Nav Links ───────────────────────────────────────── */
.cpanel-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--sp-radius-sm);
    font-size: var(--sp-text-base);
    font-weight: var(--sp-font-medium);
    color: var(--sp-text-muted);
    transition: all var(--sp-duration) var(--sp-ease);
}
.cpanel-nav-link:hover {
    color: var(--sp-text);
    background: rgba(99, 102, 241, 0.08);
}
.cpanel-nav-link.active {
    color: var(--sp-accent);
    background: var(--sp-accent-light);
}
.cpanel-nav-link.active i {
    color: var(--sp-accent);
}

/* ── Cards ───────────────────────────────────────────── */
.cpanel-card {
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-md);
    overflow: hidden;
    animation: cpanel-fade-in 0.3s ease forwards;
}
.cpanel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--sp-border);
}
.cpanel-card-title {
    font-size: var(--sp-text-lg);
    font-weight: var(--sp-font-bold);
    color: var(--sp-text);
    letter-spacing: var(--sp-tracking-tight);
}
.cpanel-card-body {
    padding: 1.25rem;
}

/* ── Stat Cards ──────────────────────────────────────── */
.cpanel-stat-card {
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-md);
    padding: 1rem;
    text-align: center;
}
.cpanel-stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--sp-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: var(--sp-text-lg);
}
.cpanel-stat-value {
    font-size: var(--sp-text-2xl);
    font-weight: var(--sp-font-extrabold);
    color: var(--sp-text);
    line-height: var(--sp-leading-tight);
    letter-spacing: var(--sp-tracking-tight);
    font-variant-numeric: tabular-nums;
}
.cpanel-stat-label {
    font-size: var(--sp-text-xs);
    color: var(--sp-text-muted);
    margin-top: 0.125rem;
}

/* ── Buttons ─────────────────────────────────────────── */
.cpanel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--sp-radius-sm);
    font-size: var(--sp-text-base);
    font-weight: var(--sp-font-medium);
    transition: all var(--sp-duration) var(--sp-ease);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}
.cpanel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.cpanel-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--sp-text-sm);
}
.cpanel-btn-primary {
    background: linear-gradient(135deg, var(--sp-accent), var(--sp-accent-hover));
    color: white;
}
.cpanel-btn-primary:hover:not(:disabled) {
    opacity: 0.9;
}
.cpanel-btn-ghost {
    background: transparent;
    color: var(--sp-text-secondary);
    border: 1px solid var(--sp-border);
}
.cpanel-btn-ghost:hover:not(:disabled) {
    color: var(--sp-text);
    background: var(--sp-bg-subtle);
    border-color: var(--sp-border-strong);
}

/* ── Inputs ──────────────────────────────────────────── */
.cpanel-input {
    width: 100%;
    background: var(--sp-bg-input);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: var(--sp-text-base);
    color: var(--sp-text);
    transition: border-color var(--sp-duration) var(--sp-ease);
}
.cpanel-input::placeholder {
    color: var(--sp-text-muted);
}
.cpanel-input:focus {
    outline: none;
    border-color: var(--sp-accent);
}
.cpanel-input option {
    background: var(--sp-bg-card);
    color: var(--sp-text);
}
.cpanel-label {
    display: block;
    font-size: var(--sp-text-sm);
    font-weight: var(--sp-font-semibold);
    color: var(--sp-text);
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

/* ── Modals ──────────────────────────────────────────── */
.cpanel-modal {
    position: fixed;
    inset: 0;
    z-index: var(--sp-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cpanel-modal.hidden {
    display: none;
}
.cpanel-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}
.cpanel-modal-container {
    position: relative;
    z-index: 1;
    padding: 1rem;
    width: 100%;
    max-width: 28rem;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}
.cpanel-modal-panel {
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-md);
    overflow-y: auto;
    max-height: calc(100vh - 4rem);
}
.cpanel-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--sp-border);
    font-size: var(--sp-text-lg);
    font-weight: var(--sp-font-bold);
    color: var(--sp-text);
    letter-spacing: var(--sp-tracking-tight);
}

/* ── CPanel Scrollbar ────────────────────────────────── */
.cpanel-modal-panel::-webkit-scrollbar { width: 6px; }
.cpanel-modal-panel::-webkit-scrollbar-track { background: transparent; }
.cpanel-modal-panel::-webkit-scrollbar-thumb { background: var(--sp-border-strong); border-radius: 4px; }
.cpanel-sidebar nav::-webkit-scrollbar { width: 4px; }
.cpanel-sidebar nav::-webkit-scrollbar-track { background: transparent; }
.cpanel-sidebar nav::-webkit-scrollbar-thumb { background: var(--sp-border); border-radius: 4px; }

/* ── Blog editor ─────────────────────────────────────── */
.blog-editor h2 { font-size: var(--sp-text-xl); font-weight: var(--sp-font-bold); margin-bottom: 0.5rem; color: var(--sp-text); }
.blog-editor h3 { font-size: 1.1rem; font-weight: var(--sp-font-semibold); margin-bottom: 0.5rem; color: var(--sp-text); }
.blog-editor p { margin-bottom: 0.75rem; line-height: var(--sp-leading-relaxed); }
.blog-editor ul, .blog-editor ol { margin-left: 1.5rem; margin-bottom: 0.75rem; }
.blog-editor li { margin-bottom: 0.25rem; }
.blog-editor a { color: var(--sp-accent); text-decoration: underline; }
.blog-editor img { max-width: 100%; border-radius: var(--sp-radius-sm); margin: 0.5rem 0; }

@keyframes cpanel-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ═══════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE OVERRIDES — Applied at <640px and <480px
   Reduces padding, font-sizes, chart heights, and ensures every card +
   grid + hero behaves sanely on a phone.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Tablet & phone (< 768px) ───────────────────────────────────────── */
@media (max-width: 767px) {
    /* App shell — tighter padding so content doesn't get squeezed */
    .sp-app-main {
        padding: 0 0.75rem !important;
    }
    main.sp-app-content {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    /* Cards — 24px padding is too much on a phone */
    .sp-card {
        padding: 16px !important;
        border-radius: 12px !important;
        margin-bottom: 12px !important;
    }
    .sp-card--chart {
        padding: 14px !important;
    }

    /* KPI cards — smaller values so 2-col grid fits without overflow */
    .sp-kpi {
        padding: 12px !important;
    }
    .sp-kpi__body {
        gap: 8px !important;
    }
    .sp-kpi__icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
        border-radius: 10px !important;
    }
    .sp-kpi__value {
        font-size: 1.125rem !important;  /* was 1.375rem */
    }
    .sp-kpi__label {
        font-size: 0.625rem !important;  /* was 0.6875rem */
    }

    /* Hero cards — stop them being chunky */
    .sp-dash-hero,
    .sp-page-hero {
        padding: 16px 14px !important;
        border-radius: 12px !important;
    }
    .sp-dash-hero__greeting,
    .sp-page-hero__title {
        font-size: 1.05rem !important;
    }
    .sp-dash-hero__subtitle,
    .sp-page-hero__subtitle {
        font-size: 0.75rem !important;
    }
    .sp-dash-hero__content,
    .sp-page-hero__content {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    .sp-dash-hero__actions,
    .sp-page-hero__actions {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .sp-page-hero__actions .sp-hero-btn,
    .sp-dash-hero__actions > * {
        flex: 1 1 auto !important;
    }

    /* Section titles — scale down */
    .sp-section-title {
        font-size: 0.75rem !important;
    }
    .sp-heading-xl {
        font-size: 1.15rem !important;
    }
    .sp-heading-lg {
        font-size: 1.05rem !important;
    }

    /* Charts — cap height so they don't dominate the viewport */
    [style*="height: 320px"],
    [style*="height:320px"] {
        height: 240px !important;
    }
    [style*="height: 280px"],
    [style*="height:280px"] {
        height: 220px !important;
    }
    [style*="height: 240px"],
    [style*="height:240px"] {
        height: 200px !important;
    }

    /* Buttons — ensure tap targets and prevent text overflow */
    .sp-btn-primary,
    .sp-btn-secondary,
    .sp-btn,
    .sp-hero-btn {
        min-height: 36px !important;
        white-space: nowrap !important;
    }

    /* Modals — breathe */
    .sp-modal-panel {
        padding: 16px !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 24px) !important;
    }
    .sp-modal-body {
        padding: 0 !important;
    }

    /* Tables — ensure they all horizontally scroll on mobile */
    .sp-table-wrapper,
    .overflow-x-auto {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .sp-table th,
    .sp-table td {
        padding: 8px 10px !important;
        font-size: 0.75rem !important;
    }

    /* Filter strips — horizontal scroll + edge fade to signal swipability */
    .sp-filter-strip {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
        position: relative;
    }
    .sp-filter-strip::-webkit-scrollbar { display: none; }
    .sp-filter-strip > div {
        flex-wrap: nowrap !important;
        min-width: max-content;
    }

    /* Tab switchers — same scrollable + snap treatment.
       Narrow padding so more tabs fit before overflow. */
    .sp-tab-switcher {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }
    .sp-tab-switcher::-webkit-scrollbar { display: none; }
    .sp-tab-switcher .sp-tab {
        padding: 10px 12px !important;
        font-size: 0.78rem !important;
        flex-shrink: 0;
        scroll-snap-align: start;
        white-space: nowrap;
    }

    /* Forms — full-width inputs on mobile */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="url"],
    input[type="tel"],
    select,
    textarea,
    .sp-input {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 16px !important;  /* prevents iOS zoom-on-focus */
    }

    /* Client-selector carousel in header — let it scroll */
    .sp-topbar__clients-scroll {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        max-width: calc(100vw - 120px);
    }

    /* Headers — stack icon + title with tighter gap */
    .sp-header {
        padding: 0 10px !important;
        min-height: 52px !important;
    }

    /* Reduce gaps in flex rows globally on mobile */
    .flex.gap-6 { gap: 0.75rem !important; }
    .flex.gap-4 { gap: 0.5rem !important; }

    /* Cap wide pages so nothing escapes the viewport */
    body, html {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

/* ── Mobile polish (< 768px) — specific UI element fixes ─────────────── */
@media (max-width: 767px) {
    /* Card headers: flex-between often overflows — let it wrap gracefully */
    .sp-card__header {
        flex-wrap: wrap !important;
        gap: 8px !important;
        align-items: center;
    }
    /* First child (title) stays inline; second child (badge/actions) wraps
       to next line when space is tight */
    .sp-card__header > *:first-child {
        min-width: 0;
        flex: 1 1 auto;
    }

    /* Table action icons — bump to minimum accessible touch target */
    .sp-table-action {
        width: 36px !important;
        height: 36px !important;
    }

    /* Action rows inside cards — always wrap, never overflow */
    .sp-card > .flex.items-center.justify-between,
    .sp-card .flex.items-center.justify-between.gap-4 {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Table wrappers — ensure touch momentum always works */
    .sp-table-wrapper .overflow-x-auto,
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
    /* Table cells: max width so long strings wrap */
    .sp-table td {
        max-width: 280px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Toast notifications — slide up from bottom, full-width minus padding */
    .sp-toast {
        left: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
        max-width: none !important;
        width: auto !important;
    }

    /* Dropdown menus — never escape viewport */
    .sp-navbar__dropdown,
    [class*="dropdown-menu"] {
        max-width: calc(100vw - 16px) !important;
        right: 8px !important;
    }

    /* Button rows at the end of forms — stack + full-width */
    .sp-modal-body > .flex.items-center.gap-3:last-child,
    form > .flex.items-center.gap-3:last-child,
    .sp-card > .flex.items-center.gap-3:last-child {
        flex-direction: column-reverse !important;
        gap: 8px !important;
    }
    .sp-modal-body > .flex.items-center.gap-3:last-child > .sp-btn,
    form > .flex.items-center.gap-3:last-child > .sp-btn {
        width: 100% !important;
    }

    /* Icon-only buttons (like sync/edit/delete) — keep tap area adequate */
    .sp-table-action,
    .sp-header__icon-btn,
    button[class*="rounded-full"][class*="w-8"],
    button[class*="rounded-full"][class*="w-9"] {
        min-width: 36px;
        min-height: 36px;
    }

    /* Pill / badge text — never let unbreakable strings push layout wider */
    .sp-table-badge,
    .sp-badge-text {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Sticky elements that become awkward on mobile */
    [class*="sticky"][class*="top-"] {
        position: static !important;
    }

    /* Avatars stay round but cap size */
    .sp-navbar__avatar {
        max-width: 36px;
        max-height: 36px;
    }

    /* Ensure `<pre>` / `<code>` don't break layout */
    pre, code {
        word-break: break-all;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    /* Any element trying to use viewport-min widths (min-w-[Npx]) not in a
       scroll container — cap to 100% on mobile */
    [class*="min-w-["]:not([class*="overflow-x-auto"] *):not(.posts-hub-tab):not(.sp-tab) {
        min-width: 0 !important;
    }

    /* Images: enforce max-width globally except when explicitly sized */
    main img:not([class*="w-\\["]):not([style*="width:"]) {
        max-width: 100%;
        height: auto;
    }

    /* Flash messages at top: full width and readable padding */
    .flash-messages > div {
        padding: 12px 14px !important;
        font-size: 0.8rem !important;
    }

    /* Charts container: force width responsive */
    canvas {
        max-width: 100% !important;
    }

    /* Grid cards containing buttons: tighter gap between action rows */
    .sp-card .grid.grid-cols-2.gap-2 {
        gap: 6px !important;
    }
}

/* ── Small phone (< 480px) — extra tightening ───────────────────────── */
@media (max-width: 479px) {
    .sp-card {
        padding: 12px !important;
    }
    .sp-kpi {
        padding: 10px !important;
    }
    .sp-kpi__value {
        font-size: 1rem !important;
    }
    .sp-dash-hero,
    .sp-page-hero {
        padding: 12px 10px !important;
    }
    .sp-heading-xl { font-size: 1rem !important; }
    .sp-heading-lg { font-size: 0.95rem !important; }

    /* Chart heights on tiny screens */
    [style*="height: 320px"], [style*="height:320px"] { height: 200px !important; }
    [style*="height: 280px"], [style*="height:280px"] { height: 190px !important; }

    /* Hero buttons stack when very narrow */
    .sp-page-hero__actions,
    .sp-dash-hero__actions {
        flex-direction: column !important;
    }
    .sp-page-hero__actions > *,
    .sp-dash-hero__actions > * {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Table cells — even tighter */
    .sp-table th, .sp-table td {
        padding: 6px 8px !important;
        font-size: 0.7rem !important;
    }
}
