/* Inicio cockpit. Family identifies the business area; tone identifies the result. */
#homeView {
  --sw-home-primary: #0866d9;
  --sw-home-ink: #13283f;
  --sw-home-line: #d9e3ee;
  gap: 30px;
}
#homeView [data-family] { --home-family-accent: #295379; --home-family-ink: #24476b; }
#homeView [data-family="sales"] { --home-family-accent: #0866d9; --home-family-ink: #0758b9; }
#homeView [data-family="operations"] { --home-family-accent: #008c95; --home-family-ink: #006a73; }
#homeView [data-family="commercial"] { --home-family-accent: #7148c8; --home-family-ink: #643ab5; }
#homeView [data-family="inventory"] { --home-family-accent: #b66a08; --home-family-ink: #8d5004; }
#homeView [data-family="reviews"] { --home-family-accent: #af3276; --home-family-ink: #a12b6b; }
#homeView [data-family="market"] { --home-family-accent: #4b59bb; --home-family-ink: #3e4ca9; }
#homeView [data-family="financial"] { --home-family-accent: #14764a; --home-family-ink: #10653e; }

#homeView .home-cockpit-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 32px;
  padding: 28px 32px;
  color: #fff;
  background: linear-gradient(112deg, #101e34 0%, #123456 64%, #075d91 100%);
  border: 1px solid #214966;
  border-top: 4px solid #29b9e7;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgb(8 34 65 / 15%);
}
#homeView .home-cockpit-hero .section-eyebrow {
  color: #8de3f5;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
#homeView .home-cockpit-hero h2 {
  max-width: 1110px;
  margin: 10px 0 12px;
  color: #fff;
  font-size: clamp(24px, 2.1vw, 30px);
  line-height: 1.25;
}
#homeView .home-cockpit-hero p { color: #ccdeed; font-size: 14px; line-height: 1.55; }
#homeView .home-source-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  justify-items: stretch;
  gap: 16px;
  padding-left: 28px;
  border-left: 1px solid rgb(185 216 244 / 24%);
}
#homeView .home-cockpit-agenda-count { display: grid; gap: 2px; }
#homeView .home-cockpit-agenda-count > strong {
  color: #fff;
  font-size: 64px;
  font-variant-numeric: tabular-nums;
  line-height: .95;
  letter-spacing: -.04em;
}
#homeView .home-cockpit-agenda-count > span { color: #d3e7f5; font-size: 13px; }
#homeView .home-cockpit-live {
  min-width: 0;
  padding: 10px 12px;
  border-color: rgb(198 231 247 / 24%);
  background: rgb(10 26 43 / 28%);
  border-radius: 8px;
}
#homeView .home-cockpit-live strong { color: #fff; font-size: 12px; }
#homeView .home-cockpit-live span { color: #c8deec; font-size: 12px; }
#homeView .home-cockpit-live > i { color: #60e4ce; }
#homeView .home-cockpit-live.is-partial > i { color: #ffd081; }
#homeView .home-cockpit-live.is-loading > i { color: #91d8ff; }
#homeView .home-ai-disclosure {
  margin: -12px 0 -14px;
  padding: 0 3px;
  border: 0;
  border-radius: 0;
}
#homeView .home-ai-disclosure > span { color: #175a9a; }
#homeView .home-ai-disclosure p { font-size: 12px; }
#homeView .home-section-nav { gap: 8px; }
#homeView .home-section-nav a {
  min-height: 40px;
  padding: 10px 14px;
  color: #234761;
  border-color: #ccdce9;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 2px 3px rgb(14 43 78 / 3%);
}
#homeView .home-section-nav a:first-child { color: #fff; background: #0866d9; border-color: #0866d9; }
#homeView .home-section-nav a:hover { color: #fff; background: #064fba; border-color: #064fba; }
#homeView .home-cockpit-section-heading { margin-bottom: 18px; }
#homeView .home-cockpit-section-heading h2 { font-size: 26px; letter-spacing: -.02em; }
#homeView .home-cockpit-section-heading .section-eyebrow { color: #0866d9; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }

/* The instrument panel keeps all six real measurements and their original mini-charts. */
#homeView .home-cockpit-kpi-grid { gap: 14px; }
#homeView .home-cockpit-kpi {
  padding: 20px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--home-family-accent) 7%, white), #fff 72%);
  border: 1px solid color-mix(in srgb, var(--home-family-accent) 21%, #dce4eb);
  border-top: 4px solid var(--home-family-accent);
  border-radius: 13px;
  box-shadow: 0 5px 14px rgb(17 52 84 / 6%);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
#homeView .home-cockpit-kpi:hover,
#homeView .home-cockpit-kpi:focus-visible {
  border-color: var(--home-family-accent);
  box-shadow: 0 12px 25px rgb(17 52 84 / 12%);
  transform: translateY(-2px);
}
#homeView .home-cockpit-kpi-top { color: var(--home-family-ink); font-size: 12px; }
#homeView .home-cockpit-kpi-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  color: #fff;
  background: var(--home-family-accent);
  border-radius: 10px;
  font-size: 16px;
}
#homeView .home-cockpit-kpi-open { color: var(--home-family-ink); font-size: 15px; }
#homeView .home-cockpit-kpi-reading > span { color: #364c63; font-size: 14px; font-weight: 700; }
#homeView .home-cockpit-kpi-reading > strong { color: #10243e; font-size: 38px; letter-spacing: -.03em; }
#homeView .home-cockpit-kpi-reading > small { font-size: 12px; font-weight: 700; }
#homeView .home-cockpit-kpi-reading > small.tone-positive { color: #056f50; background: #dcf4e9; }
#homeView .home-cockpit-kpi-reading > small.tone-negative { color: #b02545; background: #ffe3e9; }
#homeView .home-cockpit-kpi-reading > small.tone-watch { color: #845404; background: #fff0cb; }
#homeView .home-cockpit-kpi-reading > small.tone-neutral { color: #42586c; background: #e7edf3; }
#homeView .home-cockpit-kpi > p { border-top-color: color-mix(in srgb, var(--home-family-accent) 14%, #e5eaf0); }
#homeView .home-kpi-compare > div { grid-template-columns: 14px minmax(0, 1fr); }
#homeView .home-kpi-compare i { background: #dce5ee; border-radius: 4px 4px 2px 2px; }
#homeView .home-kpi-compare > div:last-child b { background: var(--home-family-accent); }
#homeView .home-kpi-compare strong { color: #253d55; font-size: 12px; }
#homeView .home-kpi-stack-bar { height: 22px; border-radius: 5px; }
#homeView .home-kpi-stack > div:last-child span { font-size: 12px; }
#homeView .home-kpi-stack > div:last-child span i { width: 7px; height: 7px; flex: 0 0 7px; }
#homeView .home-kpi-gauge { height: 110px; }
#homeView .home-kpi-gauge svg { width: 104px; height: 104px; }
#homeView .home-kpi-gauge::before { width: 116px; height: 116px; }
#homeView .home-kpi-gauge span { font-size: 18px; }

/* A labelled key makes family colour understandable without depending on colour alone. */
#homeView .home-family-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
#homeView .home-family-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  color: var(--home-family-ink);
  background: color-mix(in srgb, var(--home-family-accent) 9%, white);
  border: 1px solid color-mix(in srgb, var(--home-family-accent) 23%, white);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
#homeView .home-family-key strong { min-width: 22px; padding: 2px 5px; color: #fff; background: var(--home-family-ink); border-radius: 5px; text-align: center; }
#homeView #homeRemainingTasks .home-cockpit-more:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
#homeView #homeMoreDecisionsTitle,
#homeView #homePendingDecisionsTitle,
#homeView #homeDecisionsTitle,
#homeView #homePulseTitle,
#homeView #homePerformanceTitle { scroll-margin-top: 30px; }

@media (min-width: 901px) and (max-width: 1549px) {
  #homeView .home-cockpit-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #homeView .home-cockpit-kpi { padding: 17px; column-gap: 14px; }
  #homeView .home-cockpit-kpi-reading > strong { font-size: 34px; }
  #homeView .home-kpi-compare > div { grid-template-columns: 12px minmax(0, 1fr); }
  #homeView .home-kpi-compare { gap: 9px; }
  #homeView .home-kpi-stack-bar { height: 20px; }
  #homeView .home-kpi-stack > div:last-child { gap: 5px; }
  #homeView .home-kpi-stack > div:last-child span { font-size: 11px; }
}
@media (max-width: 1100px) {
  #homeView .home-cockpit-hero { grid-template-columns: minmax(0, 1fr) 170px; padding: 25px; gap: 24px; }
  #homeView .home-source-meta { padding-left: 20px; }
  #homeView .home-cockpit-agenda-count > strong { font-size: 52px; }
  #homeView .home-cockpit-kpi-reading > strong { font-size: 30px; }
  #homeView .home-kpi-compare > div { grid-template-columns: 9px minmax(0, 1fr); column-gap: 4px; }
  #homeView .home-kpi-compare strong { font-size: 11px; white-space: nowrap; }
}
@media (max-width: 760px) {
  #homeView { gap: 24px; }
  #homeView .home-cockpit-hero { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px 20px; }
  #homeView .home-cockpit-hero h2 { font-size: 22px; line-height: 1.3; }
  #homeView .home-source-meta { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); align-items: center; gap: 14px; padding: 16px 0 0; border-left: 0; border-top: 1px solid rgb(185 216 244 / 24%); }
  #homeView .home-cockpit-agenda-count > strong { font-size: 40px; }
  #homeView .home-cockpit-agenda-count > span { font-size: 12px; }
  #homeView .home-section-nav { display: grid; grid-template-columns: 1fr 1fr; }
  #homeView .home-section-nav a { justify-content: center; padding: 10px 8px; font-size: 12px; }
  #homeView .home-cockpit-section-heading h2 { font-size: 24px; }
  #homeView .home-family-key { font-size: 12px; }
}
@media (max-width: 600px) {
  #homeView .home-cockpit-kpi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; row-gap: 14px; padding: 18px; }
  #homeView .home-cockpit-kpi-top { grid-column: 1 / -1; }
  #homeView .home-cockpit-kpi-reading { grid-column: 1; grid-row: 2; align-content: center; margin: 0; gap: 8px; }
  #homeView .home-cockpit-kpi-reading > strong { font-size: 30px; }
  #homeView .home-cockpit-kpi-reading + div { grid-column: 2; grid-row: 2; align-self: center; min-width: 0; width: 100%; margin: 0; }
  #homeView .home-cockpit-kpi-reading + .home-kpi-composite,
  #homeView .home-cockpit-kpi-reading + .home-kpi-trend { grid-column: 1 / -1; grid-row: 3; }
  #homeView .home-cockpit-kpi > p { grid-column: 1 / -1; margin: 0; padding-top: 12px; }
  #homeView .home-kpi-compare { gap: 8px; height: 85px; margin: 0; }
  #homeView .home-kpi-compare > div { grid-template-columns: 9px minmax(0, 1fr); gap: 4px; }
  #homeView .home-kpi-compare span,
  #homeView .home-kpi-compare strong { font-size: 11px; }
  #homeView .home-kpi-stack > div:last-child span { font-size: 11px; }
  #homeView .home-kpi-gauge svg { width: 96px; height: 96px; }
  #homeView .home-kpi-gauge::before { width: 106px; height: 106px; }
}
/* Profitability uses a quiet previous-period reference; the current value stays in the headline. */
#homeView .home-margin-baseline {
  display: grid; gap: 5px; min-width: 0; margin: 16px 0 0; padding: 13px 14px;
  background: color-mix(in srgb, var(--home-family-accent) 5%, white);
  border: 1px solid color-mix(in srgb, var(--home-family-accent) 15%, #e5eaf0);
  border-radius: 9px;
}
#homeView .home-margin-baseline > span { color: #52677d; font-size: 11px; font-weight: 600; line-height: 1.4; }
#homeView .home-margin-baseline > strong { color: #364c63; font-size: 24px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
#homeView .home-margin-baseline > small { color: #52677d; font-size: 11px; line-height: 1.4; }
/* Revenue cards share the same hierarchy and comparable-period layout. */
#homeView .home-sales-revenue-reading { gap: 7px; }
#homeView .home-sales-revenue-reading > .home-sales-kpi-baseline,
#homeView .home-sales-units-reading > .home-sales-kpi-baseline {
  min-height: 0; color: #52677d; font-size: 11px; font-weight: 500; line-height: 1.4;
}
#homeView .home-sales-units-reading {
  display: grid; gap: 5px; margin-top: 16px; padding-top: 13px;
  border-top: 1px solid color-mix(in srgb, var(--home-family-accent) 18%, #e5eaf0);
}
#homeView .home-sales-units-reading > span:first-child { color: #364c63; font-size: 13px; font-weight: 700; }
#homeView .home-sales-units-total { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
#homeView .home-sales-units-total > strong { color: #10243e; font-size: 29px; font-weight: 750; line-height: 1.1; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
#homeView .home-sales-units-total > small { padding: 4px 6px; border-radius: 6px; font-size: 11px; font-weight: 700; line-height: 1.35; }
#homeView .home-sales-units-total > small.tone-positive { color: #056f50; background: #dcf4e9; }
#homeView .home-sales-units-total > small.tone-negative { color: #b02545; background: #ffe3e9; }
#homeView .home-sales-units-scope { color: #52677d; font-size: 11px; line-height: 1.4; }
@media (min-width: 901px) and (max-width: 1549px), (max-width: 600px) {
  #homeView .home-cockpit-kpi[data-kpi="sales-revenue"] > .home-sales-units-reading,
  #homeView .home-cockpit-kpi[data-kpi="after-sales-revenue"] > .home-sales-units-reading {
    grid-column: 2; grid-row: 2; align-self: center; margin: 0; padding: 0 0 0 12px;
    border-top: 0; border-left: 1px solid color-mix(in srgb, var(--home-family-accent) 18%, #e5eaf0);
  }
}
@media (prefers-reduced-motion: reduce) {
  #homeView .home-cockpit-kpi { transition: none; }
  #homeView .home-cockpit-kpi:hover { transform: none; }
}

/* Brand detail stays off the main reading; its button is separate from the card link. */
#homeView .home-cockpit-kpi-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
#homeView .home-cockpit-kpi-link:focus-visible { outline: 3px solid #0866d9; outline-offset: 3px; }
#homeView .home-kpi-brand-action { grid-column: 1 / -1; margin: 14px 0 12px; }
#homeView .home-kpi-brand-trigger {
  position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 7px;
  min-height: 32px; padding: 6px 11px; border: 1px solid color-mix(in srgb, var(--home-family-accent) 26%, white);
  border-radius: 18px; background: #fff; color: var(--home-family-ink); font-family: inherit; line-height: 1.25; font-size: 11px; font-weight: 650; cursor: pointer;
}
#homeView .home-kpi-brand-trigger:hover, #homeView .home-kpi-brand-trigger[aria-expanded="true"] { color: #fff; background: var(--home-family-accent); border-color: var(--home-family-accent); }
#homeView .home-kpi-brand-trigger:focus-visible { outline: 3px solid #0866d9; outline-offset: 3px; }
.home-brand-popover {
  position: fixed; inset: auto; z-index: 1200; box-sizing: border-box; margin: 0; padding: 22px;
  width: 430px; max-width: calc(100vw - 24px); overflow: auto; overscroll-behavior: contain;
  color: #173049; background: #fff; border: 1px solid #cfdae6; border-radius: 18px;
  box-shadow: 0 20px 64px rgb(0 25 62 / 22%), 0 3px 12px rgb(0 25 62 / 8%);
  font-family: inherit; text-align: left;
}
.home-brand-popover[hidden] { display: none; }
.home-brand-header { position: sticky; top: 0; z-index: 1; background: #fff; display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.home-brand-header > div > span { font-size: 10px; font-weight: 800; letter-spacing: .1em; color: #0866d9; }
.home-brand-header h3 { margin: 5px 0 0; color: #10243e; font-size: 20px; line-height: 1.25; letter-spacing: -.025em; }
.home-brand-close { flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #edf2f7; color: #40566c; font: 24px/1 sans-serif; cursor: pointer; }
.home-brand-close:hover { background: #dce7f2; }
.home-brand-close:focus-visible { outline: 3px solid #0866d9; outline-offset: 2px; }
.home-brand-period { margin: 8px 0 18px; color: #637589; font-size: 12px; line-height: 1.4; }
.home-brand-summary { display: flex; align-items: center; gap: 24px; padding-bottom: 18px; }
.home-brand-donut { position: relative; width: 134px; height: 134px; flex: 0 0 134px; }
.home-brand-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.home-brand-donut circle { fill: none; stroke-width: 14; }
.home-brand-donut > div { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.home-brand-donut strong { color: #10243e; font-size: 26px; letter-spacing: -.04em; }
.home-brand-donut strong > span { font-size: 13px; margin-left: 2px; }
.home-brand-donut small { color: #65788e; font-size: 11px; }
.home-brand-summary > div:last-child { display: grid; gap: 5px; }
.home-brand-summary > div:last-child > span, .home-brand-summary > div:last-child > small { color: #637589; font-size: 11px; }
.home-brand-summary > div:last-child > strong { color: #10243e; font-size: 29px; line-height: 1.2; letter-spacing: -.03em; }
.home-brand-guide { margin: 4px 0 16px; font-size: 12px; color: #52677d; }
.home-brand-rows { list-style: none; padding: 0; margin: 0; }
.home-brand-rows > li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid #e7edf3; }
.home-brand-mark { display: flex; align-items: center; justify-content: center; width: 40px; height: 38px; border-left: 3px solid var(--brand-color); background: #f3f6f9; border-radius: 4px; color: #64758a; }
.home-brand-mark img { width: 30px; height: 24px; object-fit: contain; }
.home-brand-name, .home-brand-values { display: grid; gap: 4px; min-width: 0; }
.home-brand-name > strong { font-size: 12px; line-height: 1.3; color: #233c55; }
.home-brand-name > small { color: #65788e; font-size: 10px; line-height: 1.35; }
.home-brand-values { text-align: right; font-variant-numeric: tabular-nums; }
.home-brand-values > strong { font-size: 17px; color: #173049; line-height: 1.2; }
.home-brand-values > span { font-size: 11px; color: #52677d; white-space: nowrap; }
.home-brand-note { margin: 10px 0 0; padding-top: 12px; border-top: 1px solid #e7edf3; color: #637589; font-size: 11px; line-height: 1.45; }
@media (max-width: 600px) {
  #homeView .home-kpi-brand-action { margin: 0; }
  #homeView .home-kpi-brand-trigger { min-height: 40px; padding: 8px 13px; }
  .home-brand-popover { padding: 18px; }
  .home-brand-summary { gap: 16px; }
  .home-brand-donut { width: 118px; height: 118px; flex-basis: 118px; }
  .home-brand-rows > li { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; }
  .home-brand-mark { width: 35px; }
  .home-brand-name > strong { font-size: 11px; }
  .home-brand-values > strong { font-size: 16px; }
}

/* Explicit boundaries: complete calendar months and the current cut. */
.home-performance-total small { max-width: 230px; color: #65758a; font-size: 11px; line-height: 1.4; }
.home-performance-open-month { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 18px; margin: 0 18px 12px; border-left: 3px solid var(--sw-chart-accent, var(--home-performance-series)); background: #f2f6fa; border-radius: 0 8px 8px 0; }
.home-performance-open-month > div { display: grid; gap: 4px; }
.home-performance-open-month > div:last-child { text-align: right; }
.home-performance-open-month span { color: #213850; font-size: 12px; font-weight: 750; }
.home-performance-open-month strong { color: #14243b; font-size: 20px; }
.home-performance-open-month small { color: #5c6d82; font-size: 11px; line-height: 1.5; }
.psw-payroll-pending { display: inline-block; margin-top: 5px; max-width: 130px; white-space: normal; font-size: 11px; line-height: 1.4; font-weight: 650; color: #68798c; }
.psw-history-year .psw-payroll-pending { margin-top: 0; }
@media (max-width: 600px) {
  .home-performance-open-month { align-items: stretch; flex-direction: column; margin-inline: 12px; padding: 12px; gap: 10px; }
  .home-performance-open-month > div:last-child { text-align: left; }
}

#homeView .home-performance-month-current { fill: var(--sw-chart-accent, var(--home-performance-series)); }
#homeView .is-monthly-reading .home-performance-legend .is-current i { width: 12px; height: 12px; border: 0; border-radius: 2px; background: var(--sw-chart-accent); }
#homeView .is-monthly-reading .home-performance-legend .is-previous i { width: 12px; height: 12px; border: 1px dashed #77879d; border-radius: 2px; background: #abb7c8; }
.home-performance-month-table { display: none; }
@media (max-width: 600px) {
  #homeView .is-monthly-reading .home-performance-chart { min-width: 0; padding: 0; }
  #homeView .is-monthly-reading .home-performance-chart svg { display: none; }
  #homeView .is-monthly-reading .home-performance-legend { display: none; }
  #homeView .home-performance-month-table { display: table; width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
  #homeView .home-performance-month-table caption { padding: 12px; color: #5c6d82; text-align: left; }
  #homeView .home-performance-month-table th, #homeView .home-performance-month-table td { padding: 12px 7px; border-top: 1px solid #e1e8f0; text-align: right; overflow-wrap: anywhere; }
  #homeView .home-performance-month-table th:first-child { text-align: left; }
  #homeView .home-performance-month-table td:first-of-type { color: var(--sw-chart-accent); font-weight: 750; }
}
