/* Fibergo V3 contrast corrections, applied after the current production bundle.
   Keep this scoped to the V3 skin; the original frontend image is backed up. */

html.v3-skin:not(.v3-dark) {
  --v3-muted: #596B84;
  --v3-text-3: #596B84;
  --v3-positive: #16803F;
  --v3-warning: #365D8A;
  --v3-danger: #C3153C;
  --v3-danger-soft: #FFF1F3;
}

html.v3-skin.v3-dark {
  --v3-text-3: #A3A3A3;
  --v3-primary-hover: #426BA4;
  --v3-danger: #F59AA3;
  --v3-danger-soft: #2E2224;
}

/* Shared actions, field hints, focus, and status indicators. */
html.v3-skin .v3-tip-bubble,
html.v3-skin .v3ag-chart .tip { color: #FFFFFF; }
html.v3-skin.v3-dark .v3-tip-bubble,
html.v3-skin.v3-dark .v3ag-chart .tip { color: #0A1F44; }
html.v3-skin .v3-btn.danger.solid {
  background: #E11D48;
  border-color: #E11D48;
  color: #FFFFFF;
}
html.v3-skin .v3-btn.danger:not(.solid):hover:not(:disabled) {
  background: var(--v3-danger-soft);
}
html.v3-skin .v3-input::placeholder,
html.v3-skin .v3-textarea::placeholder { opacity: 1; }
html.v3-skin:not(.v3-dark) :is(.v3-modal-eyebrow, .v3sb-pmail, .v3pm-email) { color: #596B84; }
html.v3-skin.v3-dark :is(.v3-modal-eyebrow, .v3pm-email) { color: #A3A3A3; }

html.v3-skin:not(.v3-dark) :is(.v3-input, .v3-select, .v3-textarea, .v3-check input, .v3sp-numrow),
html.v3-skin:not(.v3-dark) .v3set :is(.input, input.input, select.input, textarea.input) {
  border-color: #7B8DA4;
}
html.v3-skin.v3-dark :is(.v3-input, .v3-select, .v3-textarea, .v3-check input, .v3sp-numrow),
html.v3-skin.v3-dark .v3set :is(.input, input.input, select.input, textarea.input) {
  border-color: #737373;
}
html.v3-skin .v3-input:focus,
html.v3-skin .v3-select:focus,
html.v3-skin .v3-textarea:focus,
html.v3-skin .v3sp-numrow:focus-within { border-color: var(--v3-blue-2); }
html.v3-skin :is(.v3-input, .v3-select, .v3-textarea).invalid { border-color: var(--v3-danger); }
html.v3-skin:not(.v3-dark) .v3-toggle .track { background: #7B8DA4; }
html.v3-skin.v3-dark .v3-toggle .track { background: #737373; }
html.v3-skin .v3-toggle input:checked + .track { background: var(--v3-primary); }

html.v3-skin:not(.v3-dark) :is(.v3-btn, .v3-tab, .v3ib-card, .v3ib-iconbtn, .v3-check input, .v3fn-card, .v3sl-card):focus-visible,
html.v3-skin:not(.v3-dark) .v3-toggle input:focus-visible + .track { outline: 2px solid #1464D2; outline-offset: 2px; }
html.v3-skin.v3-dark :is(.v3-btn, .v3-tab, .v3ib-card, .v3ib-iconbtn, .v3-check input, .v3fn-card, .v3sl-card):focus-visible,
html.v3-skin.v3-dark .v3-toggle input:focus-visible + .track { outline: 2px solid #86B0E4; outline-offset: 2px; }
html.v3-skin:not(.v3-dark) .v3sb-item:focus-visible { box-shadow: 0 0 0 2px #1464D2; }
html.v3-skin.v3-dark .v3sb-item:focus-visible { box-shadow: 0 0 0 2px #86B0E4; }

/* The public brand blue is suitable for fills, but too dark as text on dark cards.
   Match only an explicit foreground declaration, not background-color. */
html.v3-skin.v3-dark #app-content [style^="color: var(--accent)"],
html.v3-skin.v3-dark #app-content [style*="; color: var(--accent)"],
html.v3-skin.v3-dark #app-content [style^="color:var(--accent)"],
html.v3-skin.v3-dark #app-content [style*=";color:var(--accent)"] {
  color: #A9C2E6 !important;
}

/* Sales frame and quotation cards. */
html.v3-dark .v3sl-subnav .back { background: #232323; border-color: #737373; color: #ECECEC; }
html.v3-dark .v3sl-subnav .back:hover { background: #2B2B2B; }
html.v3-dark .v3sl-subnav a { color: #A3A3A3; }
html.v3-dark .v3sl-subnav a:hover { background: #2B2B2B; color: #ECECEC; }
html.v3-dark .v3sl-subnav a.active { background: #2B3039; color: #A9C2E6; box-shadow: inset 0 0 0 1px #6C90C4; }

html.v3-skin:not(.v3-dark) :is(.v3qs, .v3qsteps, .v3qw) small { color: #596B84; }
html.v3-dark :is(.v3qs button, .v3qsteps li, .v3qw button) {
  background: #232323;
  border-color: #353535;
}
html.v3-dark :is(.v3qs, .v3qsteps, .v3qw) strong { color: #ECECEC; }
html.v3-dark :is(.v3qs, .v3qsteps, .v3qw) small { color: #A3A3A3; }
html.v3-dark .v3qs span { color: #C8C8C8; }
html.v3-dark :is(.v3qs button.on, .v3qw button.current) { border-color: #6C90C4; box-shadow: inset 0 0 0 1px #6C90C4; }
html.v3-dark :is(.v3qsteps li > span, .v3qw button > span) { background: #2B3039; color: #A9C2E6; }
html.v3-dark .v3qw button.current > span { background: #4A74B0; color: #FFFFFF; }
html.v3-dark .v3qw button.done > span { background: #1F2A24; color: #5FD39B; }
html.v3-dark .v3qnav { border-color: #353535; }

html.v3-skin:not(.v3-dark) :is(.v3fn-card .id small, .v3fn-card .foot,
  .v3fn-card .tags .more, .v3fn-col h2 em, .v3fn-col .sum, .v3fn-col .empty,
  .v3fn-live, .v3fn-pop small, .v3fn-search kbd, .v3fn-ld aside small,
  .v3fn-ld-top .meta, .v3fn-ld-top .stage small, .v3fn-ld-hero small,
  .v3fn-ld-fact small, .v3fn-ld-fact em, .v3fn-ld-box > small,
  .v3fn-ld-box .kv b, .v3fn-ld-box .hint, .v3fn-ld-box .cov small,
  .v3fn-fu-head small, .v3fn-fu-start .empty, .v3fn-fu-note,
  .v3fn-ft aside > button small, .v3fn-ft .hint, .v3fn-ft-opts small,
  .v3fn-st .hint) { color: #596B84; }

/* Opportunity detail, follow-up, and follow-up template editor. */
html.v3-dark :is(.v3fn-ld-top, .v3fn-ld-hero, .v3fn-fu-head, .v3fn-ld-box .cov > div, .v3fn-st .pv) {
  background: #303030;
  color: #ECECEC;
}
html.v3-dark :is(.v3fn-ld-box, .v3fn-ld .act, .v3fn-ft aside > button, .v3fn-ft-steps li, .v3fn-ft-bind button, .v3fn-reasons button) {
  background: #232323;
  border-color: #353535;
  color: #ECECEC;
}
html.v3-dark :is(.v3fn-ld .act, .v3fn-ft aside > button, .v3fn-ft-bind button, .v3fn-reasons button):hover {
  background: #2B2B2B;
}
html.v3-dark :is(.v3fn-ld-tabs, .v3fn-ft-steps .aud) { background: #2B2B2B; border-color: #353535; }
html.v3-dark :is(.v3fn-ld-tabs button, .v3fn-ft-steps .aud button) { color: #A3A3A3; }
html.v3-dark :is(.v3fn-ld-tabs button.on, .v3fn-ft-steps .aud button.on) { background: #303030; color: #ECECEC; box-shadow: none; }
html.v3-dark :is(.v3fn-ld aside small, .v3fn-ld-top .meta, .v3fn-ld-top .stage small,
  .v3fn-ld-hero small, .v3fn-ld-hero p, .v3fn-ld-fact small, .v3fn-ld-fact em,
  .v3fn-ld-box > small, .v3fn-ld-box .kv b, .v3fn-ld-box .hint, .v3fn-ld-box .cov small,
  .v3fn-fu-head small, .v3fn-fu-steps p, .v3fn-fu-start p, .v3fn-fu-start .empty,
  .v3fn-fu-note, .v3fn-ft aside > button small, .v3fn-ft .hint, .v3fn-ft-opts small,
  .v3fn-ft-steps .wait, .v3fn-ft-steps .vars label, .v3fn-ft-bind small,
  .v3fn-st .hint, .v3fn-st .vars label) { color: #A3A3A3; }
html.v3-dark :is(.v3fn-ld-fact a, .v3fn-ld-doc, .v3fn-fu-link) { color: #A9C2E6; }
html.v3-dark .v3fn-ld-fact > span { background: #2B3039; color: #A9C2E6; }
html.v3-dark .v3fn-ld-top .av[style] { background: #4A4A4A !important; color: #ECECEC !important; }
html.v3-dark .v3fn-ld-top .pill[style] { color: #ECECEC !important; }
html.v3-dark .v3fn-ld-box.fold > button { color: #ECECEC; }
html.v3-dark .v3fn-ld-box.fold .pill { background: #2B3039; color: #A9C2E6; }
html.v3-dark .v3fn-ld .act.wa { color: #5FD39B; }
html.v3-dark .v3fn-ld .act.warn,
html.v3-dark .v3fn-ft-bind em { color: #E8C073; }
html.v3-dark .v3fn-ld .act.danger { color: #F59AA3; }
html.v3-dark .v3fn-fu-st { background: #2B3039; color: #A9C2E6; }
html.v3-dark .v3fn-fu-st.on { background: #1F2A24; color: #5FD39B; }
html.v3-dark .v3fn-fu-st.warn { background: #2C2820; color: #E8C073; }
html.v3-dark .v3fn-fu-st.done { background: #2B3039; color: #A9C2E6; }
html.v3-dark .v3fn-fu-steps li > i { background: #2B2B2B; color: #A3A3A3; }
html.v3-dark .v3fn-fu-steps li.done > i,
html.v3-dark .v3fn-fu-steps em { background: #1F2A24; color: #5FD39B; }
html.v3-dark .v3fn-fu-steps li.now > i { background: #2B3039; color: #A9C2E6; }
html.v3-dark .v3fn-fu-steps li.fail > i,
html.v3-dark .v3fn-fu-steps em.failed { background: #2E2224; color: #F59AA3; }
html.v3-dark .v3fn-fu-steps p small { color: #F59AA3; }
html.v3-dark .v3fn-fu-start { border-color: #737373; }
html.v3-dark .v3fn-ft aside > button.on { background: #2B3039; border-color: #6C90C4; }
html.v3-dark .v3fn-ft-opts { color: #C8C8C8; }
html.v3-dark .v3fn-ft-steps .mv button { color: #A3A3A3; }
html.v3-dark .v3fn-ft-steps .mv button:hover:not(:disabled) { background: #2B2B2B; }
html.v3-dark .v3fn-ft-bind button.on { background: #1F2A24; color: #5FD39B; border-color: #5FD39B; }
html.v3-dark .v3fn-reasons button.on { background: #2E2224; border-color: #F59AA3; }
html.v3-dark .v3fn-reasons button.on i { background: #E11D48; border-color: #E11D48; }
html.v3-dark :is(.v3fn-ld-fact input[type="date"], .v3fn-ld-box textarea,
  .v3fn-ft-opts input[type="time"], .v3fn-ft-steps .wait input,
  .v3fn-ft-steps .wait select, .v3fn-ft-steps .vars select, .v3fn-st .vars select) {
  background: #232323;
  border-color: #737373;
  color: #ECECEC;
  color-scheme: dark;
}

/* Contacts, settings, and call controls still contain one-off status colors. */
html.v3-skin:not(.v3-dark) .v3ct-metrics strong.ok { color: #16803F; }
html.v3-skin:not(.v3-dark) .v3ct-metrics strong.warn,
html.v3-skin:not(.v3-dark) .v3ag-kpis strong.warn,
html.v3-skin:not(.v3-dark) .v3-trend.warn { color: #365D8A; }
html.v3-skin:not(.v3-dark) .v3br-ib.ok { color: #16803F; }
html.v3-skin.v3-dark .v3ct-metrics strong.ok { color: #5FD39B; }
html.v3-skin.v3-dark .v3ct-metrics strong.warn,
html.v3-skin.v3-dark .v3ag-kpis strong.warn,
html.v3-skin.v3-dark .v3-trend.warn { color: #E8C073; }
html.v3-skin.v3-dark .v3br-ib.ok { color: #5FD39B; }
html.v3-skin:not(.v3-dark) .v3tm-tabs button.on { background: #001B58; }
html.v3-skin.v3-dark .v3tm-tabs button.on { background: #4A74B0; }
html.v3-skin .v3set .agt-graf__bar,
html.v3-skin .v3ag-chart i { background: var(--v3-blue) !important; }
html.v3-skin .v3ag-chart i.on { background: var(--v3-primary) !important; }

html.v3-skin .v3sp-head .tt small,
html.v3-skin .v3sp-pill .tx small { color: #FFFFFF; }
html.v3-skin .v3sp-end,
html.v3-skin .v3sp-incoming .ans .rej { background: #E11D48; color: #FFFFFF; }
html.v3-skin .v3sp-incoming .ans .acc { background: #16803F; color: #FFFFFF; }
