/* HadiTech Partner Hub - styles du module */

/* .erp-filter-bar (flex-wrap with no link styling) was originally borrowed
   for this nav; with 14 permission-gated links it just wrapped onto three
   rows of plain text with no active/hover state, reading as a scattered list
   rather than a navigation bar. This gives the local nav its own compact
   pill-tab look instead. */
/* Mobile bottom navigation ------------------------------------------------
   Desktop navigation is the sidebar alone; this whole block is hidden there
   and only appears below the tablet breakpoint (see the @media block at the
   end of this file), on Partner Hub's own pages only (this stylesheet is
   only loaded while inside the module - see boot.php). */
.partnerhub-mobile-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    justify-content: space-around;
    align-items: stretch;
    background: linear-gradient(180deg, var(--erp-color-navy) 0%, var(--erp-color-navy-deep) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -8px 24px rgba(4, 12, 24, 0.28);
}

.partnerhub-mobile-nav-link {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 56px;
    padding: 0.4rem 0.25rem;
    border: none;
    background: transparent;
    color: rgba(232, 238, 252, 0.65);
    font-size: 0.68rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.partnerhub-mobile-nav-link i {
    font-size: 1.15rem;
}

.partnerhub-mobile-nav-link.is-active {
    color: var(--erp-color-primary-light);
}

.partnerhub-mobile-nav-link:focus-visible {
    outline: 2px solid var(--erp-color-primary-light);
    outline-offset: -2px;
    border-radius: var(--erp-radius-sm);
}

.partnerhub-mobile-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 1049;
    background: rgba(4, 12, 24, 0.55);
}

.partnerhub-mobile-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--erp-color-surface, #fff);
    border-radius: 18px 18px 0 0;
    padding: 0.75rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -12px 32px rgba(4, 12, 24, 0.32);
    transform: translateY(0);
    transition: transform 0.22s ease;
}

.partnerhub-mobile-sheet[hidden],
.partnerhub-mobile-sheet-overlay[hidden] {
    display: none;
}

.partnerhub-mobile-sheet-grip {
    width: 36px;
    height: 4px;
    margin: 0.35rem auto 0.75rem;
    border-radius: 999px;
    background: var(--erp-color-border);
}

.partnerhub-mobile-sheet-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--erp-color-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
}

.partnerhub-mobile-sheet-heading {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--erp-color-text-muted);
}

.partnerhub-mobile-sheet-body a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.55rem 0.4rem;
    border-radius: var(--erp-radius-sm);
    color: var(--erp-color-text);
    text-decoration: none;
    font-weight: 600;
}

.partnerhub-mobile-sheet-body a:hover,
.partnerhub-mobile-sheet-body a:focus-visible {
    background: rgba(7, 159, 218, 0.1);
}

@media (max-width: 767px) {
    .partnerhub-mobile-nav {
        display: flex;
    }

    /* Room for the fixed bottom bar so page content never sits under it. */
    .partnerhub-dashboard,
    .partnerhub-page {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
    }
}

@media (prefers-reduced-motion: reduce) {
    .partnerhub-mobile-sheet {
        transition: none;
    }
}

.partnerhub-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

/* Hero banner ------------------------------------------------------------ */
.partnerhub-hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    align-items: center;
    border-radius: var(--erp-radius-lg);
    padding: 1.75rem 2rem;
    color: #e8eefc;
    background: linear-gradient(120deg, var(--erp-color-graphite) 0%, var(--erp-color-navy) 45%, var(--erp-color-navy-deep) 100%);
    box-shadow: var(--erp-shadow-md);
}

.partnerhub-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--erp-color-primary-light);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.partnerhub-hero-main h1 {
    margin: 0.5rem 0 0.35rem;
    color: #fff;
    font-size: 1.65rem;
    font-weight: 800;
}

.partnerhub-hero-main p {
    margin: 0 0 1rem;
    color: rgba(232, 238, 252, 0.82);
}

.partnerhub-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* The hero card has a dark background; the default .erp-btn (transparent
   background, dark text) is designed for light surfaces and becomes nearly
   invisible here, so any non-primary button inside the hero gets a light
   outline treatment instead. */
.partnerhub-hero-actions .erp-btn:not(.erp-btn-primary) {
    color: #e8eefc;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(232, 238, 252, 0.35);
}

.partnerhub-hero-actions .erp-btn:not(.erp-btn-primary):hover,
.partnerhub-hero-actions .erp-btn:not(.erp-btn-primary):focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(232, 238, 252, 0.55);
}

.partnerhub-hero-alakal {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    border-radius: var(--erp-radius-md);
    padding: 1.1rem;
    background: rgba(7, 159, 218, 0.12);
    border: 1px solid rgba(53, 169, 216, 0.35);
}

.partnerhub-hero-alakal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--erp-color-primary), var(--erp-color-indigo));
    font-size: 1.3rem;
}

.partnerhub-hero-alakal strong {
    color: #fff;
    font-size: 1rem;
}

.partnerhub-hero-alakal p {
    margin: 0.2rem 0 0.5rem;
    color: rgba(232, 238, 252, 0.78);
    font-size: 0.85rem;
}

.partnerhub-hero-alakal ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: rgba(232, 238, 252, 0.85);
}

.partnerhub-hero-alakal ul i {
    margin-right: 0.4rem;
    color: var(--erp-color-success);
}

/* KPI row ----------------------------------------------------------------- */
.partnerhub-kpi-grid .erp-kpi-col {
    grid-column: span 12;
}

@media (min-width: 640px) {
    .partnerhub-kpi-grid .erp-kpi-col { grid-column: span 6; }
}

@media (min-width: 1100px) {
    .partnerhub-kpi-grid .erp-kpi-col { grid-column: span 3; }
}

.partnerhub-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #fff;
}

.partnerhub-kpi-icon--primary { background: linear-gradient(135deg, var(--erp-color-primary), var(--erp-color-indigo)); }
.partnerhub-kpi-icon--success { background: linear-gradient(135deg, #10b981, #047857); }
.partnerhub-kpi-icon--warning { background: linear-gradient(135deg, #f97316, #c2410c); }
.partnerhub-kpi-icon--info { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.partnerhub-kpi-icon--purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.partnerhub-kpi-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.erp-kpi-accent-purple {
    border-left: 4px solid #8b5cf6;
}

.partnerhub-trend-positive { color: #047857; font-weight: 600; }
.partnerhub-trend-negative { color: #b91c1c; font-weight: 600; }
.partnerhub-trend-neutral { color: var(--erp-color-text-muted); }

/* Grids --------------------------------------------------------------- */
.partnerhub-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.partnerhub-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.partnerhub-card-subtitle { display: block; margin-top: .2rem; color: var(--erp-color-text-muted); font-size: .78rem; }
.partnerhub-card-link { display: inline-flex; align-items: center; gap: .35rem; flex: none; color: var(--erp-color-primary); font-size: .8rem; font-weight: 700; text-decoration: none; }
.partnerhub-card-link:hover, .partnerhub-card-link:focus-visible { text-decoration: underline; }
.partnerhub-chart-wrap { position: relative; min-height: 220px; }
.partnerhub-chart-fallback { display: grid; min-height: 220px; place-items: center; padding: 1rem; color: var(--erp-color-text-muted); text-align: center; background: var(--erp-color-bg); border-radius: var(--erp-radius-sm); }
.partnerhub-dashboard .erp-table-wrap { overflow-x: auto; }
.partnerhub-dashboard .table { min-width: 560px; }

@media (max-width: 1100px) {
    .partnerhub-grid-3 { grid-template-columns: 1fr; }
    .partnerhub-grid-2 { grid-template-columns: 1fr; }
    .partnerhub-hero { grid-template-columns: 1fr; }
}

.partnerhub-category-legend {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.partnerhub-category-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.partnerhub-category-legend strong {
    margin-left: auto;
}

.partnerhub-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ALAKAL Insights card -------------------------------------------------- */
.partnerhub-insights-card .erp-card-header {
    background: linear-gradient(120deg, var(--erp-color-graphite), var(--erp-color-navy-deep));
    border-bottom: none;
}

.partnerhub-insights-card .erp-card-title {
    color: #fff;
}

.partnerhub-insights-card .erp-card-title i {
    margin-right: 0.4rem;
    color: var(--erp-color-primary-light);
}

.partnerhub-block-btn {
    display: block;
    margin-top: 0.75rem;
    text-align: center;
}

.partnerhub-insight-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.partnerhub-insight-item {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--erp-radius-sm);
    font-size: 0.86rem;
    line-height: 1.35;
    background: #f8fafc;
}

.partnerhub-insight-item i {
    margin-top: 0.15rem;
}

.partnerhub-insight-item a {
    color: inherit;
    text-decoration: none;
}

.partnerhub-insight-item a:hover,
.partnerhub-insight-item a:focus-visible {
    text-decoration: underline;
}

.partnerhub-insight-info { background: #eff6ff; color: #1d4ed8; }
.partnerhub-insight-info i { color: #2563eb; }
.partnerhub-insight-success { background: #ecfdf5; color: #047857; }
.partnerhub-insight-success i { color: #10b981; }
.partnerhub-insight-warning { background: #fffbeb; color: #92400e; }
.partnerhub-insight-warning i { color: #f97316; }
.partnerhub-insight-danger { background: #fef2f2; color: #991b1b; }
.partnerhub-insight-danger i { color: #ef4444; }

/* Disabled quick-action buttons (feature not yet implemented) ---------- */
.erp-btn.is-disabled {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: not-allowed;
    opacity: 0.55;
    background: #f1f5f9;
    color: var(--erp-color-text-muted);
    border-color: var(--erp-color-border);
}

.partnerhub-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.65rem;
}

.partnerhub-quick-actions .erp-btn {
    justify-content: center;
}

/* Partners pages -------------------------------------------------------- */
.partnerhub-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

/* Tabs (partner detail page and future tabbed screens) --------------------
   Generic on purpose - [role="tablist"] / [data-partnerhub-tab] /
   [data-partnerhub-panel] so any other page can reuse the same JS
   controller instead of a new one being written per screen. */
.partnerhub-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid var(--erp-color-border);
}

.partnerhub-tab {
    min-height: 44px;
    padding: 0.55rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--erp-color-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.partnerhub-tab:hover {
    color: var(--erp-color-text);
}

.partnerhub-tab.is-active {
    color: var(--erp-color-primary);
    border-bottom-color: var(--erp-color-primary);
}

.partnerhub-tab:focus-visible {
    outline: 2px solid var(--erp-color-primary);
    outline-offset: -2px;
}

.partnerhub-tab-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.partnerhub-tab-panel[hidden] {
    display: none;
}

.partnerhub-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0;
    border: none;
}

.partnerhub-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.partnerhub-form-grid .erp-filter-item {
    flex: 1 1 220px;
}

.partnerhub-form-grid label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--erp-color-text-muted);
    text-transform: uppercase;
}

.partnerhub-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* Products page ---------------------------------------------------------- */
.partnerhub-side-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.partnerhub-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.partnerhub-media-item {
    position: relative;
    border: 1px solid var(--erp-color-border);
    border-radius: var(--erp-radius-sm);
    overflow: hidden;
    text-align: center;
}

.partnerhub-media-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}

.partnerhub-media-item form {
    position: absolute;
    top: 2px;
    right: 2px;
}

.partnerhub-media-item .erp-btn {
    padding: 0.15rem 0.4rem;
    min-height: auto;
    background: rgba(255, 255, 255, 0.9);
}

.partnerhub-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.partnerhub-inline-form .erp-input {
    flex: 1 1 160px;
}

.partnerhub-movement-list {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--erp-color-text-muted);
}

/* Portal mobile app shell -------------------------------------------------
   The desktop topbar lives in _portal_head.tpl's own inline <style> block
   (it needs to be self-contained there); the mobile override has to live in
   that same inline block too; see .ph-portal-topbar in _portal_head.tpl -
   an external stylesheet rule of equal specificity loses to it by source
   order otherwise. */

.ph-mobile-header {
    display: none;
}

@media (max-width: 767px) {
    .ph-mobile-header {
        display: flex;
        align-items: center;
        padding: 0.85rem 1.1rem;
        background: linear-gradient(135deg, #071621, #123f63);
        color: #fff;
    }
}

.ph-mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    text-decoration: none;
}

.ph-mobile-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--erp-color-primary-light);
    font-size: 1.05rem;
}

.ph-mobile-logo svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ph-mobile-brand strong {
    display: block;
    font-size: 0.95rem;
}

.ph-mobile-brand small {
    display: block;
    color: rgba(232, 238, 252, 0.72);
    font-size: 0.72rem;
}

body.ph-has-portal-shell {
    padding-bottom: 0;
}

@media (max-width: 767px) {
    body.ph-has-portal-shell {
        padding-bottom: 68px;
    }
}

.ph-bottom-nav {
    display: none;
}

@media (max-width: 767px) {
    .ph-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        display: flex;
        align-items: stretch;
        background: var(--erp-color-surface);
        border-top: 1px solid var(--erp-color-border);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
}

.ph-bottom-nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 4px 8px;
    color: var(--erp-color-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
    border: none;
    background: none;
}

.ph-bottom-nav-link::-webkit-details-marker {
    display: none;
}

.ph-bottom-nav-link svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ph-bottom-nav-link.is-active {
    color: var(--erp-color-primary);
}

.ph-bottom-nav-more {
    flex: 1;
    position: relative;
}

.ph-bottom-nav-more[open] > summary.ph-bottom-nav-link {
    color: var(--erp-color-primary);
}

.ph-bottom-nav-sheet {
    position: absolute;
    right: 4px;
    bottom: calc(100% + 8px);
    display: flex;
    flex-direction: column;
    min-width: 220px;
    padding: 0.4rem;
    border-radius: var(--erp-radius-md);
    background: var(--erp-color-surface);
    border: 1px solid var(--erp-color-border);
    box-shadow: var(--erp-shadow-md);
}

.ph-bottom-nav-sheet a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.7rem;
    border-radius: var(--erp-radius-sm);
    color: var(--erp-color-text);
    font-size: 0.85rem;
    font-weight: 650;
    text-decoration: none;
}

.ph-bottom-nav-sheet a:hover,
.ph-bottom-nav-sheet a:focus-visible {
    background: var(--erp-color-bg);
}

.ph-bottom-nav-sheet a svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ph-bottom-nav-sheet-logout {
    color: var(--erp-color-danger);
}

/* Portal dashboard --------------------------------------------------------- */
.partnerhub-portal-kpi-grid .erp-kpi-col {
    grid-column: span 12;
}

@media (min-width: 560px) {
    .partnerhub-portal-kpi-grid .erp-kpi-col { grid-column: span 6; }
}

@media (min-width: 900px) {
    .partnerhub-portal-kpi-grid .erp-kpi-col { grid-column: span 3; }
}

.partnerhub-secondary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.partnerhub-secondary-stats > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--erp-radius-sm);
    background: var(--erp-color-surface);
    border: 1px solid var(--erp-color-border);
    font-size: 0.85rem;
}

.partnerhub-secondary-stats span {
    color: var(--erp-color-text-muted);
}

.partnerhub-recent-orders {
    margin: 0;
    padding: 0;
    list-style: none;
}

.partnerhub-recent-orders li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--erp-color-border);
}

.partnerhub-recent-orders li:last-child {
    border-bottom: none;
}

.partnerhub-recent-order-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.partnerhub-recent-order-main strong {
    font-size: 0.9rem;
}

.partnerhub-recent-order-main span {
    color: var(--erp-color-text-muted);
    font-size: 0.8rem;
}

.partnerhub-recent-order-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.partnerhub-recent-order-side strong {
    font-size: 0.85rem;
}

/* Portal products page ----------------------------------------------------- */
/* !important: these gate visibility across viewport widths and must win
   over any later same-specificity component rule (e.g. .partnerhub-product-
   cards's own `display: flex`) regardless of source order. */
.partnerhub-desktop-only {
    display: block !important;
}

.partnerhub-mobile-only {
    display: none !important;
}

@media (max-width: 767px) {
    .partnerhub-desktop-only { display: none !important; }
    .partnerhub-mobile-only { display: flex !important; }
    .partnerhub-add-product-link { display: none !important; }
}

.partnerhub-product-tabs,
.partnerhub-tabs {
    display: flex;
    gap: 0.4rem;
    margin: 0 0 0.85rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.partnerhub-product-tabs a,
.partnerhub-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: none;
    padding: 0.5rem 0.9rem;
    border-radius: var(--erp-radius-pill);
    background: var(--erp-color-surface);
    border: 1px solid var(--erp-color-border);
    color: var(--erp-color-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.partnerhub-product-tabs a span,
.partnerhub-tabs a span {
    padding: 0.05rem 0.4rem;
    border-radius: var(--erp-radius-pill);
    background: var(--erp-color-bg);
    font-size: 0.75rem;
}

.partnerhub-product-tabs a.is-active,
.partnerhub-tabs a.is-active {
    background: var(--erp-color-primary);
    border-color: var(--erp-color-primary);
    color: #fff;
}

.partnerhub-product-tabs a.is-active span,
.partnerhub-tabs a.is-active span {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.partnerhub-product-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.partnerhub-product-search-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.85rem;
    border-radius: var(--erp-radius-sm);
    background: var(--erp-color-surface);
    border: 1px solid var(--erp-color-border);
}

.partnerhub-product-search-field svg {
    width: 17px;
    height: 17px;
    flex: none;
    fill: none;
    stroke: var(--erp-color-text-muted);
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.partnerhub-product-search-field input {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0;
    border: none;
    background: none;
    font: inherit;
    color: var(--erp-color-text);
}

.partnerhub-product-search-field input:focus {
    outline: none;
}

.partnerhub-product-cards {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.partnerhub-product-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.7rem;
    border-radius: var(--erp-radius-md);
    background: var(--erp-color-surface);
    border: 1px solid var(--erp-color-border);
    text-decoration: none;
    color: inherit;
}

.partnerhub-product-card-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: var(--erp-radius-sm);
    background: var(--erp-color-bg);
    overflow: hidden;
}

.partnerhub-product-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.partnerhub-product-card-thumb svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: var(--erp-color-text-muted);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.partnerhub-product-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.partnerhub-product-card-body strong {
    font-size: 0.92rem;
    color: var(--erp-color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.partnerhub-product-card-body > span {
    color: var(--erp-color-text-muted);
    font-size: 0.78rem;
}

.partnerhub-product-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.partnerhub-fab {
    position: fixed;
    right: 18px;
    bottom: calc(68px + env(safe-area-inset-bottom, 0) + 16px);
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--erp-color-primary), var(--erp-color-indigo));
    color: #fff;
    box-shadow: 0 14px 28px rgba(7, 159, 218, 0.38);
    text-decoration: none;
}

.partnerhub-fab svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

/* Operational pages: consistent spacing, readable forms and clear next actions. */
.partnerhub-eyebrow { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; color: var(--erp-color-text-muted); margin-bottom: .45rem; }
.partnerhub-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.partnerhub-section-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.partnerhub-section-heading > span { font-size: .8rem; color: var(--erp-color-text-muted); }
.partnerhub-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.partnerhub-action-card { display: grid; grid-template-columns: 1fr auto; gap: .4rem; padding: 1.15rem; border: 1px solid var(--erp-color-border, #dce5ee); border-radius: 14px; background: var(--erp-color-surface, #fff); color: var(--erp-color-text, #172b42); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.partnerhub-action-card:hover { border-color: var(--erp-color-primary); box-shadow: 0 5px 18px rgba(7, 64, 99, .09); text-decoration: none; }
.partnerhub-action-card:focus-visible { outline: 3px solid var(--erp-color-primary); outline-offset: 3px; }
.partnerhub-action-icon { color: var(--erp-color-primary); font-size: 1.1rem; }
.partnerhub-action-card strong { font-size: 1.6rem; line-height: 1; }
.partnerhub-action-card > span:not(.partnerhub-action-icon), .partnerhub-action-card small { grid-column: 1 / -1; }
.partnerhub-action-card > span:not(.partnerhub-action-icon) { font-weight: 600; }
.partnerhub-action-card small { color: var(--erp-color-text-muted); line-height: 1.5; }
.partnerhub-order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.partnerhub-order-summary { position: sticky; top: 85px; }
.partnerhub-order-summary label, .partnerhub-order-line label { display: block; font-size: .82rem; font-weight: 600; margin: .8rem 0 .4rem; }
.partnerhub-order-summary .erp-input, .partnerhub-order-summary .erp-select { width: 100%; }
.partnerhub-order-total { font-size: 1.8rem; font-weight: 750; margin: .4rem 0; color: var(--erp-color-primary); overflow-wrap: anywhere; }
.partnerhub-step { display: inline-flex; width: 26px; height: 26px; justify-content: center; align-items: center; margin-right: .4rem; border-radius: 8px; color: var(--erp-color-primary); background: #eaf5fc; font-size: .8rem; }
.partnerhub-order-line { display: grid; grid-template-columns: minmax(0, 1fr) 100px 40px; gap: .75rem; align-items: start; padding: 0 0 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--erp-color-border, #e1e8f0); }
.partnerhub-order-line .erp-input, .partnerhub-order-line .erp-select { width: 100%; min-width: 0; }
.partnerhub-order-line .erp-select { margin-top: .5rem; }
.partnerhub-order-line > button { margin-top: 2.1rem; justify-content: center; padding: .55rem; }
.partnerhub-order-line small { display: block; margin-top: .35rem; min-height: 1.2em; color: var(--erp-color-text-muted); }
.partnerhub-order-line [data-total] { display: block; font-size: .75rem; margin-top: .65rem; }
.partnerhub-notice { border: 1px solid #c9e2f1; background: #f0f8fc; color: #244b66; border-radius: 12px; padding: 1rem; font-size: .85rem; line-height: 1.6; margin: 1rem 0; }
.partnerhub-notice p:last-child, .partnerhub-notice ul:last-child { margin-bottom: 0; }
.partnerhub-notice--error { color: #8e2424; background: #fff4f3; border-color: #f1c5c0; }
@media (max-width: 1100px) { .partnerhub-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .partnerhub-order-layout { grid-template-columns: minmax(0, 1fr); } .partnerhub-order-summary { position: static; } }
@media (max-width: 575px) { .partnerhub-action-grid { gap: .6rem; } .partnerhub-action-card { padding: .85rem; } .partnerhub-section-heading { align-items: start; flex-direction: column; } .partnerhub-order-line { grid-template-columns: minmax(0, 1fr) 44px; } .partnerhub-order-product { grid-column: 1 / -1; } .partnerhub-order-line > button { margin-top: 2rem; } }
.partnerhub-order-layout .partnerhub-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.partnerhub-order-layout .partnerhub-form-grid .erp-input { width: 100%; }
.partnerhub-order-layout .partnerhub-form-grid > div { min-width: 0; }
.partnerhub-order-summary #ph-save-order { width: 100%; justify-content: center; }
@media (max-width: 575px) { .partnerhub-order-layout .partnerhub-form-grid { grid-template-columns: minmax(0, 1fr); } }

.partnerhub-calendar-toolbar, .partnerhub-calendar-month { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.partnerhub-calendar-month .erp-card-title { min-width:11rem; text-align:center; }
.partnerhub-calendar-summary { display:flex; flex-wrap:wrap; gap:.75rem 2rem; color:var(--erp-color-text-muted); font-size:.85rem; }
.partnerhub-calendar-summary strong { color:var(--erp-color-text); font-size:1.2rem; margin-right:.25rem; }
.partnerhub-agenda-day { display:grid; grid-template-columns:110px minmax(0,1fr); gap:1rem; padding:1rem 0; border-top:1px solid var(--erp-color-border,#e1e8f0); }
.partnerhub-agenda-day h3 { font-size:.9rem; margin:.75rem 0; }
.partnerhub-agenda-posts { display:grid; gap:.65rem; }
.partnerhub-agenda-post { display:flex; align-items:center; gap:1rem; padding:1rem; border:1px solid var(--erp-color-border,#e1e8f0); border-radius:12px; color:var(--erp-color-text); text-decoration:none; }
.partnerhub-agenda-post:hover { border-color:var(--erp-color-primary); text-decoration:none; }
.partnerhub-agenda-post:focus-visible { outline:2px solid var(--erp-color-primary); outline-offset:2px; }
.partnerhub-agenda-post time { color:var(--erp-color-primary); font-weight:700; }
.partnerhub-agenda-post > div { min-width:0; flex:1; overflow-wrap:anywhere; }
.partnerhub-agenda-post strong, .partnerhub-agenda-post small, .partnerhub-agenda-post div > span { display:block; }
.partnerhub-agenda-post small, .partnerhub-agenda-post div > span { color:var(--erp-color-text-muted); font-size:.8rem; margin-top:.2rem; }
.partnerhub-plan-actions { display:flex; flex-wrap:wrap; gap:1.5rem; align-items:center; justify-content:space-between; }
.partnerhub-plan-actions label { display:block; font-weight:600; margin-bottom:.5rem; }
.partnerhub-plan-actions small { display:block; color:var(--erp-color-text-muted); margin-top:.5rem; }
.ph-logout-form { margin:0; }
.ph-logout-form button { border:0; background:transparent; color:#fca5a5; font:inherit; font-weight:600; cursor:pointer; }
.ph-portal-topbar .ph-logout-form button { font-size:.88rem; padding:0; }
.ph-bottom-nav-sheet .ph-logout-form button { display:flex; align-items:center; gap:.75rem; padding:.85rem 1rem; width:100%; color:#b42318; }
.ph-bottom-nav-sheet .ph-logout-form svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; }
.ph-logout-form button:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
@media(max-width:575px) { .partnerhub-agenda-day { grid-template-columns:minmax(0,1fr); gap:.3rem; } .partnerhub-agenda-post { flex-wrap:wrap; gap:.6rem; } .partnerhub-calendar-month { gap:.4rem; } .partnerhub-calendar-month .erp-card-title { min-width:0; } }

/* Standalone portal tables do not inherit Bootstrap's table foundations. */
.ph-has-portal-shell .erp-table-wrap table { width: 100%; border-collapse: collapse; }
.ph-has-portal-shell .erp-table-wrap td,
.ph-has-portal-shell .erp-table-wrap th { padding: 1rem; text-align: left; vertical-align: middle; }
.ph-has-portal-shell .erp-table-wrap tbody tr + tr { border-top: 1px solid var(--erp-color-border); }
.ph-has-portal-shell .erp-table-wrap td { overflow-wrap: anywhere; }
.ph-has-portal-shell .partnerhub-pagination { flex-wrap: wrap; }
@media (max-width: 767px) {
    .ph-has-portal-shell .erp-table-wrap .ph-portal-records { min-width: 0; display: block; }
    .ph-portal-records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .ph-portal-records tbody { display: block; }
    .ph-portal-records tbody tr { display: block; padding: .75rem 1rem; }
    .ph-has-portal-shell .ph-portal-records td { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; gap: .75rem; padding: .5rem 0; border: 0; text-align: right; }
    .ph-portal-records td::before { content: attr(data-label); color: var(--erp-color-text-muted, #64748b); font-size: .8rem; font-weight: 600; text-align: left; }
    .ph-portal-records td .erp-badge { justify-self: end; max-width: 100%; white-space: normal; }
}
.ph-has-portal-shell .erp-page-title { margin-bottom: .5rem; }
.ph-has-portal-shell .erp-page-subtitle { margin: 0 0 1.25rem; line-height: 1.6; }
@media (min-width: 768px) {
    .ph-portal-records td:first-child { min-width: 10rem; }
    .ph-portal-records td[data-label="Montant (vos produits)"] { min-width: 11rem; white-space: nowrap; }
}

.partnerhub-social-preview-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; margin-bottom: 1.25rem; max-width: 900px; }
.partnerhub-social-preview-images img { display: block; width: 100%; height: 260px; object-fit: contain; background: #f1f5f9; border: 1px solid var(--erp-color-border); border-radius: 12px; }

/* Social Commerce: content library and publication preview. */
.ph-social-heading { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:28px; margin-bottom:24px; border:1px solid #d7e6ef; border-radius:20px; background:linear-gradient(120deg,#f0f8fc,#fff); }
.ph-social-eyebrow { display:block; margin-bottom:10px; font-size:11px; font-weight:750; letter-spacing:.12em; color:#316b87; }
.ph-social-heading .erp-page-title { margin:0 0 10px; font-size:30px; letter-spacing:-.035em; }
.ph-social-heading .erp-page-subtitle { margin:0; line-height:1.6; }
.ph-social-heading-actions { display:flex; gap:10px; flex-wrap:wrap; flex-shrink:0; }
.ph-social-studio .erp-filter-bar { padding:18px; background:white; border:1px solid #e0e7ee; border-radius:14px; align-items:flex-end; gap:12px; }
.ph-social-studio .erp-filter-item { min-width:160px; }
.ph-social-results { margin:28px 0 18px; }
.ph-social-results h2 { font-size:18px; font-weight:750; margin:0 0 6px; }
.ph-social-results h2 span { display:inline-block; font-size:12px; padding:4px 9px; border-radius:20px; background:#e5f1f7; color:#28617d; vertical-align:middle; }
.ph-social-results p { color:#64748b; font-size:13px; margin:0; }
.ph-social-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.ph-social-card { min-width:0; display:flex; flex-direction:column; padding:22px; border:1px solid #dfe7ef; border-radius:18px; background:white; box-shadow:0 4px 15px #153f6010; }
.ph-social-card-top { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-bottom:22px; }
.ph-social-network { display:flex; align-items:center; gap:9px; font-size:13px; font-weight:700; }
.ph-social-network-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:10px; background:#edf3fa; color:#315779; font-size:20px; }
.ph-social-network-facebook { background:#e9f1ff; color:#1769d2; }
.ph-social-network-instagram { background:#fcecf5; color:#b72d72; }
.ph-social-network-whatsapp { background:#e8f7ee; color:#187c48; font-size:15px; }
.ph-social-card h3 { font-size:17px; line-height:1.45; margin:0 0 12px; font-weight:750; overflow-wrap:anywhere; }
.ph-social-excerpt { font-size:13px; color:#596b7e; line-height:1.75; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; margin:0 0 24px; }
.ph-social-card-meta { margin-top:auto; padding-bottom:18px; overflow-wrap:anywhere; }
.ph-social-card-meta span,.ph-social-card-footer span:not(.erp-btn span) { display:block; font-size:11px; color:#64748b; margin-bottom:5px; }
.ph-social-card-meta strong { font-size:12px; font-weight:500; }
.ph-social-card-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; border-top:1px solid #edf1f5; padding-top:16px; }
.ph-social-card-footer strong { font-size:12px; }
.ph-social-card a:focus-visible,.ph-social-heading a:focus-visible { outline:3px solid #3aa7d9; outline-offset:4px; }
.ph-social-detail .erp-card { border-radius:18px; overflow:hidden; }
.ph-social-detail .partnerhub-notice { padding:18px 22px; border-left:4px solid #459fc4; border-radius:12px; }
.ph-social-detail .partnerhub-notice p { margin-bottom:0; }
.ph-social-content-preview .erp-card-body { max-width:850px; padding:28px; line-height:1.8; overflow-wrap:anywhere; }
.ph-social-content-preview .erp-card-body > p strong { font-size:20px; }
@media(max-width:1200px) { .ph-social-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .ph-social-heading { align-items:flex-start; flex-direction:column; } }
@media(max-width:600px) { .ph-social-grid { grid-template-columns:minmax(0,1fr); } .ph-social-heading { padding:22px 18px; } .ph-social-heading .erp-page-title { font-size:26px; } .ph-social-card { padding:20px; } .ph-social-heading-actions { width:100%; } .ph-social-heading-actions .erp-btn { flex:1; justify-content:center; } .ph-social-studio .erp-filter-item { min-width:0; flex:1 1 100%; } .ph-social-content-preview .erp-card-body { padding:20px; } }
