/* FiftyMetrics brand overrides — kept separate from Xintra core CSS. */

/* ──────────────────────────────────────────────
   Inter OpenType refinements (sitewide)
   ──────────────────────────────────────────────
   tnum = tabular numerals: every digit shares the same width, so
          currency columns ("€1,284.50" vs "€987.20") line up cleanly
          in tables. Critical for analytics dashboards.
   cv11 = single-storey "a" alternate (geometric, SF-Pro-like). Subtle
          but elevates the brand feel.
   `font-variant-numeric: tabular-nums` is the modern shorthand for
   tnum and works on every browser we support; `font-feature-settings`
   is the belt-and-suspenders fallback + the only way to flip cv11. */
body, body.dark {
    font-feature-settings: 'tnum' 1, 'cv11' 1;
    font-variant-numeric: tabular-nums;
}

/* ──────────────────────────────────────────────
   Brand logo sizing
   ────────────────────────────────────────────── */
.header-logo img {
    height: 42px !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
}
.landing-footer-logo {
    height: 42px !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
}

/* ──────────────────────────────────────────────
   Desktop (>= 992px): hide hamburger entirely (dashboard only)
   ────────────────────────────────────────────── */
@media (min-width: 992px) {
    body.fm-dashboard .app-header .sidemenu-toggle,
    body.fm-dashboard .app-header .horizontal-navtoggle,
    body.fm-dashboard .app-header a.sidemenu-toggle.header-link {
        display: none !important;
    }
}

/* ──────────────────────────────────────────────
   Mobile (<= 991.98px) dashboard layout
   ────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    body.fm-dashboard .main-header-container {
        position: relative;
    }
    body.fm-dashboard .app-header .header-content-left .horizontal-logo {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 1;
        pointer-events: auto;
    }
    body.fm-dashboard #fm-sidebar-close {
        display: inline-flex !important;
    }
}

/* Show notifications on small screens (override Xintra hide rule) */
@media (max-width: 575.98px) {
    .notifications-dropdown {
        display: block !important;
    }
}

/* ──────────────────────────────────────────────
   Sidebar close X (mobile only)
   ────────────────────────────────────────────── */
.main-sidebar-header {
    position: relative;
}
#fm-sidebar-close {
    display: none;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px;
    cursor: pointer;
    color: inherit;
    border-radius: 6px;
    z-index: 5;
}
#fm-sidebar-close:hover {
    background: rgba(0, 0, 0, 0.06);
}
.dark #fm-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ──────────────────────────────────────────────
   Tinted page background — only on dashboard pages
   (marketing site keeps its own bg). Gives glass
   surfaces something to blur.
   ────────────────────────────────────────────── */
body.fm-dashboard {
    background:
        radial-gradient(60rem 40rem at 80% -10%, rgba(92, 103, 247, 0.06), transparent 60%),
        radial-gradient(50rem 30rem at -10% 30%, rgba(227, 84, 212, 0.04), transparent 60%),
        #f4f5f8 !important;
}
html.dark body.fm-dashboard,
.dark body.fm-dashboard {
    background:
        radial-gradient(60rem 40rem at 80% -10%, rgba(92, 103, 247, 0.18), transparent 60%),
        radial-gradient(50rem 30rem at -10% 30%, rgba(227, 84, 212, 0.10), transparent 60%),
        #0e1119 !important;
}

/* ──────────────────────────────────────────────
   Floating header (Tahoe-inspired) — DESKTOP
   Sidebar styling reverted to Xintra original (per user request).
   ────────────────────────────────────────────── */
@media (min-width: 992px) {
    body.fm-dashboard .app-header {
        inset-inline-start: calc(var(--sidebar-width, 240px) + 10px) !important;
        width: auto !important;
        right: 5px !important;
        top: 5px !important;
        border-radius: 14px !important;
        border: 1px solid rgba(0, 0, 0, 0.06) !important;
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.04),
            0 6px 18px rgba(0, 0, 0, 0.06) !important;
        background: rgba(255, 255, 255, 0.72) !important;
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);
    }
    .dark body.fm-dashboard .app-header,
    body.fm-dashboard.dark .app-header {
        border-color: rgba(255, 255, 255, 0.06) !important;
        background: rgba(22, 26, 36, 0.72) !important;
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.35),
            0 6px 18px rgba(0, 0, 0, 0.45) !important;
    }
}

/* Sidebar scroll: keep last item (Log Out) reachable on shorter viewports.
   Scoped to the dashboard only (body.fm-dashboard). The marketing landing
   page (body.landing-body) reuses the same .app-sidebar markup for its
   HORIZONTAL nav bar — without this scope the 80px padding-bottom rendered
   as an 80px blank strip under the nav, pushing the hero section down. */
body.fm-dashboard .app-sidebar .main-menu-container,
body.fm-dashboard .app-sidebar .main-sidebar {
    padding-bottom: 80px;
}

/* Hide Xintra's scroll-to-top button entirely */
.scrollToTop {
    display: none !important;
}

/* ──────────────────────────────────────────────
   Date range selector (segmented pill control)
   ────────────────────────────────────────────── */
.fm-daterange-wrap {
    display: none;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
@media (min-width: 992px) {
    .fm-daterange-wrap { display: inline-flex; }
}
.fm-range-btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #4a4e5a;
    cursor: pointer;
    transition: background 100ms ease, color 100ms ease, box-shadow 100ms ease;
    letter-spacing: -0.005em;
    line-height: 1.2;
}
.fm-range-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1c24;
}
.fm-range-btn.active {
    background: #5C67F7;
    color: #fff;
    box-shadow: 0 1px 2px rgba(92, 103, 247, 0.3);
}
.fm-range-btn.active:hover {
    background: #4a55e8;
    color: #fff;
}

.dark .fm-daterange-wrap {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.05);
}
.dark .fm-range-btn {
    color: rgba(230, 232, 240, 0.7);
}
.dark .fm-range-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.dark .fm-range-btn.active,
.dark .fm-range-btn.active:hover {
    background: #5C67F7;
    color: #fff;
}

/* ──────────────────────────────────────────────
   Date-range pill bar (WhatsApp-style floating chip)
   Inverted: dark bar in light mode, light bar in dark mode.
   Mobile: edge-to-edge at the bottom of the viewport.
   Desktop: anchored bottom-right, smaller, doesn't take full width.
   ────────────────────────────────────────────── */
.fm-mobile-range-bar {
    display: flex;
    position: fixed;
    z-index: 1000;
    padding: 6px;
    gap: 4px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.18),
        0 10px 28px rgba(0, 0, 0, 0.22);
    background: rgba(18, 20, 26, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
}
.dark .fm-mobile-range-bar {
    border-color: rgba(0, 0, 0, 0.06);
    background: rgba(244, 245, 250, 0.88);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.06),
        0 8px 24px rgba(0, 0, 0, 0.12);
}
.fm-mobile-range-btn {
    padding: 9px 14px !important;
    font-size: 12.5px !important;
    text-align: center;
    color: rgba(255, 255, 255, 0.78) !important;
    cursor: pointer;
    border-radius: 12px;
    transition: background 120ms ease, color 120ms ease;
}
.fm-mobile-range-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}
.fm-mobile-range-btn.active {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    font-weight: 600;
}
.dark .fm-mobile-range-btn {
    color: rgba(40, 42, 50, 0.75) !important;
}
.dark .fm-mobile-range-btn:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    color: #1a1c24 !important;
}
.dark .fm-mobile-range-btn.active {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #1a1c24 !important;
}

/* Mobile layout: full-width edge-to-edge at the bottom */
@media (max-width: 991.98px) {
    .fm-mobile-range-bar {
        bottom: max(14px, env(safe-area-inset-bottom));
        left: 24px;
        right: 24px;
    }
    .fm-mobile-range-btn { flex: 1; padding: 9px 4px !important; font-size: 12px !important; }
    /* Push content above the floating bar so nothing is hidden */
    .page,
    .main-content,
    .content {
        padding-bottom: 90px !important;
    }
}

/* Desktop layout: bottom-right corner, compact, doesn't span the screen */
@media (min-width: 992px) {
    .fm-mobile-range-bar {
        bottom: 24px;
        right: 24px;
    }
}

/* ──────────────────────────────────────────────
   Integrations page — card grid and collapsible cards
   ────────────────────────────────────────────── */
.fm-int-section {
    margin-bottom: 2rem;
}
.fm-int-section-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.45);
    margin: 0 0 10px;
    padding-left: 4px;
}
.dark .fm-int-section-title {
    color: rgba(255, 255, 255, 0.5);
}
.fm-int-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}
.fm-int-card {
    margin-bottom: 0 !important;
    overflow: hidden;
}
.fm-int-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background 100ms ease;
}
.fm-int-header:hover {
    background: rgba(92, 103, 247, 0.04);
}
.dark .fm-int-header:hover {
    background: rgba(92, 103, 247, 0.08);
}
.fm-int-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1c24;
}
.dark .fm-int-name {
    color: #fff;
}
.fm-int-status {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 999px;
    text-transform: uppercase;
}
.fm-int-status.is-connected {
    background: rgba(34, 197, 94, 0.14);
    color: rgb(22, 163, 74);
}
.fm-int-status.is-disconnected {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.5);
}
.dark .fm-int-status.is-disconnected {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
}
.fm-int-chevron {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.4);
    transition: transform 150ms ease;
}
.dark .fm-int-chevron {
    color: rgba(255, 255, 255, 0.5);
}
.fm-int-header.is-open .fm-int-chevron {
    transform: rotate(180deg);
}
.fm-int-body {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 16px 18px;
    background: rgba(0, 0, 0, 0.015);
}
.dark .fm-int-body {
    border-top-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}
.fm-int-field {
    margin-bottom: 12px;
}
.fm-int-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #4a4e5a;
    margin-bottom: 4px;
}
.dark .fm-int-field label {
    color: rgba(230, 232, 240, 0.7);
}
.fm-int-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.fm-int-message {
    margin-top: 10px;
    margin-bottom: 0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.fm-int-message.fm-int-error {
    background: rgba(239, 68, 68, 0.12);
    color: rgb(220, 38, 38);
}

/* OAuth-provider card body (Google services) */
.fm-int-google-info {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.6);
    line-height: 1.5;
    margin: 0 0 14px;
}
.dark .fm-int-google-info {
    color: rgba(255, 255, 255, 0.65);
}
.fm-int-google-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
}

/* ──────────────────────────────────────────────
   Toast notifications (top-right, macOS-style)
   ────────────────────────────────────────────── */
.fm-toasts {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: min(380px, calc(100vw - 32px));
}
.fm-toast {
    position: relative;
    pointer-events: auto;
    background: rgba(20, 22, 28, 0.94);
    color: #fff;
    border-radius: 12px;
    padding: 12px 36px 12px 14px;
    border-left: 4px solid #6b7280;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 220ms ease, opacity 220ms ease;
}
.fm-toast.fm-toast-in {
    transform: translateX(0);
    opacity: 1;
}
.fm-toast-success { border-left-color: #22c55e; }
.fm-toast-error   { border-left-color: #ef4444; }
.fm-toast-info    { border-left-color: #5C67F7; }
.fm-toast-title {
    font-weight: 600;
    font-size: 13px;
    margin: 0 0 2px;
    color: #fff;
    letter-spacing: -0.01em;
}
.fm-toast-body {
    font-size: 13px;
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}
.fm-toast-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    border-radius: 4px;
}
.fm-toast-close:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
}

/* Show/hide button for secret fields */
.fm-int-input-wrap {
    position: relative;
}
.fm-int-input-wrap .fm-int-input {
    padding-right: 60px !important;
}
.fm-int-show {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5C67F7;
    background: transparent;
    border: 1px solid rgba(92, 103, 247, 0.25);
    border-radius: 6px;
    cursor: pointer;
    transition: background 100ms ease;
}
.fm-int-show:hover {
    background: rgba(92, 103, 247, 0.08);
}
.dark .fm-int-show {
    color: #8a92ff;
    border-color: rgba(138, 146, 255, 0.3);
}
.dark .fm-int-show:hover {
    background: rgba(138, 146, 255, 0.12);
}

/* ──────────────────────────────────────────────
   Revenue Items (inside the Stripe integration card)
   ────────────────────────────────────────────── */
.fm-rev-wrap {
    margin-top: 4px;
}
.fm-rev-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 18px -18px 16px;
}
.dark .fm-rev-divider {
    background: rgba(255, 255, 255, 0.08);
}
.fm-rev-heading {
    font-size: 14px;
    font-weight: 600;
    color: #1a1c24;
    margin: 0 0 4px;
}
.dark .fm-rev-heading {
    color: #fff;
}
.fm-rev-subtitle {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.55);
    margin: 0 0 14px;
    line-height: 1.4;
}
.dark .fm-rev-subtitle {
    color: rgba(255, 255, 255, 0.6);
}
.fm-rev-currency-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.fm-rev-currency-row label {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: #4a4e5a;
    min-width: 70px;
}
.dark .fm-rev-currency-row label {
    color: rgba(230, 232, 240, 0.7);
}
.fm-rev-currency-select {
    width: 100px;
}
.fm-rev-section {
    margin-bottom: 14px;
}
.fm-rev-section-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.5);
    margin: 0 0 8px;
}
.dark .fm-rev-section-title {
    color: rgba(255, 255, 255, 0.55);
}
.fm-rev-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}
.fm-rev-empty {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.4);
    font-style: italic;
    margin: 0;
    padding: 4px 8px;
}
.dark .fm-rev-empty {
    color: rgba(255, 255, 255, 0.4);
}
.fm-rev-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}
.dark .fm-rev-row {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}
.fm-rev-row-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #1a1c24;
}
.dark .fm-rev-row-name {
    color: #fff;
}
.fm-rev-row-price {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: rgba(0, 0, 0, 0.65);
}
.dark .fm-rev-row-price {
    color: rgba(255, 255, 255, 0.75);
}
.fm-rev-row-delete {
    width: 24px;
    height: 24px;
    background: transparent;
    border: 0;
    color: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    border-radius: 6px;
}
.fm-rev-row-delete:hover {
    color: rgb(220, 38, 38);
    background: rgba(239, 68, 68, 0.1);
}
.dark .fm-rev-row-delete {
    color: rgba(255, 255, 255, 0.4);
}
.dark .fm-rev-row-delete:hover {
    color: rgb(248, 113, 113);
    background: rgba(248, 113, 113, 0.15);
}
.fm-rev-add-row {
    display: grid;
    grid-template-columns: 1fr 120px auto;
    gap: 6px;
    margin-top: 6px;
}
.fm-rev-add-row .form-control {
    padding: 6px 10px;
    font-size: 13px;
}
.fm-rev-add-btn {
    padding: 6px 14px !important;
    font-size: 13px !important;
}

/* ──────────────────────────────────────────────
   FiftyInsights™ page
   ────────────────────────────────────────────── */
.fm-insights-card {
    padding: 28px 32px;
    margin-bottom: 0 !important;
}
.fm-insights-empty {
    padding: 32px;
    text-align: center;
}
.fm-insights-empty-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px;
    color: #1a1c24;
}
.dark .fm-insights-empty-title {
    color: #fff;
}
.fm-insights-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}
.dark .fm-insights-meta {
    color: rgba(255, 255, 255, 0.55);
}
.fm-insights-period {
    text-transform: uppercase;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
}
.fm-insights-headline {
    font-size: 22px;
    font-weight: 600;
    color: #1a1c24;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0 0 12px;
}
.dark .fm-insights-headline {
    color: #fff;
}
.fm-insights-summary {
    font-size: 15px;
    color: rgba(0, 0, 0, 0.7);
    line-height: 1.55;
    margin: 0 0 20px;
}
.dark .fm-insights-summary {
    color: rgba(255, 255, 255, 0.75);
}
.fm-insights-section {
    margin-top: 18px;
}
.fm-insights-section-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.55);
    margin: 0 0 8px;
}
.dark .fm-insights-section-title {
    color: rgba(255, 255, 255, 0.6);
}
.fm-insights-bullets {
    margin: 0;
    padding: 0;
    list-style: none;
}
.fm-insights-bullets li {
    position: relative;
    padding: 6px 0 6px 18px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.78);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.fm-insights-bullets li:first-child {
    border-top: 0;
}
.fm-insights-bullets li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 16px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #5C67F7;
}
.dark .fm-insights-bullets li {
    color: rgba(255, 255, 255, 0.82);
    border-top-color: rgba(255, 255, 255, 0.06);
}
.fm-insights-telegram {
    margin-top: 22px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    font-size: 12px;
}
.fm-insights-telegram summary {
    cursor: pointer;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
}
.fm-insights-telegram pre {
    margin: 8px 0 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 6px;
    white-space: pre-wrap;
    font-family: Inter, sans-serif;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.8);
}
.dark .fm-insights-telegram {
    background: rgba(255, 255, 255, 0.04);
}
.dark .fm-insights-telegram summary {
    color: rgba(255, 255, 255, 0.65);
}
.dark .fm-insights-telegram pre {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}

.fm-insights-error-title {
    font-weight: 600;
    color: rgb(220, 38, 38);
    margin: 8px 0;
}
.fm-insights-error {
    background: rgba(239, 68, 68, 0.06);
    color: rgba(0, 0, 0, 0.7);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 11px;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 200px;
}
.dark .fm-insights-error {
    background: rgba(239, 68, 68, 0.1);
    color: rgba(255, 255, 255, 0.85);
}

.fm-insights-history-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.45);
    margin: 28px 4px 10px;
}
.dark .fm-insights-history-title {
    color: rgba(255, 255, 255, 0.5);
}
.fm-insights-history {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fm-insights-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    color: inherit;
    text-decoration: none !important;
    transition: background 100ms ease;
}
.fm-insights-history-row:hover {
    background: rgba(92, 103, 247, 0.05);
}
.dark .fm-insights-history-row {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}
.fm-insights-history-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fm-insights-history-headline {
    font-size: 14px;
    font-weight: 500;
    color: #1a1c24;
}
.dark .fm-insights-history-headline {
    color: #fff;
}
.fm-insights-history-date {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
}
.dark .fm-insights-history-date {
    color: rgba(255, 255, 255, 0.55);
}
.fm-insights-history-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 999px;
}
.fm-insights-status-ready {
    background: rgba(34, 197, 94, 0.14);
    color: rgb(22, 163, 74);
}
.fm-insights-status-generating {
    background: rgba(92, 103, 247, 0.14);
    color: rgb(92, 103, 247);
}
.fm-insights-status-failed {
    background: rgba(239, 68, 68, 0.14);
    color: rgb(220, 38, 38);
}
.fm-insights-status-pending {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.5);
}

/* ──────────────────────────────────────────────
   Integrations page — REBUILT layout (no accordion)
   Two sections:
     1. OAuth provider hubs (Google, Meta, TikTok Organic)
     2. Manual-credential cards (TikTok Ads, Stripe, Clarity, PageSpeed, Telegram)
   All content always visible. No expand/collapse.
   ────────────────────────────────────────────── */

.fm-int-section-subtitle {
    margin: -4px 0 16px;
    color: rgba(0,0,0,0.5);
    font-size: 13px;
    line-height: 1.5;
    max-width: 640px;
}
.dark .fm-int-section-subtitle { color: rgba(255,255,255,0.55); }

/* ── OAuth provider hubs ── */
.fm-prov-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.fm-prov-card {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    margin-bottom: 0 !important;
    transition: box-shadow 150ms ease, transform 150ms ease;
}
.fm-prov-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.06), 0 12px 28px rgba(0,0,0,0.04);
    transform: translateY(-1px);
}

/* Brand panel (left) */
.fm-prov-brand {
    flex: 0 0 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: relative;
}
.fm-prov-brand-letter {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-family: Inter, sans-serif;
}
.fm-prov-brand-google { background: linear-gradient(135deg, #4285F4, #34A853 60%, #FBBC05 100%); }
.fm-prov-brand-meta   { background: linear-gradient(135deg, #0866FF, #1877F2 50%, #00B2FF 100%); }
.fm-prov-brand-tiktok_organic { background: linear-gradient(135deg, #25F4EE, #000 50%, #FE2C55 100%); }
.fm-prov-brand-tiktok_ads     { background: linear-gradient(135deg, #FE2C55, #000 50%, #25F4EE 100%); }
/* YouTube — the new sibling card to "Google", split out so brand-account
   channels can authenticate as a different Google identity. The gradient
   uses the official YouTube red into a darker red into black-ish for the
   same depth the other brand tiles have. */
.fm-prov-brand-google_youtube { background: linear-gradient(135deg, #FF0000, #CC0000 55%, #1a1a1a 100%); }
/* LinkedIn — official brand blue (#0A66C2) into deep navy. */
.fm-prov-brand-linkedin_ads   { background: linear-gradient(135deg, #0A66C2, #004182 60%, #000F26 100%); }
/* Shopify — official brand green (#96BF48) into a deeper sage. */
.fm-prov-brand-shopify        { background: linear-gradient(135deg, #96BF48, #5E8E3E 60%, #1A1F0F 100%); }

/* Shopify provider card: the shop-domain text input + label. */
.fm-prov-shop-input-wrap { margin: 8px 0 4px; }
.fm-prov-shop-input-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 4px;
}
.fm-prov-shop-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: transparent;
    color: inherit;
    transition: border-color 0.15s ease;
}
.fm-prov-shop-input:focus { outline: none; border-color: #96BF48; }
.fm-prov-shop-input-error { border-color: #ef4444 !important; }
body.dark .fm-prov-shop-input { border-color: rgba(255,255,255,0.12); }

/* Content area (right) */
.fm-prov-content {
    flex: 1;
    padding: 18px 20px 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.fm-prov-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.fm-prov-titles { flex: 1; min-width: 0; }
.fm-prov-name {
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1a1c24;
}
.dark .fm-prov-name { color: #fff; }
.fm-prov-tagline {
    margin: 0;
    font-size: 12px;
    color: rgba(0,0,0,0.5);
}
.dark .fm-prov-tagline { color: rgba(255,255,255,0.55); }
.fm-prov-status {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
}
.fm-prov-status.is-connected {
    background: rgba(34,197,94,0.14);
    color: rgb(22,163,74);
}
.fm-prov-status.is-disconnected {
    background: rgba(0,0,0,0.06);
    color: rgba(0,0,0,0.55);
}
.dark .fm-prov-status.is-disconnected {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.55);
}

.fm-prov-unlocks-label {
    margin: 6px 0 0;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(0,0,0,0.5);
}
.dark .fm-prov-unlocks-label { color: rgba(255,255,255,0.55); }
.fm-prov-unlocks {
    margin: 4px 0 6px;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.55;
    color: #4a4e5a;
}
.dark .fm-prov-unlocks { color: rgba(255,255,255,0.75); }
.fm-prov-unlocks li::marker { color: rgba(92,103,247,0.6); }

.fm-prov-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 4px;
}
.fm-prov-actions .ti-btn { flex: 0 0 auto; }

/* ── Google sub-service bindings ──
   Block shown on the Google provider card listing which GA4 property,
   Ads customer, GSC site, and YouTube channel are currently bound, each
   with a small "Change" link that deep-links into the data picker. */
.fm-google-bindings {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.08);
}
body.dark .fm-google-bindings { border-top-color: rgba(255,255,255,0.08); }
.fm-google-bindings-title {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 6px;
}
.fm-google-bindings-list { display: flex; flex-direction: column; gap: 4px; }
.fm-google-binding-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    line-height: 1.45;
}
.fm-google-binding-label  { color: #6b7280; flex-shrink: 0; }
.fm-google-binding-value  { color: inherit; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-google-binding-value.is-empty { color: #9ca3af; font-style: italic; }
.fm-google-binding-change {
    color: #5C67F7;
    text-decoration: none;
    font-weight: 600;
    flex-shrink: 0;
}
.fm-google-binding-change:hover { text-decoration: underline; }
.fm-google-bindings-loading { color: #9ca3af; font-size: 12px; }

/* ── Manual-credential cards ── */
.fm-manual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}
.fm-manual-card {
    margin-bottom: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.fm-manual-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.dark .fm-manual-header { border-bottom-color: rgba(255,255,255,0.06); }
.fm-manual-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1c24;
    flex: 1;
}
.dark .fm-manual-name { color: #fff; }
.fm-manual-status {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
}
.fm-manual-status.is-connected {
    background: rgba(34,197,94,0.14);
    color: rgb(22,163,74);
}
.fm-manual-status.is-disconnected {
    background: rgba(0,0,0,0.06);
    color: rgba(0,0,0,0.55);
}
.dark .fm-manual-status.is-disconnected {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.55);
}

.fm-manual-body { padding: 16px 20px; flex: 1; }
.fm-manual-form { display: flex; flex-direction: column; gap: 10px; }
.fm-manual-field { display: flex; flex-direction: column; gap: 4px; }
.fm-manual-field label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(0,0,0,0.55);
    margin: 0;
}
.dark .fm-manual-field label { color: rgba(255,255,255,0.55); }
.fm-manual-input { width: 100%; }
.fm-manual-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* Subtle per-platform color accents on the manual cards (top border strip) */
.fm-manual-card { position: relative; }
.fm-manual-card::before {
    content: "";
    display: block;
    height: 2px;
    background: rgba(92,103,247,0.4);
}
.fm-manual-card.fm-manual-tiktok_ads::before { background: linear-gradient(90deg, #25F4EE, #FE2C55); }
.fm-manual-card.fm-manual-stripe::before     { background: linear-gradient(90deg, #635BFF, #B780FF); }
.fm-manual-card.fm-manual-clarity::before    { background: linear-gradient(90deg, #0078D4, #50E6FF); }
.fm-manual-card.fm-manual-pagespeed::before  { background: linear-gradient(90deg, #34A853, #4285F4); }
.fm-manual-card.fm-manual-telegram::before   { background: linear-gradient(90deg, #2AABEE, #229ED9); }

/* ──────────────────────────────────────────────
   Clarity setup-instructions accordion (Option A)
   ────────────────────────────────────────────── */
.fm-clarity-help {
    margin-top: 14px;
    border-top: 1px dashed rgba(0,0,0,0.08);
    padding-top: 12px;
}
.dark .fm-clarity-help {
    border-top-color: rgba(255,255,255,0.08);
}
.fm-clarity-help-toggle {
    background: none;
    border: none;
    padding: 4px 0;
    color: #5C67F7;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}
.fm-clarity-help-toggle:hover { text-decoration: underline; }
.fm-clarity-help-toggle.is-open { color: #4A56DE; }

.fm-clarity-help-panel {
    margin-top: 10px;
    background: rgba(92,103,247,0.04);
    border: 1px solid rgba(92,103,247,0.12);
    border-radius: 8px;
    padding: 14px 18px 14px 34px;
}
.dark .fm-clarity-help-panel {
    background: rgba(92,103,247,0.10);
    border-color: rgba(92,103,247,0.18);
}
.fm-clarity-steps {
    margin: 0;
    padding: 0;
    color: #1a1c24;
    font-size: 13px;
    line-height: 1.55;
}
.dark .fm-clarity-steps { color: rgba(255,255,255,0.88); }
.fm-clarity-steps li { margin-bottom: 6px; padding-left: 4px; }
.fm-clarity-steps li:last-child { margin-bottom: 0; }
.fm-clarity-steps a { color: #5C67F7; text-decoration: underline; }
.fm-clarity-steps code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}
.dark .fm-clarity-steps code { background: rgba(255,255,255,0.10); }

/* ── Cookie consent popup ───────────────────────────────────────────────
 * Modal that appears on first visit (or after 13 months) asking for
 * cookie consent. Same styling rules apply to the deeper "preferences"
 * modal (where users toggle individual categories).
 */
.fm-cookie-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 28, 0.55);
    z-index: 99999;            /* above everything, including Xintra modals */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fmCookieFadeIn 180ms ease-out;
}
@keyframes fmCookieFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.fm-cookie-modal {
    background: #ffffff;
    color: #1a1c24;
    max-width: 540px;
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 22px 50px rgba(0,0,0,0.28);
    padding: 26px 28px 22px;
    font-family: 'Inter', sans-serif;
    font-feature-settings: 'tnum', 'cv11';
    animation: fmCookieRise 220ms ease-out;
}
.dark .fm-cookie-modal {
    background: #1f2233;
    color: rgba(255,255,255,0.92);
    box-shadow: 0 22px 50px rgba(0,0,0,0.6);
}
.fm-cookie-modal-prefs { max-width: 620px; }
@keyframes fmCookieRise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fm-cookie-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}
.fm-cookie-body {
    font-size: 13.5px;
    line-height: 1.55;
    margin: 0 0 12px;
    color: rgba(26,28,36,0.78);
}
.dark .fm-cookie-body { color: rgba(255,255,255,0.72); }
.fm-cookie-body a {
    color: #5C67F7;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.dark .fm-cookie-body a { color: #8B95FA; }
.fm-cookie-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.fm-cookie-btn {
    padding: 9px 16px;
    border: 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 130ms ease, transform 80ms ease;
    font-family: inherit;
    letter-spacing: -0.005em;
}
.fm-cookie-btn:active { transform: scale(0.98); }
.fm-cookie-btn-primary {
    background: #5C67F7;
    color: #ffffff;
}
.fm-cookie-btn-primary:hover { background: #4853e5; }
.fm-cookie-btn-secondary {
    background: rgba(0,0,0,0.05);
    color: #1a1c24;
}
.dark .fm-cookie-btn-secondary {
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.92);
}
.fm-cookie-btn-secondary:hover { background: rgba(0,0,0,0.10); }
.dark .fm-cookie-btn-secondary:hover { background: rgba(255,255,255,0.16); }

/* ── Preferences panel: per-category rows ── */
.fm-cookie-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
    border-top: 1px solid rgba(0,0,0,0.08);
}
.dark .fm-cookie-row { border-top-color: rgba(255,255,255,0.08); }
.fm-cookie-row:last-of-type { border-bottom: 1px solid rgba(0,0,0,0.08); margin-bottom: 4px; }
.dark .fm-cookie-row:last-of-type { border-bottom-color: rgba(255,255,255,0.08); }
.fm-cookie-row-text { flex: 1; min-width: 0; }
.fm-cookie-row-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #1a1c24;
}
.dark .fm-cookie-row-label { color: rgba(255,255,255,0.92); }
.fm-cookie-row-desc {
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(26,28,36,0.65);
}
.dark .fm-cookie-row-desc { color: rgba(255,255,255,0.62); }

/* ── Toggle switch (custom checkbox) ── */
.fm-cookie-toggle {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}
.fm-cookie-toggle.is-disabled { cursor: not-allowed; opacity: 0.55; }
.fm-cookie-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.fm-cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.18);
    border-radius: 22px;
    transition: background 120ms ease;
}
.dark .fm-cookie-toggle-slider { background: rgba(255,255,255,0.20); }
.fm-cookie-toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform 140ms ease;
}
.fm-cookie-toggle-input:checked + .fm-cookie-toggle-slider {
    background: #5C67F7;
}
.fm-cookie-toggle-input:checked + .fm-cookie-toggle-slider::before {
    transform: translateX(16px);
}
.fm-cookie-toggle-input:disabled + .fm-cookie-toggle-slider::before {
    background: #f0f0f0;
}

/* ── Mobile: stack buttons full-width below 480px ── */
@media (max-width: 480px) {
    .fm-cookie-modal { padding: 22px 20px 18px; border-radius: 12px; }
    .fm-cookie-actions { flex-direction: column-reverse; }
    .fm-cookie-actions .fm-cookie-btn { width: 100%; text-align: center; }
    .fm-cookie-row { flex-direction: column; gap: 10px; align-items: flex-start; }
}

/* ── Header cleanup ─────────────────────────────────────────────────────
 * Hide Xintra demo header widgets that don't belong in FiftyMetrics:
 *   • Language / country switcher — we're single-language for now
 *   • Shopping cart dropdown      — e-commerce demo leftover, irrelevant
 *   • Full-screen toggle          — niche, clutters the header
 *   • Notifications dropdown      — not wired to real events yet
 * Hidden via CSS rather than deleting markup from 200+ template files:
 * one rule, every page, instantly reversible. The (now-inert) HTML stays
 * in the DOM but never renders.
 */
.header-element.country-selector,
.header-element.cart-dropdown,
.header-element.header-fullscreen,
.header-element.notifications-dropdown {
    display: none !important;
}
