/* Executive Dashboard command-center refinement.
   This layer intentionally changes hierarchy and readability only; analytics,
   authorization and persisted-data semantics remain owned by the existing M11
   backend and dashboard template. */

body:has(.m16-dashboard-view) .m11-dashboard-heading {
    padding-bottom: 2px;
}

body:has(.m16-dashboard-view) .m11-dashboard-heading h1 {
    margin-bottom: 4px;
}

body:has(.m16-dashboard-view) .m11-dashboard-heading .muted {
    max-width: 760px;
    font-size: 12px;
    line-height: 1.5;
}

body:has(.m16-dashboard-view) .m11-dashboard-tabs {
    gap: 4px;
    margin-bottom: 18px;
}

body:has(.m16-dashboard-view) .m11-dashboard-tabs a {
    padding: 10px 12px 11px;
    font-size: 11px;
    font-weight: 800;
}

body:has(.m16-dashboard-view) .m11-dashboard-section {
    margin-bottom: 34px;
}

body:has(.m16-dashboard-view) .m11-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

body:has(.m16-dashboard-view) .m11-section-heading h2 {
    margin-bottom: 2px;
}

body:has(.m16-dashboard-view) .m11-section-heading .muted {
    max-width: 620px;
    font-size: 11px;
    line-height: 1.45;
    text-align: right;
}

/* Primary executive summary: five questions, one row on large screens. */
body:has(.m16-dashboard-view) #overview .m11-kpi-grid-primary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

body:has(.m16-dashboard-view) #overview .m11-kpi[data-command-center-hidden="true"] {
    display: none;
}

body:has(.m16-dashboard-view) #overview .m11-kpi {
    min-height: 104px;
    padding: 13px 14px;
    border-radius: 9px;
    box-shadow: 0 3px 12px rgba(18, 38, 46, .055);
}

body:has(.m16-dashboard-view) #overview .m11-kpi[data-command-center-target] {
    cursor: pointer;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

body:has(.m16-dashboard-view) #overview .m11-kpi[data-command-center-target]:hover,
body:has(.m16-dashboard-view) #overview .m11-kpi[data-command-center-target]:focus-visible {
    transform: translateY(-1px);
    border-color: #b8d9d3;
    box-shadow: 0 6px 18px rgba(18, 38, 46, .085);
    outline: none;
}

body:has(.m16-dashboard-view) #overview .m11-kpi span {
    font-size: 10px;
    line-height: 1.25;
}

body:has(.m16-dashboard-view) #overview .m11-kpi strong {
    margin: 7px 0 5px;
    font-size: 29px;
    line-height: 1;
}

body:has(.m16-dashboard-view) #overview .m11-kpi small {
    font-size: 10px;
    line-height: 1.4;
}

/* Make the promoted attention queue feel like the first operational decision surface. */
body:has(.m16-dashboard-view) .m11-overview-attention {
    margin: 0 0 12px;
    border-top: 3px solid var(--dq-escalation);
}

body:has(.m16-dashboard-view) .m11-overview-attention .widget-heading {
    padding-bottom: 10px;
}

body:has(.m16-dashboard-view) .m11-overview-attention .widget-kicker::after {
    content: " · act first";
    color: var(--dq-escalation);
}

/* Improve dashboard typography without sacrificing board density elsewhere. */
body:has(.m16-dashboard-view) .dashboard-widget .widget-kicker {
    font-size: 10px;
    letter-spacing: .045em;
}

body:has(.m16-dashboard-view) .dashboard-widget .widget-heading h2 {
    font-size: 15px;
}

body:has(.m16-dashboard-view) .dashboard-widget .widget-caption {
    font-size: 10px;
}

body:has(.m16-dashboard-view) .m11-dashboard-table th {
    padding: 9px 10px;
    font-size: 9px;
    letter-spacing: .04em;
}

body:has(.m16-dashboard-view) .m11-dashboard-table td {
    padding: 9px 10px;
    font-size: 11px;
    line-height: 1.35;
}

body:has(.m16-dashboard-view) .m11-dashboard-table td small {
    margin-top: 2px;
    font-size: 9px;
}

body:has(.m16-dashboard-view) .m11-state-tag,
body:has(.m16-dashboard-view) .m11-inline-progress b {
    font-size: 9px;
}

body:has(.m16-dashboard-view) .m11-chart-legend span,
body:has(.m16-dashboard-view) .m11-ranking-bars > div > span,
body:has(.m16-dashboard-view) .m11-ranking-bars strong,
body:has(.m16-dashboard-view) .m11-comparison-grid span,
body:has(.m16-dashboard-view) .m11-comparison-grid small,
body:has(.m16-dashboard-view) .m11-comparison-grid em,
body:has(.m16-dashboard-view) .m11-big-progress small {
    font-size: 10px;
}

body:has(.m16-dashboard-view) .m11-mini-ranking p strong,
body:has(.m16-dashboard-view) .m11-mini-ranking b,
body:has(.m16-dashboard-view) .m11-active-work-grid p strong,
body:has(.m16-dashboard-view) .m11-exception-list p strong,
body:has(.m16-dashboard-view) .m11-simple-list p strong,
body:has(.m16-dashboard-view) .m11-active-work-grid b {
    font-size: 11px;
}

body:has(.m16-dashboard-view) .m11-mini-ranking p small,
body:has(.m16-dashboard-view) .m11-active-work-grid p small,
body:has(.m16-dashboard-view) .m11-exception-list p small,
body:has(.m16-dashboard-view) .m11-simple-list p small,
body:has(.m16-dashboard-view) .m11-exception-list a > b,
body:has(.m16-dashboard-view) .m11-exception-list em,
body:has(.m16-dashboard-view) .m11-simple-list a > span {
    font-size: 9px;
}

body:has(.m16-dashboard-view) .m11-ranking-bars > div > div {
    height: 14px;
}

body:has(.m16-dashboard-view) .m11-stacked-chart {
    height: 52px;
}

body:has(.m16-dashboard-view) .m11-stacked-chart i {
    font-size: 11px;
}

/* Secondary operational analytics remain available but should not visually
   compete with readiness, status, attention and people signals. */
body:has(.m16-dashboard-view) .m11-secondary-insight {
    opacity: .92;
    border-style: dashed;
}

body:has(.m16-dashboard-view) .m11-secondary-insight .widget-heading::after {
    content: "Secondary analysis";
    margin-left: auto;
    color: var(--dq-muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Visually separate workload facts from quality assessment in the Employee table. */
body:has(.m16-dashboard-view) #employees .m11-dashboard-table th:last-child,
body:has(.m16-dashboard-view) #employees .m11-dashboard-table td:last-child {
    border-left: 2px solid #e6e1f0;
    background: #fcfbfe;
}

body:has(.m16-dashboard-view) #employees .m11-dashboard-table th:last-child {
    color: #725c9a;
}

/* Clear focus treatment for dashboard navigation and command cards. */
body:has(.m16-dashboard-view) .m11-dashboard-tabs a:focus-visible,
body:has(.m16-dashboard-view) .m11-overview-attention a:focus-visible,
body:has(.m16-dashboard-view) .m11-overview-attention button:focus-visible {
    outline: 2px solid rgba(43, 156, 141, .34);
    outline-offset: 2px;
}

@media (max-width: 1380px) {
    body:has(.m16-dashboard-view) #overview .m11-kpi-grid-primary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body:has(.m16-dashboard-view) #overview .m11-kpi-grid-primary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body:has(.m16-dashboard-view) .m11-section-heading {
        display: block;
    }
    body:has(.m16-dashboard-view) .m11-section-heading .muted {
        margin-top: 4px;
        text-align: left;
    }
}

@media (max-width: 560px) {
    body:has(.m16-dashboard-view) #overview .m11-kpi-grid-primary {
        grid-template-columns: 1fr;
    }
}


/* v1.8.5 Overview refinement */
body:has(.m185-overview) .m185-overview-kpis .m11-kpi {
    text-decoration: none;
    color: inherit;
}
body:has(.m185-overview) .m185-kpi-link {
    cursor: pointer;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
body:has(.m185-overview) .m185-kpi-link:hover,
body:has(.m185-overview) .m185-kpi-link:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(18, 38, 46, .10);
    outline: 2px solid rgba(43, 156, 141, .22);
    outline-offset: 2px;
}
body:has(.m185-overview) .m185-kpi-completion {
    border-top-color: var(--dq-green);
    background: linear-gradient(180deg, rgba(43, 156, 141, .08), #fff 58%);
}
body:has(.m185-overview) .m185-kpi-completion span,
body:has(.m185-overview) .m185-kpi-completion strong {
    color: var(--dq-green-dark);
}
body:has(.m185-overview) .m185-kpi-unassigned {
    border-top-color: var(--dq-blue);
}
body:has(.m185-overview) .m185-status-activity-grid {
    margin-top: 2px;
}
body:has(.m185-overview) .m185-client-status-card,
body:has(.m185-overview) .m185-employee-time-card {
    margin-top: 10px;
}
body:has(.m185-overview) .m185-client-chart-scroll,
body:has(.m185-overview) .m185-hours-chart-scroll {
    overflow-x: auto;
    padding: 10px 4px 2px;
}
body:has(.m185-overview) .m185-client-status-bars {
    min-width: 100%;
    min-height: 244px;
    display: flex;
    gap: 12px;
    align-items: end;
}
body:has(.m185-overview) .m185-client-status-column {
    min-width: 74px;
    flex: 1 0 74px;
    display: grid;
    grid-template-rows: 18px 190px 34px;
    gap: 6px;
    align-items: end;
    text-align: center;
}
body:has(.m185-overview) .m185-client-total {
    color: var(--dq-muted);
    font-size: 9px;
    font-weight: 750;
}
body:has(.m185-overview) .m185-client-status-stack {
    width: min(54px, 74%);
    height: 190px;
    margin: 0 auto;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    overflow: visible;
    border-radius: 5px 5px 2px 2px;
    background: #edf0f2;
    box-shadow: inset 0 0 0 1px rgba(18, 38, 46, .05);
}
body:has(.m185-overview) .m185-status-segment {
    position: relative;
    width: 100%;
    min-height: 1px;
    display: block;
    outline: none;
}
body:has(.m185-overview) .m185-status-segment:first-child {
    border-radius: 0 0 2px 2px;
}
body:has(.m185-overview) .m185-status-segment:last-child {
    border-radius: 5px 5px 0 0;
}
body:has(.m185-overview) .m185-status-segment.is-completed { background: var(--dq-status-done); }
body:has(.m185-overview) .m185-status-segment.is-progress { background: var(--dq-status-working); }
body:has(.m185-overview) .m185-status-segment.is-paused { background: var(--dq-status-paused, #806bb3); }
body:has(.m185-overview) .m185-status-segment.is-not-started { background: var(--dq-status-waiting); }
body:has(.m185-overview) .m185-status-segment::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 12;
    left: 50%;
    bottom: calc(100% + 7px);
    transform: translateX(-50%) translateY(3px);
    padding: 5px 7px;
    border-radius: 5px;
    background: #173f4d;
    color: #fff;
    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
}
body:has(.m185-overview) .m185-status-segment:hover::after,
body:has(.m185-overview) .m185-status-segment:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
body:has(.m185-overview) .m185-client-name {
    min-width: 0;
    align-self: start;
    overflow: hidden;
    color: #39464e;
    font-size: 9px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body:has(.m185-overview) .m185-status-legend {
    justify-content: center;
    padding-top: 3px;
}
body:has(.m185-overview) .m11-chart-legend i.is-paused {
    background: var(--dq-status-paused, #806bb3);
}

body:has(.m185-overview) .m185-hours-chart {
    min-width: 720px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
}
body:has(.m185-overview) .m185-hours-axis {
    position: relative;
    height: 224px;
    margin-bottom: 38px;
    color: var(--dq-muted);
    font-size: 9px;
    font-weight: 750;
}
body:has(.m185-overview) .m185-hours-axis span {
    position: absolute;
    right: 0;
    transform: translateY(-50%);
}
body:has(.m185-overview) .m185-hours-axis span:first-child { transform: translateY(0); }
body:has(.m185-overview) .m185-hours-axis span:last-child { transform: translateY(-100%); }
body:has(.m185-overview) .m185-hours-plot {
    position: relative;
    height: 262px;
}
body:has(.m185-overview) .m185-hours-gridlines {
    position: absolute;
    inset: 0 0 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}
body:has(.m185-overview) .m185-hours-gridlines span {
    width: 100%;
    border-top: 1px dashed #dde3e6;
}
body:has(.m185-overview) .m185-employee-bars {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 10px;
}
body:has(.m185-overview) .m185-employee-bar {
    min-width: 72px;
    flex: 1 0 72px;
    display: grid;
    grid-template-rows: 224px 38px;
    text-decoration: none;
    color: inherit;
}
body:has(.m185-overview) .m185-work-bar-area {
    position: relative;
    display: block;
}
body:has(.m185-overview) .m185-work-bar-area i {
    position: absolute;
    left: 27%;
    right: 27%;
    bottom: 0;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, var(--dq-green), var(--dq-green-dark));
    box-shadow: 0 3px 9px rgba(43, 156, 141, .18);
    transition: filter .14s ease, transform .14s ease;
    transform-origin: bottom;
}
body:has(.m185-overview) .m185-work-bar-area small {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: var(--work-pct, 0%);
    transform: translate(-50%, -6px);
    color: #324049;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}
body:has(.m185-overview) .m185-employee-bar:hover i,
body:has(.m185-overview) .m185-employee-bar:focus-visible i {
    filter: brightness(.94);
    transform: scaleX(1.06);
}
body:has(.m185-overview) .m185-employee-bar:focus-visible {
    outline: 2px solid rgba(43, 156, 141, .28);
    outline-offset: 2px;
}
body:has(.m185-overview) .m185-employee-bar.is-over-target i {
    background: linear-gradient(180deg, #dd9d2f, #b97812);
}
body:has(.m185-overview) .m185-employee-bar > strong {
    min-width: 0;
    padding-top: 8px;
    overflow: hidden;
    color: #46535b;
    font-size: 9px;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body:has(.m185-overview) .m185-hours-note {
    margin: 3px 0 0 44px;
    color: var(--dq-muted);
    font-size: 9px;
}
body:has(.m185-overview) .m16-task-explorer {
    margin-top: 10px;
}
@media (max-width: 900px) {
    body:has(.m185-overview) .m185-status-activity-grid {
        grid-template-columns: 1fr;
    }
    body:has(.m185-overview) .m185-status-activity-grid .m11-widget-span-2 {
        grid-column: auto;
    }
}


body:has(.m185-overview) .m185-employee-time-heading {
    align-items: flex-start;
    gap: 16px;
}
body:has(.m185-overview) .m185-work-date-tools {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
body:has(.m185-overview) .m185-work-date-form label {
    display: grid;
    gap: 4px;
    color: var(--dq-muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
body:has(.m185-overview) .m185-work-date-form input[type="date"] {
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid #d7dee2;
    border-radius: 6px;
    background: #fff;
    color: #25343c;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}
body:has(.m185-overview) .m185-work-date-form input[type="date"]:focus {
    border-color: var(--dq-green);
    outline: 2px solid rgba(43, 156, 141, .14);
    outline-offset: 1px;
}
@media (max-width: 720px) {
    body:has(.m185-overview) .m185-work-date-tools {
        width: 100%;
        justify-content: flex-start;
    }
}
