/* =========================================================
   247ChatMate — Dashboard layout CSS ownership split
   Phase 5-A-20H-2
   Checkpoint target: DASHBOARDLAYOUTCSSSPLIT5A20H2LOCK

   Purpose:
   - Establish a dedicated owner file for Dashboard / Client View layout rules.
   - First pass is intentionally non-destructive: rules are mirrored from the
     current late visual safety layer so the existing light/dark output is
     preserved while ownership is introduced.
   - expert-visual-polish.css remains loaded last as the safety net until a
     later QA-backed cleanup removes duplicate legacy overrides.

   Guardrails:
   - No Visitor Buttons changes.
   - No chip/chip-grid/chip-dimension changes.
   - No frontend widget, lead routing, WhatsApp handoff, weekly email,
     licence/trial, registry/lifecycle or save-handler changes.
========================================================= */

/* Dashboard active-panel layout ownership baseline.
   Mirrored from the current approved visual safety layer for stable output. */
.matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-admin-topbar {
    margin-bottom: 10px !important;
}

.matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-value-card {
    isolation: isolate !important;
    overflow: hidden !important;
}

.matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-hero-panel {
    position: relative !important;
    z-index: 3 !important;
    min-width: 0 !important;
    overflow: visible !important;
}

.matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-lead-panel {
    position: relative !important;
    z-index: 1 !important;
    min-width: 0 !important;
    transform: none !important;
    width: 100% !important;
    overflow: visible !important;
}

.matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-setup-panel {
    position: relative !important;
    z-index: 2 !important;
    min-width: 0 !important;
}

.matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-hero-status,
.matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-benefits,
.matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-hero-actions {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-status-pill {
    max-width: 100% !important;
    min-width: 0 !important;
}

@media (min-width: 1181px) {
    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-value-card {
        grid-template-columns: minmax(280px, 300px) minmax(340px, 1fr) minmax(252px, 285px) !important;
        gap: clamp(14px, 1.2vw, 20px) !important;
        padding: clamp(20px, 1.55vw, 26px) !important;
        min-height: clamp(650px, calc(100vh - 205px), 710px) !important;
        align-items: stretch !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-hero-panel,
    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-lead-panel,
    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-setup-panel {
        padding: clamp(18px, 1.35vw, 24px) !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-hero-panel {
        justify-content: space-between !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-benefits {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 10px !important;
        width: 100% !important;
        margin-top: auto !important;
        margin-bottom: 14px !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-benefit {
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-benefit .dashicons {
        width: 36px !important;
        height: 36px !important;
        font-size: 19px !important;
        line-height: 36px !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-benefit strong {
        max-width: 100% !important;
        font-size: clamp(10px, 0.78vw, 11.5px) !important;
        line-height: 1.18 !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-hero-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: 100% !important;
        gap: 10px !important;
        margin-top: 0 !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-primary-button,
    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-secondary-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 42px !important;
        padding-inline: 12px !important;
        white-space: normal !important;
        text-align: center !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-lead-panel {
        align-items: center !important;
        justify-content: flex-start !important;
        padding-top: clamp(20px, 2vh, 30px) !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-circle-header {
        width: 100% !important;
        max-width: 440px !important;
        margin: 0 auto 10px !important;
        padding: 0 !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-circle-view.is-active {
        justify-content: center !important;
        overflow: visible !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-circle-view .matewa-dashboard-radial {
        --matewa-cv-orbit-distance: clamp(120px, 8.35vw, 154px) !important;
        --matewa-cv-orbit-node: clamp(80px, 5.7vw, 98px) !important;
        --matewa-cv-centre-size: clamp(154px, 10.8vw, 194px) !important;
        max-width: min(100%, 455px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        transform: none !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-sidebar-view[data-matewa-circle-sidebar-view="status"] {
        min-height: clamp(540px, calc(100vh - 285px), 600px) !important;
    }
}

@media (min-width: 1321px) and (max-width: 1540px) {
    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-value-card {
        grid-template-columns: minmax(300px, 320px) minmax(390px, 1fr) minmax(270px, 300px) !important;
        gap: clamp(16px, 1.35vw, 22px) !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-circle-view .matewa-dashboard-radial {
        --matewa-cv-orbit-distance: clamp(136px, 9.8vw, 170px) !important;
        --matewa-cv-orbit-node: clamp(90px, 6.3vw, 106px) !important;
        --matewa-cv-centre-size: clamp(174px, 12.2vw, 212px) !important;
        max-width: min(100%, 520px) !important;
    }
}

@media (min-width: 1181px) and (max-width: 1240px) {
    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-value-card {
        grid-template-columns: minmax(260px, 280px) minmax(320px, 1fr) minmax(238px, 260px) !important;
        gap: 12px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-hero-actions {
        gap: 8px !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-circle-view .matewa-dashboard-radial {
        --matewa-cv-orbit-distance: clamp(110px, 8vw, 126px) !important;
        --matewa-cv-orbit-node: clamp(76px, 5.45vw, 86px) !important;
        --matewa-cv-centre-size: clamp(146px, 10.2vw, 168px) !important;
        max-width: min(100%, 380px) !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-benefit strong {
        font-size: 10px !important;
    }
}

@media (max-width: 1180px) {
    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-value-card {
        overflow: visible !important;
    }

    .matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-lead-panel {
        transform: none !important;
        width: 100% !important;
    }
}

.matewa-dashboard-page[data-matewa-active-panel="dashboard"] .matewa-dashboard-radial-center:hover {
    transform: translate(-50%, -50%) !important;
}
