/* ==========================================================================
   Sector 10 — "Gender, Health & Nutrition" (DHS) flagship skin
   --------------------------------------------------------------------------
   The sector renders through the shared grouped-dashboard factory with
   premiumUX enabled (rich HTML tooltips, gradient bars, spotlight hover,
   morph transitions, filter chips, persistent smart search). Every rule is
   scoped to #sectorTenView so the other five factory sectors keep the
   baseline look from public-dashboard-12-trade-business.css.
   ========================================================================== */

/* Hide the generic dashboard chrome when the sector-10 view is active. */
/* sector chrome consolidated in core bundle */

/* --------------------------------------------------------------------------
   1. Cards — elevation, rhythm, hover
   -------------------------------------------------------------------------- */

#sectorTenView .ec-panel {
    position: relative;
    border: 1px solid #dce5f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.06);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

#sectorTenView .ec-panel:hover {
    transform: translateY(-2px);
    border-color: rgba(45, 81, 161, 0.28);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06), 0 20px 40px rgba(45, 81, 161, 0.10);
}

#sectorTenView .ec-panel-head {
    border-bottom: 0;
    padding-bottom: 4px;
}

#sectorTenView .ec-card-title {
    font-family: "Outfit", "Source Sans 3", sans-serif;
    letter-spacing: -0.005em;
}

#sectorTenView mark.ec-hit {
    padding: 0 1px;
    border-radius: 3px;
    background: rgba(51, 167, 223, 0.28);
    color: inherit;
}

/* Insight callout: calm left-accent note under the title. */
#sectorTenView .ec-insight {
    border-left: 3px solid rgba(51, 167, 223, 0.55);
    border-radius: 0 8px 8px 0;
    background: rgba(51, 167, 223, 0.07);
    padding: 8px 12px;
}

/* --------------------------------------------------------------------------
   2. Toolbar — icon buttons, segmented toggles, selects
   -------------------------------------------------------------------------- */

#sectorTenView .ec-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #5e6672;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

#sectorTenView .ec-icon-btn:hover {
    background: rgba(45, 81, 161, 0.08);
    border-color: rgba(45, 81, 161, 0.18);
    color: #2d51a1;
}

#sectorTenView .ec-icon-btn:focus-visible,
#sectorTenView .ec-seg-btn:focus-visible,
#sectorTenView .ec-ctl select:focus-visible,
#sectorTenView .ec-chip:focus-visible,
#sectorTenView .ec-search:focus-visible,
#sectorTenView .ec-search-clear:focus-visible,
#sectorTenView .ec-empty-clear:focus-visible {
    outline: 2px solid #2d51a1;
    outline-offset: 2px;
}

#sectorTenView .ec-icon-btn svg {
    width: 16px;
    height: 16px;
}

#sectorTenView .ec-seg-btn {
    border-radius: 999px;
    transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

#sectorTenView .ec-seg-btn.is-active {
    box-shadow: 0 1px 3px rgba(45, 81, 161, 0.25);
}

#sectorTenView .ec-ctl select {
    appearance: none;
    padding-right: 26px;
    border-radius: 9px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235e6672' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 13px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

#sectorTenView .ec-ctl select:hover {
    border-color: rgba(45, 81, 161, 0.4);
}

/* --------------------------------------------------------------------------
   3. Active-filter chips
   -------------------------------------------------------------------------- */

#sectorTenView .ec-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 10px;
}

#sectorTenView .ec-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 2px 8px 2px 10px;
    border: 1px solid rgba(45, 81, 161, 0.28);
    border-radius: 999px;
    background: rgba(45, 81, 161, 0.07);
    color: #2d51a1;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}

#sectorTenView .ec-chip:hover {
    background: rgba(45, 81, 161, 0.14);
    border-color: rgba(45, 81, 161, 0.45);
}

#sectorTenView .ec-chip-x {
    display: inline-flex;
    width: 12px;
    height: 12px;
}

#sectorTenView .ec-chip-x svg {
    width: 100%;
    height: 100%;
}

/* --------------------------------------------------------------------------
   4. Chart frame — the "canvas well" + premium HTML tooltip
   -------------------------------------------------------------------------- */

#sectorTenView .ec-chart-frame {
    position: relative;
    border: 1px solid #e3ecf6;
    border-radius: 14px;
    background: linear-gradient(180deg, #fdfeff 0%, #f7fbff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 10px;
}

#sectorTenView .ec-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 6;
    min-width: 150px;
    max-width: 260px;
    padding: 10px 12px;
    border: 1px solid rgba(45, 81, 161, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.10), 0 16px 34px rgba(15, 23, 42, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
    font-family: "Source Sans 3", sans-serif;
}

#sectorTenView .ec-tooltip-title {
    margin-bottom: 6px;
    color: #2d51a1;
    font-family: "Outfit", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
}

#sectorTenView .ec-tooltip-rows {
    display: grid;
    gap: 4px;
}

#sectorTenView .ec-tooltip-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.74rem;
    color: #475569;
}

#sectorTenView .ec-tooltip-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2d51a1;
}

#sectorTenView .ec-tooltip-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#sectorTenView .ec-tooltip-value {
    margin-left: auto;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

#sectorTenView .ec-tooltip-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid #e6edf5;
    font-size: 0.68rem;
}

#sectorTenView .ec-tooltip-gap {
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(45, 81, 161, 0.10);
    color: #2d51a1;
    font-weight: 700;
}

#sectorTenView .ec-tooltip-vs {
    color: #5e6672;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   5. Search — icon box, clear button, live result caption
   -------------------------------------------------------------------------- */

#sectorTenView .ec-search-wrap {
    position: relative;
    flex: 1 1 240px;
    min-width: 190px;
    display: inline-flex;
    align-items: center;
}

#sectorTenView .ec-search-icon {
    position: absolute;
    left: 11px;
    width: 15px;
    height: 15px;
    color: #8a97a8;
    pointer-events: none;
}

#sectorTenView .ec-search {
    width: 100%;
    min-height: 38px;
    padding: 0 32px 0 34px;
    border: 1px solid #d9e3ea;
    border-radius: 999px;
    background: #ffffff;
    font-size: 0.8rem;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

#sectorTenView .ec-search:hover {
    border-color: rgba(45, 81, 161, 0.35);
}

#sectorTenView .ec-search:focus-visible {
    outline: none;
    border-color: #2d51a1;
    box-shadow: 0 0 0 3px rgba(45, 81, 161, 0.16);
}

#sectorTenView .ec-search-clear {
    position: absolute;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: rgba(94, 102, 114, 0.12);
    color: #5e6672;
    cursor: pointer;
}

#sectorTenView .ec-search-clear:hover {
    background: rgba(45, 81, 161, 0.16);
    color: #2d51a1;
}

#sectorTenView .ec-search-clear svg {
    width: 11px;
    height: 11px;
}

#sectorTenView .ec-search-meta {
    flex: none;
    color: #5e6672;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Tab badges flip to match counts while searching. */
#sectorTenView .ec-tab-badge.is-filtered {
    background: #2d51a1;
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   6. Empty states, provenance footer, screen-reader live region
   -------------------------------------------------------------------------- */

#sectorTenView .ec-empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 34px 20px;
    border: 1px dashed #c9d8e8;
    border-radius: 14px;
    background: #f8fbff;
    color: #5e6672;
    text-align: center;
}

#sectorTenView .ec-empty strong {
    color: #2d51a1;
    font-family: "Outfit", sans-serif;
}

#sectorTenView .ec-empty p {
    margin: 0;
    font-size: 0.8rem;
}

#sectorTenView .ec-empty-clear {
    margin-top: 6px;
    min-height: 32px;
    padding: 0 16px;
    border: 1px solid rgba(45, 81, 161, 0.35);
    border-radius: 999px;
    background: #ffffff;
    color: #2d51a1;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}

#sectorTenView .ec-empty-clear:hover {
    background: rgba(45, 81, 161, 0.08);
    border-color: #2d51a1;
}

#sectorTenView .ec-unavailable .ec-empty-clear {
    align-self: center;
}

/* Provenance footer: the shared icon-led chip + the unit, on one line. */
#sectorTenView .ec-card-provenance {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
}

#sectorTenView .ec-card-provenance .card-source {
    flex: 1 1 auto;
    min-width: 0;
}

#sectorTenView .ec-card-unit {
    flex: none;
    color: #8a97a8;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

#sectorTenView .ec-sr-live {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   7. Motion safety + small screens
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    #sectorTenView .ec-panel,
    #sectorTenView .ec-tooltip,
    #sectorTenView .ec-icon-btn,
    #sectorTenView .ec-seg-btn,
    #sectorTenView .ec-chip,
    #sectorTenView .ec-search,
    #sectorTenView .ec-ctl select {
        transition: none;
    }

    #sectorTenView .ec-panel:hover {
        transform: none;
    }
}

@media (max-width: 640px) {
    #sectorTenView .ec-search-wrap {
        flex-basis: 100%;
    }

    #sectorTenView .ec-chart-frame {
        padding: 6px;
    }

    #sectorTenView .ec-tooltip {
        max-width: 210px;
    }
}
