:root {
    /* ============================================================
     * Profit Calc visual system
     * Near-black primary, white cards, muted gray-green surfaces.
     * Green = profit/success, mint = one insight/completion,
     * coral = problem/loss, platform colors = ad sources only.
     * ============================================================ */
    --pc-primary-ink: #171A18;
    --pc-chart-ink: #3D4540;
    --pc-muted: #7B837D;
    --pc-neutral: #99A19C;

    /* Shared charcoal surface for table headers, sidebar active state,
     * Mission Control card headers, and primary actions. Softer than
     * --pc-primary-ink (#171A18) so it reads as graphite rather than pure
     * black, and stays consistent with the historical graphite (#393e44)
     * used across buttons/headers elsewhere in the app. */
    --pc-header-bg: #393e44;
    --pc-action-bg: #393e44;
    --pc-action-hover-bg: #2f3439;

    /* Flat cool page surface with white cards and navigation. Retain the
     * gradient token for compatibility with older surface consumers. */
    --pc-app-bg: #F6F7F9;
    --pc-app-bg-gradient: none;
    --pc-sidebar-bg: #FFFFFF;

    /* Backward-compatible aliases. Legacy token names still resolve to the
     * new app surface tokens so existing references inherit the new system. */
    --pc-bg: var(--pc-app-bg);
    --pc-bg-gradient: var(--pc-app-bg-gradient);

    --pc-card: #FFFFFF;
    --pc-border: #DDE1E6;
    --pc-card-border: #DDE1E6;

    --pc-positive: #32B36F;
    --pc-mint: #62E99A;
    --pc-mint-soft: #E9FFF0;

    --pc-negative: #DF716A;
    --pc-negative-soft: #FDEDED;

    --pc-inactive: #D9DEDA;

    /* Placeholder/helper text inside form inputs. Intentionally lighter and
     * italicized (see the ::placeholder rule below) so example values such as
     * '111-111-1111' or '0.00' never read as real entered data. */
    --pc-placeholder: #8F978F;

    /* Neutral hover surface for generic interactive states (table rows,
     * sidebar links). Keeps green/mint reserved for semantic profit/success. */
    --pc-hover-neutral: #EEF1EF;

    /* Ad-platform colors — muted, used only in ad-platform surfaces. */
    --pc-platform-facebook: #929DCA;
    --pc-platform-google: #83B39A;
    --pc-platform-bing: #8BB8BE;
    --pc-platform-snapchat: #D1B987;
    --pc-platform-pinterest: #AA9BC9;
    --pc-platform-tiktok: #747A76;
    --pc-platform-reddit: #C4938C;

    /* Backward-compatible aliases. Legacy token names still referenced by
     * older components now resolve to the new palette so every surface
     * inherits the new visual system without per-file rewrites. */
    --pc-surface: var(--pc-bg);
    --pc-surface-raised: var(--pc-card);
    --pc-graphite: var(--pc-primary-ink);
    --pc-ink: var(--pc-primary-ink);
    --pc-coral: var(--pc-negative);
    --pc-sky: var(--pc-platform-bing);
    --pc-radius: 12px;
    --pc-radius-sm: 10px;
    --pc-shadow-soft: 0 1px 2px rgba(23, 26, 24, 0.04);
    --pc-shadow-hover: 0 8px 22px rgba(23, 26, 24, 0.08);
}

/* ============================================================
 * App-wide surfaces, typography, cards, controls
 * Desktop layout is unchanged; compact navigation overrides live below.
 * ============================================================ */

/* Root canvas and content wrappers share the same cool neutral surface. */
html,
body {
    background: var(--pc-app-bg);
    color: var(--pc-primary-ink);
}

.dashboard-wrapper {
    background: var(--pc-app-bg);
    color: var(--pc-primary-ink);
}

.dashboard-finance {
    background: var(--pc-app-bg);
    color: var(--pc-primary-ink);
}

.dashboard-content {
    color: var(--pc-primary-ink);
}

.aliexpress-notice-layout[hidden], .aliexpress-notice-store[hidden] { display: none !important; }

/* Keep the extension reminder aligned with content, outside the navigation. */
.aliexpress-notice-layout {
    margin-left: 200px;
    padding: 20px 20px 0;
}
.aliexpress-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    padding: 16px 20px;
    border: 1px solid #e7d8ad;
    border-left: 4px solid #c89736;
    border-radius: var(--pc-radius);
    background: #fffaf0;
    color: var(--pc-primary-ink);
}
.aliexpress-notice-copy { min-width: 0; }
.aliexpress-notice-title { display: block; font-size: 15px; }
.aliexpress-notice-copy p { margin: 3px 0 0; }
.aliexpress-notice-deadline { font-weight: 700; }
.aliexpress-notice-stores { display: grid; gap: 8px; }
.aliexpress-notice-store { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.aliexpress-notice-store-name { overflow-wrap: anywhere; font-weight: 600; }
.aliexpress-notice-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--pc-action-bg);
    color: #fff;
    font-weight: 700;
    text-align: center;
}
.aliexpress-notice-action:hover, .aliexpress-notice-action:focus { background: var(--pc-action-hover-bg); color: #fff; }
.aliexpress-notice-action:focus-visible { outline: 2px solid var(--pc-primary-ink); outline-offset: 3px; }
.aliexpress-notice-status { font-weight: 600; }
.aliexpress-notice-status:empty { display: none; }
@media (max-width: 991.98px) {
    .aliexpress-notice-layout { margin-left: 0; padding: 20px 20px 0; }
}
@media (max-width: 767.98px) {
    .aliexpress-notice-layout { padding: 16px 10px 0; }
    .aliexpress-notice { align-items: stretch; flex-direction: column; padding: 14px 16px; }
    .aliexpress-notice-store { align-items: flex-start; flex-direction: column; }
}

h1, h2, h3, h4, h5, h6,
.page-title,
.page-title-section h1 {
    color: var(--pc-primary-ink);
}

.metric-label,
.text-muted,
small,
.small {
    color: var(--pc-muted);
}

/* ============================================================
 * Dashboard metric typography
 * The .metric-value wrapper owns the number size via a custom property
 * (--metric-number-size). The number h1 inherits at 1em and the currency
 * symbol at 0.7em, so the 70% ratio holds at every card size without
 * hardcoding separate pixel values for each element.
 * ============================================================ */

/* Bootstrap .d-inline-block on the same element sets display:inline-block
 * !important, which would silently defeat the flex layout. Override with
 * !important so the symbol and number share a baseline. */
.metric-value,
.metric-value.d-inline-block {
    --metric-number-size: 30px;
    display: inline-flex !important;
    align-items: center;
    font-size: var(--metric-number-size);
    white-space: nowrap;
}

/* Top-row KPI cards use a slightly larger value. */
.metric-value--top {
    --metric-number-size: 34px;
}

.metric-value > h1 {
    display: inline-block;
    font-size: 1em;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* Currency symbol: 70% of the number size (0.7em), muted so it reads as a
 * supporting prefix. The inline-flex parent uses align-items: center so
 * the symbol is vertically centered against the number — no manual
 * vertical offset needed. */
.metric-value > .metric-currency-symbol {
    color: var(--pc-muted);
    font-size: 0.7em;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: 1;
    margin-right: 0.08em;
}

/* Profit cards carry a health color (green/red/neutral). The symbol on
 * those cards should match the number, not the muted default. */
.profit-accent-card .metric-value > .metric-currency-symbol {
    color: var(--profit-health-color);
}

@media (max-width: 576px) {
    .metric-value,
    .metric-value.d-inline-block {
        --metric-number-size: 26px;
    }

    .metric-value--top {
        --metric-number-size: 29px;
    }
}

/* Cards: white, slightly stronger border so they read as distinct surfaces,
 * soft radius, no heavy shadows. */
.card,
.card-dashboard,
.dashboard-chart-card,
.mc-card,
.mission-control-title-card,
.mission-control-notes-card,
.report-guide-card,
.report-guide-title-card {
    background-color: var(--pc-card);
    border: 1.5px solid var(--pc-card-border);
    border-radius: var(--pc-radius);
    box-shadow: var(--pc-shadow-soft);
}

.card-dashboard {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.card-dashboard:hover {
    transform: translateY(-2px);
    border-color: var(--pc-primary-ink);
    box-shadow: var(--pc-shadow-hover);
}

/* Card headers: flat and quiet, no divider line under the title. */
.card-header {
    background-color: transparent;
    border-bottom: 0;
    color: var(--pc-primary-ink);
}

.dashboard-chart-card > .card-header {
    background: transparent;
    border-bottom: 0;
}

/* Revenue Overview loads after the dashboard cards so the page becomes useful
 * quickly. Keep that deferred work visible without blocking the chart once it
 * is ready for interaction. */
.dashboard-chart-card #line-chart-section {
    min-height: 200px;
    position: relative;
}

.dashboard-chart-loading {
    align-items: center;
    color: var(--pc-primary-ink);
    display: flex;
    font-size: 0.9rem;
    font-weight: 700;
    gap: 0.5rem;
    inset: 0;
    justify-content: center;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.dashboard-chart-loading.hidden {
    display: none;
}

.dashboard-chart-error {
    align-items: center;
    color: var(--pc-primary-ink);
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    font-weight: 700;
    gap: 0.75rem;
    inset: 0;
    justify-content: center;
    position: absolute;
    text-align: center;
    z-index: 1;
}

.dashboard-chart-error.hidden {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-chart-loading .fa-spin {
        animation: none;
    }
}

/* Profit is the primary business outcome, so only Profit cards carry a
 * colored left accent. A single card-level variable (--profit-health-color)
 * drives BOTH the left border and the profit value text so they always
 * match. The active state class is toggled by updateUI.js once profit known. */
.profit-accent-card {
    --profit-health-color: var(--pc-neutral);
    border-left: 4px solid var(--profit-health-color);
    transition: border-color 0.2s ease;
}

.profit-accent-card.profit-accent-card--positive {
    --profit-health-color: var(--pc-positive);
}

.profit-accent-card.profit-accent-card--negative {
    --profit-health-color: var(--pc-negative);
}

.profit-accent-card.profit-accent-card--neutral {
    --profit-health-color: var(--pc-neutral);
}

/* The profit value number inside the card reads in the same health color. */
.profit-accent-card #profit-top,
.profit-accent-card #profit {
    color: var(--profit-health-color);
}

/* Buttons: primary = graphite charcoal, secondary = white/border. Primary
 * and hover differ slightly so the hover state is visible (the previous
 * rule made normal and hover identical, so Submit buttons never changed). */
.btn-primary,
.btn-success,
.btn-outline-success {
    background-color: var(--pc-action-bg);
    border-color: var(--pc-action-bg);
    color: #ffffff;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary:hover,
.btn-success:hover,
.btn-outline-success:hover {
    background-color: var(--pc-action-hover-bg);
    border-color: var(--pc-action-hover-bg);
    color: #ffffff;
}

.btn-outline-dark {
    background-color: var(--pc-card);
    border-color: var(--pc-border);
    color: var(--pc-primary-ink);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Outline-dark (generic Edit/secondary actions) hover to graphite charcoal
 * with white text, matching the primary action family rather than mint/green. */
.btn-outline-dark:hover {
    background-color: var(--pc-action-bg);
    border-color: var(--pc-action-bg);
    color: #ffffff;
}

/* Outline-light buttons (used for CSV export / report actions) read as
 * primary actions on light surfaces, so render as ink-on-white. */
.btn-outline-light {
    background-color: var(--pc-card);
    border-color: var(--pc-border);
    color: var(--pc-primary-ink);
}

.btn-outline-light:hover {
    background-color: var(--pc-primary-ink);
    border-color: var(--pc-primary-ink);
    color: #ffffff;
}

/* Destructive stays coral. */
.btn-danger,
.btn-outline-danger {
    background-color: var(--pc-card);
    border-color: var(--pc-negative);
    color: var(--pc-negative);
}

.btn-danger:hover,
.btn-outline-danger:hover {
    background-color: var(--pc-negative);
    border-color: var(--pc-negative);
    color: #ffffff;
}

/* Form controls / filters. */
.form-control,
.custom-select,
input.form-control.date-selector {
    background-color: var(--pc-card);
    border: 1px solid var(--pc-border);
    color: var(--pc-primary-ink);
}

.form-control:focus,
.custom-select:focus,
input.form-control.date-selector:focus {
    border-color: var(--pc-primary-ink);
    box-shadow: 0 0 0 3px rgba(23, 26, 24, 0.16);
}

/* ============================================================
 * Placeholder / helper text
 * Placeholder hints (e.g. '111-111-1111', '0.00', search
 * prompts) must read clearly as examples rather than entered
 * values. They use a muted gray token and italic styling so
 * they stay distinct from real input text. opacity: 1 unifies
 * Firefox/Safari which otherwise dim placeholders differently.
 * Vendor-prefixed selectors are grouped alongside the standard
 * ::placeholder rule for older browsers.
 * ============================================================ */
input::placeholder,
textarea::placeholder,
.form-control::placeholder,
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
.form-control::-webkit-input-placeholder,
input::-moz-placeholder,
textarea::-moz-placeholder,
.form-control::-moz-placeholder {
    color: var(--pc-placeholder);
    font-style: italic;
    opacity: 1;
}

/* ============================================================
 * Date range picker
 * Selected calendar days, range endpoints, and active preset
 * ranges use the primary ink (near-black) so the selection state
 * reads as a primary action rather than semantic success green.
 * The vendor stylesheet is loaded before this file (see base
 * layouts) so these rules win without !important.
 * ============================================================ */
.daterangepicker td.active,
.daterangepicker td.active:hover,
.daterangepicker td.start-date,
.daterangepicker td.start-date.end-date,
.daterangepicker td.end-date {
    background-color: var(--pc-primary-ink);
    color: #ffffff;
}

/* Interior days of a multi-day range: neutral gray surface so the
 * range reads as a selection band, never as a green/mint wash. */
.daterangepicker td.in-range,
.daterangepicker td.in-range:hover {
    background-color: var(--pc-hover-neutral);
    color: var(--pc-primary-ink);
}

/* Active preset chip in the ranges list mirrors the selected day. */
.daterangepicker .ranges li.active,
.daterangepicker .ranges li:hover {
    background-color: var(--pc-primary-ink);
    color: #ffffff;
}

/* Tables: graphite headers for readability, faint row dividers. */
.table {
    color: var(--pc-primary-ink);
}

/* Column headers: a little taller with more horizontal padding so labels
 * never feel crammed against their neighbors. Header background uses the
 * shared graphite token so it matches the sidebar active state and the
 * historical #393e44 header color rather than reading as pure black. */
.table thead th,
.table .thead-dark th,
table.table thead.thead-dark th {
    background-color: var(--pc-header-bg);
    border-color: var(--pc-header-bg);
    color: #ffffff;
    font-weight: 700;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    padding-left: 1rem;
    padding-right: 1rem;
    white-space: nowrap;
}

.table th,
.table td {
    border-color: var(--pc-border);
}

/* Faint, neutral row hover applied to every data table, not only the
 * .table-hover variant. Bootstrap paints the cell background, so the
 * child td/th must carry the surface too. A neutral gray is used rather
 * than green/mint so the hover never reads as a semantic state. */
.table tbody tr:hover,
.table tbody tr:hover > td,
.table tbody tr:hover > th,
.table-hover tbody tr:hover,
.table-hover tbody tr:hover > td,
.table-hover tbody tr:hover > th,
.entry-month-group .table tbody tr:hover {
    background-color: var(--pc-hover-neutral);
}

/* Sticky first columns (e.g. the P&L metric label) must still adopt the
 * hover surface, otherwise the row hover reads as broken where it meets
 * the pinned cell. */
.metric-column:hover,
.metric-column:focus {
    background-color: var(--pc-hover-neutral);
}

/* ============================================================
 * Financial table presentation
 * Tabular numerals + right alignment so decimals line up vertically.
 * Profit is the only bold financial endpoint per row; other money
 * reads in a slightly larger medium weight so key figures (Revenue,
 * COGS, Fees, Margin, Profit) scan clearly without dominating.
 * Non-financial metadata (Gateway, Country, UTM Source) is de-emphasized
 * with the muted gray token.
 * ============================================================ */

.pc-financial-table tbody td,
.pc-financial-table tbody th {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Right-aligned, medium-weight numbers. Used for money, percentages,
 * ratios, and counts alike — anything where columnar alignment matters. */
.pc-table-number,
.pc-table-money,
.pc-table-percent,
.pc-table-count {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

.pc-table-money {
    font-size: 0.96rem;
}

/* Profit is the single clear endpoint of each row: bold, same tabular
 * figure treatment so it still aligns with the other money columns. */
.pc-table-profit {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
    font-size: 0.96rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Bold inside a profit cell should not stack weights or spacing. */
.pc-table-profit strong,
.pc-table-profit b {
    font-weight: 700;
}

/* De-emphasize non-financial metadata so it recedes behind the numbers. */
.pc-table-meta {
    color: var(--pc-muted);
    font-weight: 400;
}

/* Inputs that hold financial values inside tables align with the
 * surrounding numeric cells. */
td input.form-control.pc-table-number,
td input.pc-table-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Semantic value classes for metric deltas. */
.text-success {
    color: var(--pc-positive) !important;
}

.text-neg-profit {
    color: var(--pc-negative) !important;
}

.text-secondary {
    color: var(--pc-negative) !important;
}

/* A neutral 0% / flat state must read as muted gray, never green. */
.text-neutral-metric {
    color: var(--pc-muted) !important;
}

/* Alerts/states. */
.alert-success {
    background-color: var(--pc-mint-soft);
    border-color: var(--pc-border);
    color: var(--pc-primary-ink);
}

.alert-danger {
    background-color: var(--pc-negative-soft);
    border-color: var(--pc-border);
    color: var(--pc-negative);
}

/* Warnings are informational nudges (e.g. the P&L "separate processing"
 * note), not errors, so they must not read as red/coral. A soft amber
 * surface keeps them distinct from both danger and success. */
.alert-warning {
    background-color: #FFF8E8;
    border-color: #EADFBF;
    color: var(--pc-chart-ink);
}

.shopify-reconnection-banner {
    margin: 0;
}

.shopify-reconnection-wrapper {
    min-height: 0 !important;
}

.shopify-reconnection-wrapper .dashboard-content {
    padding-bottom: 0;
}

.shopify-reconnection-banner__store {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shopify-reconnection-banner__store + .shopify-reconnection-banner__store {
    border-top: 1px solid #EADFBF;
    margin-top: 10px;
    padding-top: 10px;
}

.shopify-reconnection-modal-open {
    overflow: hidden;
}

.shopify-reconnection-modal-backdrop {
    background: rgba(23, 26, 24, 0.68);
    inset: 0;
    position: fixed;
    z-index: 11000;
}

.shopify-reconnection-modal {
    background: var(--pc-card);
    border: 1px solid #EADFBF;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    color: var(--pc-primary-ink);
    left: 50%;
    max-height: calc(100vh - 32px);
    max-width: 580px;
    overflow: auto;
    padding: 28px;
    position: fixed;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    z-index: 11001;
}

.shopify-reconnection-modal:focus {
    outline: 3px solid var(--pc-primary) !important;
    outline-offset: 4px;
}

.shopify-reconnection-modal h2 {
    font-size: 1.5rem;
    margin: 0 0 12px;
}

.shopify-reconnection-modal__stores {
    list-style: none;
    margin: 20px 0;
    padding: 0;
}

.shopify-reconnection-modal__stores li {
    align-items: center;
    border-top: 1px solid var(--pc-border);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 0;
}

.shopify-reconnection-modal__stores li:last-child {
    border-bottom: 1px solid var(--pc-border);
}

.shopify-reconnection-modal__action,
.shopify-reconnection-modal__dismiss {
    border-radius: 6px;
    font-weight: 700;
    padding: 9px 14px;
}

.shopify-reconnection-modal__action {
    background: var(--pc-primary);
    color: #fff;
    text-decoration: none;
}

.shopify-reconnection-modal__action:hover,
.shopify-reconnection-modal__action:focus {
    color: #fff;
    text-decoration: none;
}

.shopify-reconnection-modal__dismiss {
    background: transparent;
    border: 1px solid var(--pc-border);
    color: var(--pc-primary-ink);
}

.shopify-reconnection-modal__help {
    color: var(--pc-muted);
    margin-bottom: 20px;
}

.alert-light {
    background-color: var(--pc-card);
    border-color: var(--pc-border);
    color: var(--pc-muted);
}

/* ============================================================
 * Sidebar / navigation
 * Light, near-black-led. Active item = primary ink + white text,
 * with a thin mint indicator. Inactive items = muted gray-green.
 * ============================================================ */
/* Desktop sidebar / navigation: flat white surface. The shell and its parent
 * wrapper (.dashboard-main-wrapper) are kept solid white (no gradient) so the
 * navigation always reads as a single clean surface. background-image: none
 * plus the explicit background-color guarantees no gradient layer — inherited
 * from the content area or any prior rule — can bleed through. */
.dashboard-main-wrapper,
.nav-left-sidebar,
.nav-left-sidebar.sidebar-dark,
.sidebar-dark.nav-left-sidebar {
    background-color: var(--pc-sidebar-bg) !important;
    background-image: none !important;
    border-right: 1px solid var(--pc-card-border);
    box-shadow: none !important;
}

/* Inner sidebar regions are kept on the same flat app surface rather than
 * transparent or white, so the content-area gradient can never show through
 * the navigation internals. */
.nav-left-sidebar .navbar,
.nav-left-sidebar .menu-list,
.nav-left-sidebar .navbar-collapse,
.nav-left-sidebar .navbar-nav,
.nav-left-sidebar .nav {
    background-color: var(--pc-sidebar-bg) !important;
    background-image: none !important;
}

.nav-left-sidebar .nav-link {
    font-weight: 600;
    color: var(--pc-muted);
    border-radius: var(--pc-radius-sm);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-left-sidebar .nav-link:hover {
    background-color: var(--pc-hover-neutral);
    color: var(--pc-primary-ink);
}

.nav-left-sidebar .nav-link.active,
.nav-left-sidebar .nav-link[aria-current="page"] {
    margin: 6px 0;
    background-color: var(--pc-header-bg);
    color: #ffffff;
    position: relative;
}

.nav-left-sidebar .nav-link.active::before,
.nav-left-sidebar .nav-link[aria-current="page"]::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background-color: var(--pc-mint);
}

.nav-left-sidebar .nav-divider {
    color: var(--pc-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.8;
}

/* Separate the first section link from the divider, including its highlight. */
.nav-left-sidebar.sidebar-dark .navbar-nav .nav-divider + .nav-link {
    margin-top: 4px;
}

/* Own this breakpoint: the app's vendor navbar-expand-lg expands at 770px.
 * Match header and direct cards to the outer row/column card gutters. */
.mobile-nav-logo {
    display: none;
}

/* Center loading feedback in the viewport's content area, beside the
 * desktop sidebar. It sits outside the content wrapper that fades out. */
.navigation-loading-indicator {
    position: fixed;
    top: 50%;
    left: calc(50% + 100px);
    transform: translate(-50%, -50%);
    z-index: 10000;
    color: var(--pc-chart-ink);
    pointer-events: none;
}

.navigation-loading-indicator[hidden] {
    display: none;
}

/* Keep the shell visible while the outgoing page fades during navigation.
 * Opacity preserves page geometry until the next document replaces it. */
.app-shell .dashboard-wrapper.is-navigating-page {
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .app-shell .dashboard-wrapper.is-navigating-page {
        transition: none;
    }
}

@media (min-width: 992px) {
    .app-shell .nav-left-sidebar .app-sidebar-navbar .navbar-collapse {
        display: flex;
        flex-basis: auto;
    }

    .app-shell .nav-left-sidebar .app-sidebar-navbar .navbar-toggler {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .navigation-loading-indicator {
        left: 50%;
    }

    /* Paint the entire canvas from one surface to avoid background seams. */
    html {
        background: var(--pc-app-bg);
    }

    body.app-shell {
        background: transparent;
        /* Keep header spacing inside the page canvas. */
        padding-top: 20px;
    }

    .app-shell .dashboard-wrapper,
    .app-shell .dashboard-finance {
        background: transparent;
    }

    .app-shell .dashboard-wrapper {
        margin-left: 0;
    }

    .app-shell .dashboard-main-wrapper {
        margin: 0 20px;
        background-color: transparent !important;
        border: 0;
    }

    .app-shell .nav-left-sidebar {
        position: static;
        scroll-margin-block: 20px;
        width: auto;
        height: auto;
        overflow: visible;
        background-color: var(--pc-card) !important;
        border: 1.5px solid var(--pc-card-border);
        border-radius: var(--pc-radius);
        box-shadow: var(--pc-shadow-soft) !important;
        transition: none;
    }

    .app-shell .nav-left-sidebar .navbar,
    .app-shell .nav-left-sidebar .menu-list,
    .app-shell .nav-left-sidebar .navbar-collapse,
    .app-shell .nav-left-sidebar .navbar-nav,
    .app-shell .nav-left-sidebar .nav {
        background-color: transparent !important;
    }

    .app-shell .nav-left-sidebar .navbar {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        padding: 10px;
        gap: 8px;
        align-items: center;
    }

    .app-shell .nav-left-sidebar .mobile-nav-logo {
        display: block;
        width: 170px;
        max-width: 100%;
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        height: auto;
    }

    .app-shell .nav-left-sidebar .desktop-nav-logo {
        display: none;
    }

    .app-shell .nav-left-sidebar .navbar-toggler {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 44px;
        width: 44px;
        flex: 0 0 44px;
        grid-column: 1;
        grid-row: 1;
        padding: 10px;
        border: 1px solid var(--pc-card-border);
        border-radius: var(--pc-radius-sm);
        background: var(--pc-card);
        color: var(--pc-primary-ink);
        font-size: 14px;
        font-weight: 600;
    }

    .app-shell .nav-left-sidebar .navbar-toggler:hover,
    .app-shell .nav-left-sidebar .navbar-toggler[aria-expanded="true"] {
        background: var(--pc-hover-neutral);
    }

    .app-shell .nav-left-sidebar .navbar-toggler:focus-visible {
        outline: 2px solid var(--pc-primary-ink);
        outline-offset: 2px;
    }

    .app-shell .nav-left-sidebar .navbar-collapse {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .app-shell .dashboard-content > .card {
        margin-left: -10px;
        margin-right: -10px;
    }

    /* Bootstrap may finish an earlier opening transition after the tap. */
    .app-shell .nav-left-sidebar.is-navigating #navbarNav {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .app-shell .dashboard-main-wrapper {
        margin-right: 10px;
        margin-left: 10px;
    }
}

/* ============================================================
 * COGS settings: Shopify shipping label backfill link
 * The backfill action is rendered inline as a "Click here" link
 * within the Shipping Sync Settings card rather than its own
 * standalone button section.
 * ============================================================ */
#cogs-settings-page .shopify-shipping-label-sync-link.disabled {
    opacity: 0.6;
    pointer-events: none;
}

#cogs-settings-page #shopify-shipping-label-sync-status {
    min-height: 1.2em;
}

/* ============================================================
 * Loading brand logo
 * ProfitCalc wordmark shown at a fixed location near the top of the
 * sync overlay and the analytics "profit building" loaders so the
 * user always knows where they are while waiting. It floats
 * independently (position: fixed) so it shares one identical anchor
 * point across both screens and does not participate in the centered
 * animation stack.
 * ============================================================ */
.loading-brand-header {
    left: 0;
    right: 0;
    margin: 0;
    pointer-events: none;
    position: fixed;
    text-align: center;
    top: 164px;
    transform: none;
    z-index: 2;
}

.loading-brand-logo {
    display: inline-block;
    width: min(192px, 58vw);
    height: auto;
    margin: 0 auto;
}

@media (max-width: 575.98px) {
    .loading-brand-logo {
        width: min(182px, 62vw);
    }
}

/* On short viewports the fixed logo could overlap the centered overlay
 * content, so pull it closer to the top and shrink it slightly. */
@media (max-height: 520px) {
    .loading-brand-header {
        top: 72px;
    }

    .loading-brand-logo {
        width: min(154px, 50vw);
    }
}

/* ============================================================
 * Branded "profit building" loading animation
 * A compact line chart that draws upward with subtle dips and a
 * gently pulsing endpoint. Used by the dashboard + report loaders.
 * ============================================================ */
.profit-building-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.profit-building-loader__chart {
    width: 180px;
    height: 64px;
    display: block;
    overflow: visible;
}

.profit-building-loader__line {
    fill: none;
    stroke: var(--pc-graphite, #393e44);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: profit-building-loader-draw 1.8s cubic-bezier(0.45, 0.05, 0.25, 1) forwards;
}

.profit-building-loader__area {
    fill: var(--pc-graphite, #393e44);
    fill-opacity: 0;
    animation: profit-building-loader-area 1.8s cubic-bezier(0.45, 0.05, 0.25, 1) forwards;
}

.profit-building-loader__endpoint {
    fill: var(--pc-graphite, #393e44);
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: profit-building-loader-endpoint 2s 1.5s ease-in-out infinite;
}

.profit-building-loader__title {
    margin: 0;
    color: var(--pc-graphite, #393e44);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}

.profit-building-loader__step {
    margin: 0;
    min-height: 1.2em;
    color: var(--pc-muted, #5f6368);
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.profit-building-loader__step.is-fading {
    opacity: 0;
    transform: translateY(4px);
}

/* Static (completed or reduce-motion) chart: draw immediately. */
.profit-building-loader.is-static .profit-building-loader__line {
    animation: none;
    stroke-dashoffset: 0;
}

.profit-building-loader.is-static .profit-building-loader__area {
    animation: none;
    fill-opacity: 0.12;
}

.profit-building-loader.is-static .profit-building-loader__endpoint {
    animation: none;
    opacity: 1;
}

@keyframes profit-building-loader-draw {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes profit-building-loader-area {
    from { fill-opacity: 0; }
    to { fill-opacity: 0.12; }
}

@keyframes profit-building-loader-endpoint {
    0% { opacity: 0.85; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
    100% { opacity: 0.85; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .profit-building-loader__line,
    .profit-building-loader__area,
    .profit-building-loader__endpoint,
    .profit-building-loader__step {
        animation: none;
        transition: none;
    }

    .profit-building-loader__line {
        stroke-dashoffset: 0;
    }

    .profit-building-loader__area {
        fill-opacity: 0.12;
    }

    .profit-building-loader__endpoint {
        opacity: 1;
    }
}

/* ============================================================
 * Shopify sync loader
 * Three order cards visibly travel into a single receiver. Their SVG x/y
 * attributes animate directly, while the receiver foreground hides the final
 * descent so each card appears to sink into the inbox.
 * ============================================================ */
.sync-orders-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-orders-loader__svg {
    width: min(240px, calc(100vw - 48px));
    height: auto;
    display: block;
}

.sync-orders-loader__card-sheet,
.sync-orders-loader__receiver-body {
    fill: var(--pc-surface-raised, #ffffff);
    stroke: var(--pc-graphite, #393e44);
    stroke-width: 4.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sync-orders-loader__card-line {
    stroke: var(--pc-graphite, #393e44);
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.48;
}

.sync-orders-loader__card-line--short {
    opacity: 0.25;
}

.sync-orders-loader__static-card {
    display: none;
}

.sync-orders-loader__receiver-check {
    stroke: var(--pc-graphite, #393e44);
    stroke-width: 3.5;
    opacity: 0;
    animation: sync-orders-loader-receive 4.2s ease-in-out infinite;
}

@keyframes sync-orders-loader-receive {
    0%, 13%, 23%, 46%, 56%, 79%, 89%, 100% { opacity: 0; }
    17%, 50%, 83% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .sync-orders-loader__moving-card,
    .sync-orders-loader__receiver-check {
        display: none;
    }

    .sync-orders-loader__static-card {
        display: inline;
    }

    .sync-orders-loader__receiver-check {
        display: inline;
        opacity: 1;
    }
}

/* Subtle completion pulse when the final profit amount is revealed. */
.profit-result-pop {
    animation: profit-result-pop 0.5s ease-out;
}

@keyframes profit-result-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .profit-result-pop {
        animation: none;
    }
}

/* ============================================================
 * Shared SweetAlert2 colored toast styling
 * Mirrors the rules in profit-calc-app.css so the same toasts
 * render consistently on welcome/onboarding pages that do not
 * load profit-calc-app.css. Identical rules are harmless where
 * both stylesheets are present.
 * ============================================================ */
.colored-toast.swal2-icon-success {
    background-color: #393e44 !important;
}

.colored-toast.swal2-icon-error {
    background-color: #f27474 !important;
}

.colored-toast.swal2-icon-warning {
    background-color: #f8bb86 !important;
}

.colored-toast.swal2-icon-info {
    background-color: #3fc3ee !important;
}

.colored-toast.swal2-icon-question {
    background-color: #87adbd !important;
}

.colored-toast .swal2-title,
.colored-toast .swal2-html-container,
.colored-toast .swal2-close {
    color: #ffffff;
}

/* Persistent loading/syncing toast used while ad-platform data
 * syncs (e.g. Meta login). Neutral graphite surface with a small
 * CSS spinner so the state reads as "in progress" without
 * relying on a confirm-dialog loader. */
.colored-toast.colored-toast-loading {
    background-color: #393e44 !important;
}

.colored-toast.colored-toast-loading .swal2-title {
    color: #ffffff;
    display: inline-flex;
    align-items: center;
}

.colored-toast.colored-toast-loading .swal2-title::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 10px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: pc-toast-spin 0.7s linear infinite;
}

@keyframes pc-toast-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .colored-toast.colored-toast-loading .swal2-title::before {
        animation: none;
    }
}

/* ============================================================
 * Shipping Bundles — edit mode highlighting
 * The creation card sits above the existing-bundles table. When a
 * user clicks "Edit" on a row, the card becomes the edit form, so
 * it must visibly change: graphite left accent (the app's active/
 * primary signal), stronger border, and elevated shadow — the same
 * affordance family as .card-dashboard:hover. Amber (the warning/
 * informational tone) is reserved for the in-card notice and the
 * highlighted table row so the three cues read as one state.
 * All selectors are scoped to shipping-bundle-* classes/IDs and
 * never touch generic .card or .table rules.
 * ============================================================ */

.shipping-bundle-editor-card {
    transition: border-color 0.2s ease, border-left-color 0.2s ease,
        box-shadow 0.2s ease;
}

.shipping-bundle-editor-card--editing {
    border-color: var(--pc-card-border);
    border-left: 4px solid var(--pc-action-bg);
    box-shadow: var(--pc-shadow-hover);
}

/* Form header: title ("Create/Update Bundle") + "Editing" badge on one
 * line, wrapping gracefully on narrow screens. */
.shipping-bundle-edit-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.shipping-bundle-edit-badge {
    background-color: var(--pc-action-bg);
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.35rem 0.7rem;
    white-space: nowrap;
}

.shipping-bundle-edit-notice {
    align-items: baseline;
    margin-bottom: 1rem;
}

.shipping-bundle-edit-notice .fa-info-circle {
    margin-right: 0.35rem;
}

/* The row currently loaded into the edit form. ID-based specificity
 * keeps the highlight stable against the generic table hover rules
 * above, and adds a graphite accent that mirrors the form card. */
#shipping-bundles-table-body tr.shipping-bundle-row--editing > td {
    background-color: #FFF8E8;
    border-left: 3px solid var(--pc-action-bg);
    font-weight: 500;
}

#shipping-bundles-table-body tr.shipping-bundle-row--editing > td:first-child {
    font-weight: 600;
}

/* Money cells already carry weight 500; keep alignment untouched. */
#shipping-bundles-table-body tr.shipping-bundle-row--editing > td.pc-table-money {
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .shipping-bundle-editor-card {
        transition: none;
    }
}

/* ============================================================
 * Pick & Pack Fees
 * This form intentionally avoids Bootstrap's legacy .row gutter and
 * .custom-control pseudo-elements. The app narrows column gutters globally,
 * while Bootstrap rows retain negative margins; a local grid keeps the card
 * edges and action controls aligned at every viewport size.
 * ============================================================ */

#pick-pack-fees-page {
    color: var(--pc-primary-ink);
}

#pick-pack-fees-page .pick-pack-copy,
#pick-pack-fees-page label,
#pick-pack-fees-page .pick-pack-target-options {
    color: var(--pc-primary-ink);
}

#pick-pack-fees-page .pick-pack-form-grid,
#pick-pack-fees-page .pick-pack-search-grid,
#pick-pack-fees-page .pick-pack-date-grid {
    display: grid;
    gap: 1rem;
}

#pick-pack-fees-page .pick-pack-default-grid {
    grid-template-columns: minmax(9rem, 1fr) minmax(12rem, 1fr) minmax(11rem, 0.8fr) auto minmax(11rem, 0.9fr);
}

#pick-pack-fees-page .pick-pack-override-grid {
    grid-template-columns: minmax(12rem, 1fr) minmax(11rem, 0.8fr) minmax(9rem, 0.7fr) auto minmax(11rem, 0.9fr);
}

#pick-pack-fees-page .pick-pack-search-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 1rem;
}

#pick-pack-fees-page .pick-pack-date-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    margin-top: 1rem;
    max-width: 34rem;
}

#pick-pack-fees-page .pick-pack-field {
    min-width: 0;
}

#pick-pack-fees-page .pick-pack-field > label,
#pick-pack-fees-page .pick-pack-target-legend {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

#pick-pack-fees-page .pick-pack-field .form-control,
#pick-pack-fees-page .pick-pack-field .custom-select {
    width: 100%;
}

#pick-pack-fees-page .pick-pack-check,
#pick-pack-fees-page .pick-pack-choice {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
    margin: 0;
    min-height: 2.4rem;
    padding: 0;
}

/* Match the label space above the adjacent date inputs so the no-end-date
 * control sits on the same input row in both forms. */
#pick-pack-fees-page .pick-pack-no-end-spacer {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    visibility: hidden;
}

#pick-pack-fees-page .pick-pack-choice {
    border: 1px solid transparent;
    border-radius: 0.25rem;
    cursor: pointer;
    padding: 0.45rem 0.7rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

#pick-pack-fees-page .pick-pack-choice--selected {
    background-color: var(--pc-card);
    border-color: var(--pc-primary-ink);
    font-weight: 600;
}

#pick-pack-fees-page .pick-pack-check .form-check-input,
#pick-pack-fees-page .pick-pack-choice input {
    accent-color: var(--pc-primary-ink);
    height: 1rem;
    margin: 0;
    position: static;
    width: 1rem;
}

#pick-pack-fees-page .pick-pack-check .form-check-label,
#pick-pack-fees-page .pick-pack-choice label {
    margin: 0;
}

#pick-pack-fees-page .pick-pack-toggle-field {
    align-self: end;
    padding-bottom: 0.35rem;
    white-space: nowrap;
}

#pick-pack-fees-page .pick-pack-actions {
    align-items: center;
    align-self: end;
    display: flex;
    gap: 0.5rem;
    min-height: 2.4rem;
}

#pick-pack-fees-page .pick-pack-actions .btn {
    margin: 0;
    white-space: nowrap;
}

#pick-pack-fees-page .pick-pack-search-action {
    padding-bottom: 0;
}

#pick-pack-fees-page .pick-pack-target-mode {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

#pick-pack-fees-page .pick-pack-target-legend {
    flex-basis: 100%;
    margin: 0;
}

#pick-pack-fees-page .pick-pack-target-options {
    border: 1px solid var(--pc-border);
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.5rem 1.25rem;
}

#pick-pack-fees-page .pick-pack-catalog-option {
    display: flex;
    min-height: 0;
    margin-bottom: 0.15rem;
}

#pick-pack-fees-page .pick-pack-catalog-option:last-child {
    margin-bottom: 0;
}

#pick-pack-fees-page .pick-pack-load-more {
    display: block;
    margin: 0.75rem auto 0;
}

/* ============================================================
 * Printify shop scope
 * Native controls deliberately replace Bootstrap's .custom-control pseudo
 * elements here. Those pseudo-elements conflict with the app theme and can
 * render a white layer over the actual browser control.
 * ============================================================ */

#printify-setup-page .printify-shop-scope-card,
#printify-setup-page .printify-shop-scope-card label {
    color: var(--pc-primary-ink);
}

#printify-setup-page .printify-shop-scope-options,
#printify-setup-page .printify-shop-options {
    display: grid;
    gap: 0.1rem;
}

#printify-setup-page .printify-shop-scope-options {
    margin-bottom: 0.35rem;
}

#printify-setup-page .printify-shop-options {
    border: 1px solid var(--pc-border);
    border-radius: 0.25rem;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.5rem;
}

#printify-setup-page .printify-shop-choice,
#printify-setup-page .printify-shop-option {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    cursor: pointer;
    display: flex;
    gap: 0.55rem;
    margin: 0;
    min-height: 1.65rem;
    padding: 0.1rem 0.45rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

#printify-setup-page .printify-shop-choice:hover,
#printify-setup-page .printify-shop-option:hover {
    background-color: var(--pc-hover-neutral);
}

#printify-setup-page .printify-shop-control--selected {
    background-color: transparent;
    border-color: transparent;
    font-weight: 600;
}

#printify-setup-page .printify-shop-choice input,
#printify-setup-page .printify-shop-option input {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--pc-card);
    border: 1px solid var(--pc-primary-ink);
    border-radius: 0.15rem;
    flex: 0 0 auto;
    height: 1.1rem;
    margin: 0;
    opacity: 1;
    position: static;
    width: 1.1rem;
}

/* Legacy app CSS globally hides radio inputs. This must win so the current
 * saved scope is visibly selectable and distinguishable from the alternative. */
#printify-setup-page .printify-shop-choice input[type='radio'] {
    display: inline-block !important;
}

#printify-setup-page .printify-shop-choice input {
    border-radius: 50%;
}

#printify-setup-page .printify-shop-choice input:checked,
#printify-setup-page .printify-shop-option input:checked {
    background-color: var(--pc-primary-ink);
}

#printify-setup-page .printify-shop-option input:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6.2 4.8 8.7 9.8 3.5' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 0.8rem;
}

#printify-setup-page .printify-shop-choice input:checked {
    box-shadow: inset 0 0 0 0.22rem var(--pc-card);
}

#printify-setup-page .printify-shop-choice input:focus-visible,
#printify-setup-page .printify-shop-option input:focus-visible {
    outline: 2px solid var(--pc-primary-ink);
    outline-offset: 2px;
}

/* Product catalog controls use this instead of Bootstrap's optional spinner
   styles, which are not included in the application stylesheet. */
.catalog-loading-dots {
    align-items: center;
    display: inline-flex;
    gap: 0.22rem;
    min-height: 1rem;
    vertical-align: middle;
}

.catalog-select-loading {
    align-items: center;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.25rem;
    color: #f3f5f7;
    display: flex;
    min-height: calc(2.25rem + 2px);
    padding: 0.375rem 0.75rem;
    width: 100%;
}

.catalog-loading-dots > span {
    animation: catalog-loading-dot-pulse 1.1s ease-in-out infinite;
    background: currentColor;
    border-radius: 50%;
    display: block;
    height: 0.38rem;
    opacity: 0.3;
    width: 0.38rem;
}

.catalog-loading-dots > span:nth-child(2) { animation-delay: 0.1s; }
.catalog-loading-dots > span:nth-child(3) { animation-delay: 0.2s; }
.catalog-loading-dots > span:nth-child(4) { animation-delay: 0.3s; }
.catalog-loading-dots > span:nth-child(5) { animation-delay: 0.4s; }
.catalog-loading-dots > span:nth-child(6) { animation-delay: 0.5s; }

@keyframes catalog-loading-dot-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.75); }
    50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-loading-dots > span { animation: none; opacity: 0.8; }
}

@media (max-width: 1199px) {
    #pick-pack-fees-page .pick-pack-default-grid,
    #pick-pack-fees-page .pick-pack-override-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    #pick-pack-fees-page .pick-pack-default-grid,
    #pick-pack-fees-page .pick-pack-override-grid,
    #pick-pack-fees-page .pick-pack-search-grid,
    #pick-pack-fees-page .pick-pack-date-grid {
        grid-template-columns: 1fr;
    }

    #pick-pack-fees-page .pick-pack-actions,
    #pick-pack-fees-page .pick-pack-actions .btn {
        width: 100%;
    }
}

/* Shared destructive action for disconnecting integrations. */
.integration-modal-disconnect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0.65rem 1.1rem;
    border: 1px solid #d99b96;
    border-radius: 0.5rem;
    background: #fffafa;
    box-shadow: 0 1px 2px rgba(57, 62, 67, 0.06);
    color: #9f2f27 !important;
    font-weight: 700;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease,
        box-shadow 150ms ease, transform 150ms ease;
}

.integration-modal-disconnect:hover {
    border-color: #c86b63;
    background: #fbe9e7;
    box-shadow: 0 3px 8px rgba(57, 62, 67, 0.1);
    color: #8e251f !important;
    transform: translateY(-1px);
}

.integration-modal-disconnect:focus-visible {
    outline: 2px solid #9f2f27;
    outline-offset: 2px;
}

.integration-modal-disconnect:active {
    transform: translateY(0);
}

#ga4-setup-page .ga4-setup-loading {
    padding: 2rem 1rem;
    text-align: center;
}

#ga4-setup-page label,
#ga4-setup-page .form-control,
#ga4-setup-page .text-muted {
    color: var(--pc-primary-ink) !important;
}

#ga4-setup-page .integration-modal-disconnect:disabled {
    cursor: default;
    opacity: 0.65;
    transform: none;
}

#ga4-connect,
#ga4-disconnect,
#ga4-save-property {
    align-items: center;
    display: inline-flex;
    font-size: inherit;
    font-weight: 700;
    line-height: 1.5;
    min-height: 42px;
    padding: 0.65rem 1.1rem;
    border-radius: 0.5rem;
    vertical-align: middle;
}

/* Product Conversion uses explicit grids so filters, metrics and paging share
 * consistent spacing without relying on optional Bootstrap utilities. */
#ga4-product-report .dashboard-content {
    display: grid;
    gap: 20px;
}

#ga4-product-report .dashboard-content > .card,
#ga4-product-report .dashboard-content > .alert,
#ga4-product-report .ga4-report-metric > .card {
    margin-bottom: 0;
    min-width: 0;
}

#ga4-report-context {
    margin-bottom: 20px;
}

#ga4-product-report .ga4-report-filters {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(140px, 1fr)) auto;
    gap: 20px;
}

#ga4-product-report .ga4-report-filters .form-group {
    min-width: 0;
    margin-bottom: 0;
}

#ga4-product-report .ga4-report-filters label {
    display: block;
    margin-bottom: 8px;
}

#ga4-product-report .ga4-report-filters .form-control {
    width: 100%;
    min-width: 0;
    min-height: 40px;
}

#ga4-product-report .ga4-report-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

#ga4-product-report .ga4-report-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

#ga4-product-report .ga4-report-metrics:empty {
    display: none;
}

#ga4-product-report .ga4-report-metric {
    min-width: 0;
}

#ga4-product-report .ga4-report-metric > .card {
    height: 100%;
}

#ga4-report-results .table-responsive {
    overflow-x: auto;
}

#ga4-report-results table {
    width: 100%;
    min-width: 1000px;
    margin-bottom: 0;
}

#ga4-report-results th {
    white-space: normal;
    vertical-align: bottom;
}

#ga4-report-results th:first-child,
#ga4-report-results td:first-child {
    min-width: 220px;
    max-width: 320px;
    overflow-wrap: anywhere;
}

#ga4-product-report .ga4-sort-fields {
    display: contents;
}

#ga4-product-report .ga4-generation-controls {
    margin-bottom: 0;
    min-width: 560px;
}

#ga4-product-report .ga4-generation-controls td:not(:last-child) {
    width: 42%;
}

#ga4-product-report .ga4-generation-controls td {
    vertical-align: middle;
}

#ga4-product-report .ga4-generation-controls .form-control,
#ga4-product-report .ga4-generation-controls .custom-select {
    width: 100%;
    min-height: 40px;
}

#ga4-product-report .text-muted,
#ga4-product-report .small,
#ga4-product-report small,
#ga4-product-report label,
#ga4-product-report .form-control,
#ga4-product-report .custom-select {
    color: var(--pc-chart-ink) !important;
}

#ga4-product-report .ga4-report-notes summary {
    cursor: pointer;
}

#ga4-product-report .date-selector:not(:disabled) {
    background-color: var(--pc-card);
    cursor: pointer;
}

#ga4-product-report .ga4-sort-action {
    display: flex;
    align-items: flex-end;
}

#ga4-product-report .ga4-report-metric .dashboard-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#ga4-product-report .ga4-report-metric .dashboard-card > p {
    flex-basis: 100%;
}

#ga4-product-report .ga4-report-pagination {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

#ga4-pagination {
    text-align: center;
}

@media (max-width: 1199.98px) {
    #ga4-product-report .ga4-report-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    #ga4-product-report .ga4-report-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    #ga4-product-report .ga4-report-filters,
    #ga4-product-report .ga4-report-metrics {
        grid-template-columns: minmax(0, 1fr);
    }

    #ga4-product-report .ga4-report-actions > .btn {
        flex: 1;
    }
}

/* Product VAT uses the report palette and compact settings control layout. */
#product-cogs-vat-page .card-body {
    padding: 1.25rem;
}

#product-cogs-vat-page .product-cogs-vat-heading {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 1rem;
}

#product-cogs-vat-page .page-title-explainer {
    margin-bottom: 0.75rem;
}

#product-cogs-vat-page .product-cogs-vat-scope {
    margin: 0;
}

#product-cogs-vat-page .alert {
    padding: 0.65rem 0.85rem;
    margin: 0.75rem 0 0;
}

#product-cogs-vat-form {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.25rem;
    align-items: start;
}

#product-cogs-vat-page .product-cogs-vat-catalog,
#product-cogs-vat-page .product-cogs-vat-editor {
    min-width: 0;
}

#product-cogs-vat-page .product-cogs-vat-editor {
    border: 1px solid var(--pc-border);
    border-radius: 8px;
    padding: 1rem;
}

#product-cogs-vat-clear {
    font-weight: 600;
}

#product-cogs-vat-page .product-cogs-vat-actions {
    border-top: 1px solid var(--pc-border);
    padding-top: 0.85rem;
    margin-top: 0.85rem;
}

#product-cogs-vat-page .product-cogs-vat-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

#product-cogs-vat-page .product-cogs-vat-selection-header p {
    margin: 0;
}

#product-cogs-vat-page .product-cogs-vat-percentage {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 12rem;
}

#product-cogs-vat-page label,
#product-cogs-vat-page .form-control,
#product-cogs-vat-page .btn,
#product-cogs-vat-rate-help {
    font-size: 14px;
    line-height: 1.5;
}

#product-cogs-vat-page label {
    color: var(--pc-primary-ink);
    font-weight: 500;
    margin-bottom: 0.4rem;
}

#product-cogs-vat-page .form-group {
    margin-bottom: 0.75rem;
}

#product-cogs-vat-page .btn {
    padding: 0.4rem 0.75rem;
    min-height: 36px;
    white-space: normal;
}

#product-cogs-vat-options {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--pc-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

#product-cogs-vat-options .form-check {
    padding: 0.4rem 0 0.4rem 1.5rem;
    margin-bottom: 0 !important;
}

#product-cogs-vat-options .form-check + .form-check {
    border-top: 1px solid var(--pc-border);
}

#product-cogs-vat-options .form-check-label {
    display: block;
    font-weight: 400;
    margin: 0;
    overflow-wrap: anywhere;
    cursor: pointer;
}

#product-cogs-vat-selection {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#product-cogs-vat-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-height: 120px;
    overflow-y: auto;
    padding: 0;
    margin: 0 0 1rem;
}

#product-cogs-vat-selected-list .product-cogs-vat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    border: 1px solid var(--pc-border);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 14px;
}

#product-cogs-vat-selected-list li span {
    min-width: 0;
    overflow-wrap: anywhere;
}

#product-cogs-vat-page .product-cogs-vat-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    color: var(--pc-chart-ink);
    border: 0;
    border-radius: 3px;
    padding: 0;
    width: 24px;
    height: 24px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

#product-cogs-vat-page .product-cogs-vat-chip-remove:hover:not(:disabled) {
    background: var(--pc-hover-neutral);
    color: var(--pc-primary-ink);
}

#product-cogs-vat-page .product-cogs-vat-chip-remove:focus-visible {
    outline: 2px solid var(--pc-action-bg);
    outline-offset: 2px;
}

#product-cogs-vat-page .product-cogs-vat-chip-remove:disabled {
    opacity: 0.5;
    cursor: default;
}

#product-cogs-vat-rate-help {
    color: var(--pc-chart-ink);
    margin-bottom: 1rem;
}

/* Empty live regions retain their accessibility role without leaving gaps. */
#product-cogs-vat-page [role='status']:empty,
#product-cogs-vat-selected-list:empty,
#product-cogs-vat-options:empty {
    display: none;
}

#product-cogs-vat-more {
    margin-top: 0.75rem;
}

@media (max-width: 767.98px) {
    #product-cogs-vat-form {
        grid-template-columns: minmax(0, 1fr);
    }

}

/* The approval form moves here only for an explicit extension pairing link. */
.aliexpress-pairing-dialog {
    width: min(34rem, calc(100% - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    border: 1px solid var(--pc-border);
    border-radius: 12px;
    padding: 1.5rem;
    color: var(--pc-primary-ink);
    background: var(--pc-card);
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 18%);
}
.aliexpress-pairing-dialog::backdrop {
    background: rgb(25 29 25 / 45%);
}
.aliexpress-pairing-close {
    float: right;
    margin: 0 0 0.75rem 0.75rem;
}

/* Bootstrap resets dialog to display:block; closed native dialogs must stay hidden. */
.aliexpress-pairing-dialog:not([open]),
.aliexpress-pairing-dialog[hidden] {
    display: none !important;
}
.aliexpress-connection-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.aliexpress-connection-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--pc-border);
}
.aliexpress-connection-row:last-child { border-bottom: 0; }
.aliexpress-connection-row .btn { margin-left: 0 !important; }
.aliexpress-connection-dates { overflow-wrap: anywhere; }

.aliexpress-connection-manager .aliexpress-connection-actions { margin-bottom: 0; }
.aliexpress-connection-manager .aliexpress-connection-actions:has(button:not([hidden])) { margin-bottom: 1rem; }
.aliexpress-connection-heading { margin: 0 0 0.75rem; }
.aliexpress-connection-list { list-style: none; padding: 0; margin: 0; }
.aliexpress-connection-list .aliexpress-connection-row { justify-content: space-between; }
.aliexpress-connection-list .aliexpress-connection-dates { flex: 1 1 22rem; color: var(--pc-primary-ink); }
.aliexpress-connection-manager [data-extension-connections-status]:empty { display: none; }

/* Price offers follow the authenticated content column. */
.starter-price-offers[hidden] { display: none !important; }
.starter-price-offers { margin-left: 200px; padding: 20px 20px 0; display: grid; gap: 12px; }
.starter-price-offer { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; padding: 16px 20px; border: 1px solid var(--pc-border); border-left: 4px solid var(--pc-positive); border-radius: var(--pc-radius); background: var(--pc-card); color: var(--pc-primary-ink); }
.starter-price-offer-copy { min-width: 0; }
.starter-price-offer-copy strong { font-size: 15px; }
.starter-price-offer p { margin: 4px 0 0; }
.starter-price-offer-store { overflow-wrap: anywhere; font-weight: 600; }
.starter-price-offer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; flex-shrink: 0; max-width: 260px; }
.starter-price-offer-actions button { font: inherit; font-weight: 700; padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.starter-price-offer-switch { background: var(--pc-action-bg); color: #fff; border: 1px solid var(--pc-action-bg); }
.starter-price-offer-switch:hover { background: var(--pc-action-hover-bg); }
.starter-price-offer-dismiss { background: transparent; color: var(--pc-primary-ink); border: 1px solid var(--pc-border); }
.starter-price-offer-actions button:focus-visible { outline: 2px solid var(--pc-primary-ink); outline-offset: 3px; }
.starter-price-offer-actions button:disabled { opacity: .6; cursor: wait; }
.starter-price-offer-actions [role=status] { flex-basis: 100%; }
.starter-price-offer-actions [role=status]:empty { display: none; }
@media (max-width: 991.98px) { .starter-price-offers { margin-left: 0; } }
@media (max-width: 767.98px) { .starter-price-offers { padding: 16px 10px 0; } .starter-price-offer { align-items: stretch; flex-direction: column; } .starter-price-offer-actions { max-width: none; } }
