/* Extend the existing navy, blue and green dashboard palette. */
.app main { max-width: 1600px; }
.app .topbar { display: block; padding: 0; background: transparent; border: 0; box-shadow: none; margin-bottom: 20px; }
.app .topbar > div:first-child { min-width: 0; }
.app .topbar h2 { font-size: clamp(1.5rem, 2.2vw, 2rem); letter-spacing: -.025em; }
.app .topbar p { font-size: 14px; line-height: 1.6; max-width: 65ch; }
.dashboard-filters { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.dashboard-filters > summary { cursor: pointer; padding: 14px 18px; min-height: 48px; font-weight: 650; font-size: 14px; }
.dashboard-filter-summary { color: var(--muted); font-weight: 400; margin-left: 12px; }
.dashboard-filters .toolbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; padding: 4px 16px 16px; }
.dashboard-filters .toolbar > :is(select, input, button, label) { min-width: 0; width: 100%; font-size: 14px; }
.dashboard-filters .toolbar .period-label { grid-column: 1 / -1; }
.dashboard-filters summary:focus-visible, .sync-box summary:focus-visible { outline: 3px solid #84b8eb; outline-offset: 3px; }
.dashboard-kpis.kpis { display: block; margin-bottom: 28px; }
.dashboard-primary { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 18px; align-items: stretch; }
.dashboard-kpis .card, #dashboardView .card { border-radius: 16px; box-shadow: 0 4px 16px rgba(21, 33, 48, .045); }
.dashboard-kpis .kpi { padding: 22px; min-height: 0; }
.dashboard-kpis .label { font-size: 14px; line-height: 1.45; letter-spacing: .01em; text-transform: none; font-weight: 600; }
.dashboard-kpis .value { font-variant-numeric: tabular-nums; font-size: clamp(1.5rem, 2vw, 2rem); line-height: 1.2; white-space: normal; overflow-wrap: anywhere; letter-spacing: -.035em; margin-top: 12px; }
.dashboard-kpis .sub { font-size: 14px; line-height: 1.55; margin-top: 12px; color: var(--muted); }
.dashboard-kpis .monthly-net { color: #fff; border-color: #153e47; background: #153e47; }
.monthly-net .label { color: #d4e9e9; }
.monthly-net .month-caption { display: inline-block; color: #b6dcdb; font-size: 14px; margin-bottom: 12px; }
.monthly-net #kpiNetMonthlySales { font-size: clamp(1.9rem, 2.7vw, 2.6rem); color: white; }
.monthly-net #kpiNetMonthlySalesSub { color: #d4e9e9; margin-top: 8px; }
.monthly-credit { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid #3f6269; margin-top: 22px; padding-top: 16px; }
.monthly-credit > div:first-child { flex: 1; min-width: 0; }
.monthly-credit .value { font-size: clamp(1.1rem, 1.5vw, 1.5rem); margin: 0; flex: 0 0 auto; text-align: right; white-space: nowrap; overflow-wrap: normal; }
.monthly-credit .label { color: #d4e9e9; }
.monthly-credit #kpiCreditNotesSub { color: #c0d8dc; font-size: 13px; margin-top: 4px; }
.metric-actual { display: block; }
.metric-target { display: block; margin-top: 8px; font-size: 14px; line-height: 1.5; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.dashboard-target progress { appearance: none; width: 100%; height: 6px; border: 0; border-radius: 8px; overflow: hidden; background: #e9eff5; margin-top: 22px; }
.dashboard-target progress::-webkit-progress-bar { background: #e9eff5; border-radius: 8px; }
.dashboard-target progress::-webkit-progress-value { background: #367db5; border-radius: 8px; }
.dashboard-target progress::-moz-progress-bar { background: #367db5; border-radius: 8px; }
.dashboard-target.ytd-target progress::-webkit-progress-value { background: #348271; }
.dashboard-target.ytd-target progress::-moz-progress-bar { background: #348271; }
.dashboard-section-title { font-size: 14px; color: var(--muted); margin: 24px 0 12px; font-weight: 600; }
.dashboard-secondary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dashboard-secondary .kpi { padding: 18px; }
.dashboard-secondary .value { font-size: clamp(1.25rem, 1.7vw, 1.65rem); }
.dashboard-secondary .sub { font-size: 13px; margin-top: 8px; }
.dashboard-secondary #kpiCollectionTarget { font-size: clamp(1.25rem, 1.7vw, 1.65rem); }
#dashboardView { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
#dashboardView > .grid { display: contents; }
#dashboardView > .card:first-child, #dashboardView > .grid > .card:nth-child(n) { grid-column: auto; grid-row: auto; }
#dashboardView > .card:first-child, #dashboardView > .grid > .card:nth-child(5), #dashboardView > .grid > .card:nth-child(6), #dashboardView > .grid > .card:nth-child(7) { grid-column: 1 / -1; }
#dashboardView .panel-head { padding: 18px 20px 12px; gap: 12px; flex-wrap: wrap; }
#dashboardView .panel-head h3 { font-size: 16px; }
#dashboardView .panel { padding: 18px 20px; }
#dashboardView .period-toggle button { min-height: 36px; font-size: 14px; }
#dashboardView .rank-item { border-radius: 10px; box-shadow: none; }
.sync-box > summary { cursor: pointer; font-weight: 600; font-size: 14px; line-height: 1.5; }
.sync-content { margin-top: 14px; }
.sync-content .note { color: #aabfcd; line-height: 1.6; }
.sync-content #currentUserLabel { overflow-wrap: anywhere; }
.sync-content #logoutBtn { margin-top: 12px; }
.cn-detail-card { margin: 20px 0; }
#creditNotesView .card { border-radius: 16px; box-shadow: 0 4px 16px rgba(21, 33, 48, .045); }
#creditNotesView .cn-summary { gap: 12px; margin: 16px 0; }
#creditNotesView .cn-summary .value { font-size: clamp(1.25rem, 1.7vw, 1.6rem); white-space: normal; }
#creditNotesView .cn-summary .label { font-size: 14px; text-transform: none; letter-spacing: 0; }
#creditNotesView .cn-summary .sub { font-size: 13px; }
#creditNotesView .cn-status { margin-top: 14px; font-size: 14px; }
#creditNotesView .cn-controls select, #creditNotesView .cn-controls input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f9fbfd; font-size: 16px; min-width: 0; }
#creditNotesView .cn-detail-card .panel-head { align-items: center; flex-wrap: wrap; gap: 8px; }
#creditNotesView .cn-detail-card .cn-table-wrap { margin-top: 18px; max-height: none; }
#creditNotesView .cn-table-wrap { scrollbar-width: thin; }
@media(max-width: 1250px) {
  .dashboard-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-primary .monthly-net { grid-column: 1 / -1; }
  .dashboard-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media(max-width: 980px) {
  .app .sidebar { padding: 10px 12px 8px; box-shadow: 0 3px 14px rgba(16,34,48,.12); }
  .sidebar .nav { gap: 6px; }
  .sidebar .nav button { min-height: 40px; border-radius: 9px; font-size: 14px; }
  .sidebar .nav button.active { background: white; color: #102230; }
  .sidebar .sync-box { display: block; padding-top: 8px; margin-top: 8px; }
  .sidebar .sync-box > summary { color: #b5cbd6; font-size: 13px; padding: 2px 0 5px; }
  .sidebar .sync-content { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; }
  .sidebar .sync-content .note, .sidebar .sync-refresh { grid-column: 1 / -1; }
  .sidebar .sync-content #logoutBtn { width: auto !important; margin: 0 !important; min-height: 36px; }
  .app main { padding: 20px 16px 28px; }
  .page-brand { display: none; }
  .app .topbar { margin-bottom: 18px; }
  .dashboard-filters { margin-top: 14px; }
  .dashboard-filters .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-filter-summary { display: block; margin: 4px 0 0 14px; font-size: 13px; }
  .dashboard-primary { gap: 12px; }
  .dashboard-kpis .kpi { padding: 18px; }
  .dashboard-kpis .value { font-size: clamp(1.25rem, 4.3vw, 1.8rem); }
  .dashboard-primary .monthly-net { padding: 22px; }
  .dashboard-primary .monthly-net #kpiNetMonthlySales { font-size: clamp(1.8rem, 6vw, 2.5rem); }
  .monthly-credit { margin-top: 18px; padding-top: 14px; }
  .dashboard-secondary { gap: 12px; }
  #dashboardView { grid-template-columns: 1fr; gap: 16px; }
  #dashboardView .panel-head { padding: 16px 16px 12px; }
  #dashboardView .panel { padding: 16px; }
  #creditNotesView .cn-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #creditNotesView .cn-summary .kpi { padding: 16px; }
  #cnDetailTable { min-width: 980px; }
}
@media(max-width: 380px) {
  .dashboard-primary, .dashboard-secondary, #creditNotesView .cn-summary { grid-template-columns: 1fr; }
  .dashboard-kpis .value { font-size: 1.5rem; }
}
