/* Widget surfaces are independent of the desktop wallpaper and main navigation. */
#dashboard-section .dashboard-widget-theme-picker{display:flex;flex-wrap:wrap;gap:8px;flex:1 1 100%;min-width:0;margin:0;padding:10px 0;border:0}
#dashboard-section[data-layout-editing=false] .dashboard-widget-theme-picker{display:none}
#dashboard-section .dashboard-widget-theme-picker legend{font:600 12px Montserrat,sans-serif;color:#785537;margin-bottom:8px}
#dashboard-section>.auth-hint{color:#586979!important}
#dashboard-section .widget-theme-choice{display:grid;gap:5px;position:relative;flex:0 1 126px;color:#1C3A57;font:11px/1.4 Montserrat,sans-serif;cursor:pointer;text-align:left}
#dashboard-section .widget-theme-choice input{position:absolute;top:5px;right:5px;width:16px;height:16px;min-height:0;margin:0;accent-color:#B48C64;z-index:1}
.widget-theme-preview{display:grid;gap:10px;align-content:center;height:68px;border:2px solid #E4D9C8;border-radius:7px;padding:10px 12px;background:#FBF8F3;color:#1C3A57;box-sizing:border-box}
.widget-theme-preview i{display:block;width:54%;height:3px;background:currentColor;opacity:.5}
.widget-theme-preview b{font:700 20px 'Playfair Display',serif}
.widget-theme-preview.theme-navy{background:#1C3A57;color:#F5F0E8}
.widget-theme-choice input:checked+.widget-theme-preview{border-color:#B48C64;box-shadow:0 0 0 2px #B48C6426}
.widget-theme-choice input:focus-visible+.widget-theme-preview{outline:3px solid #1C3A57;outline-offset:3px}
#dashboard-section[data-widget-theme] .dashboard-widget{--theme-surface:#FBF8F3;--theme-head:#F5F0E8;--theme-ink:#1C3A57;--theme-muted:#785537;--theme-line:#E4D9C8;--theme-accent:#B48C64;--theme-chip:#F5F0E8;transition:background-color .2s ease,color .2s ease}
#dashboard-section[data-widget-theme=navy] .dashboard-widget{--theme-surface:#1C3A57;--theme-head:#19344E;--theme-ink:#F5F0E8;--theme-muted:#DCC4A8;--theme-line:#48617A;--theme-accent:#DCC4A8;--theme-chip:#244561}
#dashboard-section[data-widget-theme] .dashboard-widget-grid>.dashboard-widget,#dashboard-section[data-widget-theme] .dashboard-kpi-strip>.dashboard-widget{background:var(--theme-surface)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important;--paper:var(--theme-surface);--ink:var(--theme-ink);--navy:var(--theme-ink);--muted:var(--theme-muted);--line:var(--theme-line);--sand:var(--theme-chip)}
#dashboard-section[data-widget-theme] .dashboard-widget>.panel-title{background:var(--theme-head)!important;border-color:var(--theme-line)!important}
#dashboard-section[data-widget-theme] .dashboard-widget>.panel-title h2,#dashboard-section[data-widget-theme] .dashboard-widget .metric-heading{color:var(--theme-muted)!important}
#dashboard-section[data-widget-theme] .dashboard-widget :is(.auth-hint,.muted-value,.sales-goals-period,.sales-goals-quality,.sales-goal-result small,.sales-goal-result span,.sales-goals-controls label,.sales-goals-form label,.dashboard-focus-item small,.dashboard-employee-row small,.funnel-value small,.quick-actions small){color:var(--theme-muted)!important}
#dashboard-section[data-widget-theme] .dashboard-widget :is(.sales-goal-gauge,.sales-goal-result b,.metric strong,.dashboard-focus-item b,.dashboard-employee-row b,.outcome-donut strong){color:var(--theme-ink)!important}
#dashboard-section[data-widget-theme] .sales-goal-track{stroke:var(--theme-line)}
#dashboard-section[data-widget-theme] .sales-goal-progress{stroke:var(--theme-accent)}
#dashboard-section[data-widget-theme] .sales-goal-needle{stroke:var(--theme-ink)}
#dashboard-section[data-widget-theme] .dashboard-widget :is(.outcome-operational article,.dashboard-financial-detail>.metric,.count-badge,.dashboard-focus-item,.dashboard-employee-row,.tenant-user){background:var(--theme-chip)!important;border-color:var(--theme-line)!important;color:var(--theme-ink)!important}
#dashboard-section[data-widget-theme] .dashboard-widget :is(.count-badge,.dashboard-call-person,.dashboard-focus-item strong,.dashboard-employee-row strong){color:var(--theme-ink)!important}
#dashboard-section[data-widget-theme] .dashboard-widget :is(.outcome-legend>button,.quick-actions button,.dashboard-call-person>button,.panel-title>button,.dashboard-widget-settings,.dashboard-widget-handle,.dashboard-widget-order){color:var(--theme-ink)!important;background:var(--theme-chip)!important;border-color:var(--theme-line)!important}
#dashboard-section[data-widget-theme] .dashboard-widget :is(.outcome-legend>button,.quick-actions button,.dashboard-widget-settings):hover{background:var(--theme-head)!important}
#dashboard-section[data-widget-theme] .dashboard-widget :is(.sales-goals-controls input,.sales-goals-controls select,.sales-goals-form input){background:#FBF8F3!important;color:#1C3A57!important;border-color:#DCC4A8!important}
#dashboard-section[data-widget-theme] .dashboard-widget>.dashboard-widget-editor{--paper:#FBF8F3;--ink:#1C3A57;--navy:#1C3A57;--muted:#785537;--line:#E4D9C8;--sand:#F5F0E8;background:#FBF8F3!important;color:#1C3A57!important}
#dashboard-section[data-widget-theme] .dashboard-widget:focus-within{outline-color:var(--theme-accent)}
@media(prefers-reduced-motion:reduce){#dashboard-section[data-widget-theme] .dashboard-widget{transition:none}}
#dashboard-section[data-widget-theme] .dashboard-kpi-strip>.dashboard-kpi.metric>.dashboard-widget-controls>button{background:var(--theme-chip)!important;border-color:var(--theme-line)!important;color:var(--theme-ink)!important}
#dashboard-section[data-widget-theme] .dashboard-widget .dashboard-widget-editor label{color:#1C3A57!important}
#dashboard-section[data-widget-theme] .dashboard-kpi-strip>.dashboard-kpi.metric>:is(.metric-heading,strong,small,button[data-open-section]){color:var(--theme-ink)!important}
#dashboard-section[data-widget-theme] .dashboard-kpi-strip>.dashboard-kpi.metric>.metric-heading .metric-icon{color:var(--theme-ink)!important;background:var(--theme-chip)!important}
#dashboard-section[data-widget-theme] .dashboard-widget>.panel-title h2{font-weight:700!important}
#dashboard-section[data-widget-theme]:not([data-widget-theme=brand]) .outcome-operational article.warning strong{color:#F19588}
#dashboard-section .outcome-main{--chart-open:#1C3A57;--chart-won:#B48C64;--chart-lost:#785537}
#dashboard-section[data-widget-theme]:not([data-widget-theme=brand]) .outcome-main{--chart-open:#9BB9CF;--chart-won:#DCC4A8;--chart-lost:#AE9A88}
.outcome-rings{position:relative;width:144px;height:144px;flex:0 0 144px;color:var(--theme-ink,#1C3A57)}
.outcome-rings svg{display:block;width:100%;height:100%;overflow:visible}
.outcome-rings circle{fill:none;stroke-width:6;transform:rotate(-90deg);transform-origin:72px 72px}
.outcome-ring-track{stroke:var(--theme-line,#E4D9C8);opacity:.6}
.outcome-ring-value{stroke-linecap:round;stroke-dasharray:100;transition:stroke-dashoffset .65s ease}
.outcome-ring-value.ring-open{stroke:var(--chart-open)}
.outcome-ring-value.ring-won{stroke:var(--chart-won)}
.outcome-ring-value.ring-lost{stroke:var(--chart-lost)}
.outcome-ring-label{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.outcome-ring-label strong{font:700 23px/1.2 'Playfair Display',serif;color:inherit}
.outcome-ring-label small{font:10px/1.4 Montserrat,sans-serif;color:var(--theme-muted,#785537)}
.outcome-legend i.ring-open{background:var(--chart-open)}
.outcome-legend i.ring-won{background:var(--chart-won)}
.outcome-legend i.ring-lost{background:var(--chart-lost)}
@media(prefers-reduced-motion:reduce){.outcome-ring-value{transition:none}}
/* Completed theme surfaces: controls and populated cards must remain readable. */
#dashboard-section[data-widget-theme] .dashboard-widget :is(input,select,textarea,option){color:#1C3A57!important;background:#FBF8F3!important;border-color:#DCC4A8!important;color-scheme:light}
#dashboard-section[data-widget-theme] .dashboard-widget :is(label,label>span,.dashboard-call-picker>span,.rating-note){color:var(--theme-muted)!important}
#dashboard-section[data-widget-theme] .dashboard-widget .deal-card{background:var(--theme-chip)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important;box-shadow:none}
#dashboard-section[data-widget-theme] .dashboard-widget .deal-card b,#dashboard-section[data-widget-theme] .dashboard-widget .deal-card:hover b{color:var(--theme-ink)!important}
#dashboard-section[data-widget-theme] .dashboard-widget .deal-card small{color:var(--theme-muted)!important}
#dashboard-section[data-widget-theme] .dashboard-widget :is(.top-entry,.compact-disclosure){color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
#dashboard-section[data-widget-theme] .dashboard-widget .top-entry:hover,#dashboard-section[data-widget-theme] .dashboard-widget .compact-disclosure{background:var(--theme-chip)!important}
#dashboard-section[data-widget-theme] .dashboard-widget .top-position{color:#0C1F2C!important}
#dashboard-section[data-widget-theme] .dashboard-widget .empty{color:var(--theme-muted)!important}
#dashboard-section[data-widget-theme] .dashboard-widget .compact-disclosure>summary{background:transparent!important;color:var(--theme-ink)!important}
#dashboard-section[data-widget-theme] .dashboard-widget>.dashboard-widget-editor :is(label,label>span){color:#1C3A57!important}
/* Flat compact headers, one title case, and modern dashboard numerals. */
#dashboard-section[data-widget-theme] .dashboard-widget-grid>.dashboard-widget{border-width:0!important;border-radius:8px!important;box-shadow:0 2px 7px #0C1F2C14!important}
#dashboard-section[data-widget-theme] .dashboard-widget-grid>.dashboard-widget>.panel-title{background:transparent!important;border-bottom:0!important;border-radius:0!important;min-height:38px!important;padding:12px 48px 8px 14px!important}
#dashboard-section[data-widget-theme] .dashboard-widget>.panel-title h2,#dashboard-section[data-widget-theme] .dashboard-widget .metric-heading,#dashboard-section[data-widget-theme] .annual-rating-columns>section>h3{text-transform:uppercase!important;font-weight:600!important;font-size:clamp(11px,calc(var(--widget-heading,14px) - 3px),14px)!important;letter-spacing:.04em!important;line-height:1.5!important}
#dashboard-section[data-widget-theme] .dashboard-widget .brown-line{width:2px;flex-basis:2px;height:12px}
#dashboard-section[data-widget-theme] .dashboard-widget :is(.metric strong,.sales-goal-gauge strong,.sales-goal-result b,.outcome-ring-label strong,.outcome-operational strong,.top-score,.top-position){font-family:Montserrat,sans-serif!important;font-weight:500!important;font-variant-numeric:tabular-nums;letter-spacing:-.025em}
#dashboard-section[data-widget-theme] .dashboard-kpi-strip>.dashboard-kpi.metric>strong{font-size:var(--widget-number,34px)!important;line-height:1.25!important}
#dashboard-section[data-widget-theme] .sales-goal-gauge strong{font-size:32px}
#dashboard-section[data-widget-theme] .sales-goal-result b{font-size:28px}
#dashboard-section[data-widget-theme] .outcome-ring-label strong{font-size:24px}
#dashboard-section[data-widget-theme] .dashboard-widget-grid>.dashboard-widget>.dashboard-widget-controls{border:0!important;background:transparent!important}
#dashboard-section[data-widget-theme] .dashboard-widget-grid>.dashboard-widget>.dashboard-widget-controls>.dashboard-widget-settings{flex-basis:28px!important;width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;background:transparent!important;border-color:transparent!important}
#dashboard-section[data-widget-theme] .dashboard-widget-settings:hover{background:var(--theme-chip)!important}
#dashboard-section[data-widget-theme] .dashboard-operational-panel .outcome-operational{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0;padding:10px 14px 14px}
#dashboard-section[data-widget-theme] .dashboard-operational-panel .outcome-operational article{border:0!important;border-radius:6px;padding:10px;min-width:0}
#dashboard-section[data-widget-theme] .outcome-operational strong{font-size:27px;line-height:1.3}
#dashboard-section[data-widget-theme] .outcome-operational .is-clear strong{color:var(--theme-ink)!important}
#dashboard-section[data-widget-theme] .outcome-main{padding-bottom:14px;gap:12px}
#dashboard-section[data-widget-theme] .outcome-rings{width:184px;height:184px;flex-basis:184px;max-width:100%;margin:4px auto}
@media(pointer:coarse){#dashboard-section[data-widget-theme] .dashboard-widget-grid>.dashboard-widget>.dashboard-widget-controls>.dashboard-widget-settings{flex-basis:44px!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}#dashboard-section[data-widget-theme] .dashboard-widget-grid>.dashboard-widget>.panel-title{padding-right:58px!important;min-height:48px!important}}
#dashboard-section[data-widget-theme] .outcome-operational .metric-incomplete strong{font-size:14px;line-height:1.5;letter-spacing:normal;overflow-wrap:anywhere}
/* Apply palette and text atomically: crossfades briefly destroy contrast. */
#dashboard-section[data-widget-theme] .dashboard-widget{transition-property:box-shadow;transition-duration:.15s}
@media(prefers-reduced-motion:reduce){#dashboard-section[data-widget-theme] .dashboard-widget{transition:none}}
#dashboard-section[data-widget-theme] .dashboard-widget :where(a,button,input,select,textarea,summary):focus-visible{outline:2px solid var(--theme-ink)!important;outline-offset:3px}
#dashboard-section[data-widget-theme] .dashboard-widget>.dashboard-widget-editor{--theme-ink:#1C3A57;--theme-muted:#785537;--theme-line:#E4D9C8}
#dashboard-section[data-widget-theme] .dashboard-kpi-strip>.dashboard-kpi.metric>.dashboard-widget-controls>.dashboard-widget-settings{width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;flex-basis:28px!important;background:transparent!important;border-color:transparent!important}
@media(pointer:coarse){#dashboard-section[data-widget-theme] .dashboard-kpi-strip>.dashboard-kpi.metric>.dashboard-widget-controls{height:44px!important;min-height:44px!important}#dashboard-section[data-widget-theme] .dashboard-kpi-strip>.dashboard-kpi.metric>.dashboard-widget-controls>.dashboard-widget-settings{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;flex-basis:44px!important}}

/* Populated dashboard text and hover must use the same surface/text pair. */
#dashboard-section[data-widget-theme] .dashboard-widget .dashboard-focus-item time{color:var(--theme-muted)!important}
#dashboard-section[data-widget-theme] .dashboard-widget .dashboard-employee-row em{color:#A3291D}
#dashboard-section[data-widget-theme=navy] .dashboard-widget .dashboard-employee-row em{color:#FFAEA1}
#dashboard-section[data-widget-theme] .dashboard-widget .dashboard-stage-open{color:var(--theme-ink)}
#dashboard-section[data-widget-theme] .dashboard-widget .dashboard-stage-open:is(:hover,:focus-visible){background:var(--theme-chip)!important;color:var(--theme-ink)}
#dashboard-section[data-widget-theme] .dashboard-widget .dashboard-stage-open :is(.funnel-name,.funnel-value b){color:var(--theme-ink)}

#dashboard-section[data-widget-theme=brand] .outcome-operational article.warning:not(.is-clear) strong{color:#A3291D}
#dashboard-section[data-widget-theme=navy] .outcome-operational article.warning:not(.is-clear) strong{color:#FFAEA1}

/* Semantic figures use matched, opaque colors on both ARKASCALE surfaces.
   These tokens follow the widget theme, independently of the page theme. */
#dashboard-section[data-widget-theme] .dashboard-widget{
 --metric-good:#087A42;--metric-bad:#BD2626;--metric-steady:#A64B00;
}
#dashboard-section[data-widget-theme=navy] .dashboard-widget{
 --metric-good:#3BE38B;--metric-bad:#FF9690;--metric-steady:#FFBE66;
}
#dashboard-section[data-widget-theme] .dashboard-widget [data-metric-tone=good]{--metric-color:var(--metric-good)}
#dashboard-section[data-widget-theme] .dashboard-widget [data-metric-tone=bad]{--metric-color:var(--metric-bad)}
#dashboard-section[data-widget-theme] .dashboard-widget [data-metric-tone=steady]{--metric-color:var(--metric-steady)}
#dashboard-section[data-widget-theme] .dashboard-widget [data-metric-tone=unknown]{--metric-color:var(--theme-ink)}
#dashboard-section[data-widget-theme] .dashboard-widget :is(strong,b,span,small,em,div)[data-metric-tone]{
 color:var(--metric-color)!important;font-variant-numeric:tabular-nums;
}
#dashboard-section[data-widget-theme] .dashboard-kpi-strip>.dashboard-kpi.metric>strong[data-metric-tone]{color:var(--metric-color)!important}
#dashboard-section[data-widget-theme] .dashboard-widget .funnel-value small[data-metric-tone]{color:var(--metric-color)!important}
#dashboard-section[data-widget-theme] .dashboard-widget span.count-badge[data-metric-tone]{color:var(--metric-color)!important}
#dashboard-section[data-widget-theme] .dashboard-widget .outcome-main{
 --chart-open:var(--metric-steady);--chart-won:var(--metric-good);--chart-lost:var(--metric-bad);
}
#dashboard-section[data-widget-theme] .dashboard-widget .sales-goal-gauge[data-metric-tone] .sales-goal-progress,
#dashboard-section[data-widget-theme] .dashboard-widget .sales-goal-gauge[data-metric-tone] .sales-goal-needle{stroke:var(--metric-color)}
#dashboard-section[data-widget-theme] .dashboard-widget .sales-bar{background:var(--metric-steady)}
#dashboard-section[data-widget-theme] .dashboard-widget .sales-bar.won{background:var(--metric-good)}
#dashboard-section[data-widget-theme] .dashboard-widget .chart-legend i{background:var(--metric-steady)}
#dashboard-section[data-widget-theme] .dashboard-widget .chart-legend i.won{background:var(--metric-good)}
#dashboard-section[data-widget-theme] .dashboard-widget [data-stage-tone=steady]{--stage-color:var(--metric-steady)!important}
#dashboard-section[data-widget-theme] .dashboard-widget [data-stage-tone=good]{--stage-color:var(--metric-good)!important}
#dashboard-section[data-widget-theme] .dashboard-widget [data-stage-tone=bad]{--stage-color:var(--metric-bad)!important}
#dashboard-section[data-widget-theme] .dashboard-widget .funnel-track{background:var(--theme-line)}
#dashboard-section[data-widget-theme] .dashboard-widget .funnel-fill{background:var(--stage-color)}
#dashboard-section[data-widget-theme] .dashboard-widget .dashboard-call-status{
 background:var(--theme-chip)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important;
}
#dashboard-section[data-widget-theme] .dashboard-widget .dashboard-call-status:hover{background:var(--theme-head)!important}
/* Widget editor dialogs always have a paper surface. */
#dashboard-section[data-widget-theme] .dashboard-widget>.dashboard-widget-editor{
 --metric-good:#087A42;--metric-bad:#BD2626;--metric-steady:#A64B00;
}

/* Keep employee row surfaces clear of the widget edges at every widget width. */
#dashboard-section #dashboard-employee-panel #dashboard-employee-list{padding:8px 16px 16px!important;gap:8px;min-width:0;}
#dashboard-section #dashboard-employee-panel .dashboard-employee-row{padding:12px;border:1px solid var(--theme-line,var(--line));border-radius:8px;}
#dashboard-section #dashboard-employee-panel .dashboard-employee-row:last-child{border:1px solid var(--theme-line,var(--line));}

/* Full-width phone KPIs use one header and a shared value/detail row. */
@media(max-width:359px){
 #dashboard-section[data-widget-theme][data-layout-editing=false] .dashboard-kpi-strip>.dashboard-kpi.metric:not([hidden]):not([data-dashboard-access-hidden=true]){display:grid!important;grid-template-columns:minmax(0,1fr) minmax(64px,100px);align-content:start;align-items:center;gap:2px 12px;padding:10px 12px!important;min-height:0!important}
 #dashboard-section[data-widget-theme][data-layout-editing=false] .dashboard-kpi-strip>.dashboard-kpi.metric>.metric-heading{grid-column:1/-1;grid-row:1;min-height:44px;padding-right:44px!important}
 #dashboard-section[data-widget-theme][data-layout-editing=false] .dashboard-kpi-strip>.dashboard-kpi.metric>strong{grid-column:2;grid-row:2;max-width:100%;margin:0!important;font-size:clamp(22px,calc(var(--widget-number,34px)*.75),30px)!important;line-height:1.25!important;text-align:right;overflow-wrap:anywhere}
 #dashboard-section[data-widget-theme][data-layout-editing=false] .dashboard-kpi-strip>.dashboard-kpi.metric>small{grid-column:1;grid-row:2;min-width:0;overflow-wrap:anywhere}
 #dashboard-section[data-widget-theme][data-layout-editing=false] .dashboard-kpi-strip>.dashboard-kpi.metric>button[data-open-section]{grid-column:1/-1;grid-row:3;min-height:44px!important;margin:0!important}
 #dashboard-section[data-widget-theme][data-layout-editing=false] .dashboard-kpi-strip>.dashboard-kpi.metric>.dashboard-widget-controls{top:8px;right:8px;height:44px!important;min-height:44px!important}
 #dashboard-section[data-widget-theme][data-layout-editing=false] .dashboard-kpi-strip>.dashboard-kpi.metric>.dashboard-widget-controls>.dashboard-widget-settings{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;flex-basis:44px!important}
}

@media(max-width:359px){
 #dashboard-section[data-widget-theme][data-layout-editing=false] .dashboard-kpi-strip>.dashboard-kpi.metric:has(>strong[data-phone-value-layout=wide])>strong{grid-column:1/-1;grid-row:2;text-align:left;overflow-wrap:anywhere}
 #dashboard-section[data-widget-theme][data-layout-editing=false] .dashboard-kpi-strip>.dashboard-kpi.metric:has(>strong[data-phone-value-layout=wide])>small{grid-column:1/-1;grid-row:3}
 #dashboard-section[data-widget-theme][data-layout-editing=false] .dashboard-kpi-strip>.dashboard-kpi.metric:has(>strong[data-phone-value-layout=wide])>button[data-open-section]{grid-row:4}
}
