/* ==========================================================================
   TUPAD — Dashboard presentation layer
   --------------------------------------------------------------------------
   Visual styling only for the dashboard landing pages under pages/dashboard/:
   Budget Officer, EPWW Focal / Cashier, PO Focal and PO TC.

   Scope rules for anyone editing this file:
   - Everything is namespaced `dsh-` so it cannot collide with the legacy
     `.dashboard-*` rules still sitting in custom.css.
   - No rule here changes a value, a dataset or a filter. The markup keeps the
     exact ids, the `.dropdown` / `.dropdown-menu` / `.dropdown-item` /
     `.active` contract and the bar nesting that controllers/dashboard/*.js
     already drives, so the JS was not re-wired for the redesign.
   ========================================================================== */

.dsh {
  --dsh-surface: #ffffff;
  --dsh-canvas: #f6f8fb;
  --dsh-ink: #101828;
  --dsh-ink-2: #475467;
  --dsh-muted: #667085;
  --dsh-line: #e4e9f0;
  --dsh-line-soft: #eef2f6;

  /* One accent per metric, used identically on every dashboard. */
  --dsh-alloc: #1c4e80;
  --dsh-alloc-soft: #eaf1f9;
  --dsh-util: #b45309;
  --dsh-util-soft: #fdf2e4;
  /* green-800 rather than green-700: on the soft tint behind the icon,
     green-700 only reached 4.4:1. */
  --dsh-disb: #146b36;
  --dsh-disb-soft: #e8f4ec;

  --dsh-radius: 12px;
  --dsh-radius-sm: 8px;
  --dsh-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --dsh-shadow-hover: 0 8px 18px rgba(16, 24, 40, 0.08), 0 2px 6px rgba(16, 24, 40, 0.05);

  color: var(--dsh-ink);
}

.tupad-dashboard-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #f4f7fb;
  border-radius: 16px;
}

.tupad-dashboard-page::before {
  content: "";
  position: absolute;
  inset: -72px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.78;
  filter: blur(24px);
  background:
    radial-gradient(circle at 24% 24%, rgba(220, 53, 69, 0.2), transparent 24%),
    radial-gradient(circle at 56% 20%, rgba(255, 193, 7, 0.24), transparent 22%),
    radial-gradient(circle at 76% 52%, rgba(13, 110, 253, 0.18), transparent 30%);
  transform: scale(1.03);
}

/* The DOLE logo as a watermark, on its own layer so the glow blur above does
   not smear it. Centred in the first screen of the dashboard (below the
   70px top bar); the floor keeps the tip from being cut on short screens. */
.tupad-dashboard-page::after {
  content: "";
  position: absolute;
  top: max(calc(50vh - 35px), 360px);
  left: 50%;
  z-index: 0;
  width: min(58vw, 720px);
  aspect-ratio: 101 / 96;
  transform: translate(-50%, -50%) scale(1.03);
  pointer-events: none;
  opacity: 0.16;
  /* Soft focus so the watermark sits behind the cards; the SVG keeps the
     edges smooth instead of pixelated. */
  filter: blur(50px);
  background: url("../img/dole-system-logo-triangle.svg") center / contain no-repeat;
}

.tupad-dashboard-page > * {
  position: relative;
  z-index: 1;
}

/* Large monitors: stop the grid from stretching into unreadable rows. */
@media (min-width: 1600px) {
  .dsh {
    max-width: 1640px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Peso figures line up column-to-column instead of drifting. */
.dsh .dsh-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* kaiadmin.min.css ships a global `:focus { outline: 0 !important }`, which
   leaves keyboard users with no visible focus anywhere. Undo it for the
   dashboard only — `!important` is required to outrank it, and `:focus-visible`
   keeps the ring off mouse clicks. No border-radius here: the outline already
   follows each control's own corners. */
.dsh :focus-visible {
  outline: 2px solid var(--dsh-alloc) !important;
  outline-offset: 2px !important;
}

/* --------------------------------------------------------------------------
   1. Page heading
   -------------------------------------------------------------------------- */

.dsh-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0 1.25rem;
}

.dsh-head__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--dsh-ink);
  margin: 0;
}

.dsh-head__sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--dsh-muted);
}

.dsh-head__sub .dsh-head__scope {
  color: var(--dsh-alloc);
  font-weight: 600;
}

.dsh-head__aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.dsh-head__date {
  font-size: 0.78rem;
  color: var(--dsh-muted);
  white-space: nowrap;
}

.dsh-head__date i {
  margin-right: 0.3rem;
  opacity: 0.8;
}

@media (max-width: 575.98px) {
  .dsh-head {
    align-items: stretch;
    gap: 0.75rem;
    padding-bottom: 1rem;
  }
  .dsh-head__title {
    font-size: 1.25rem;
  }
  .dsh-head__aside {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   2. Quarter filter (segmented control)
   --------------------------------------------------------------------------
   The wrapper keeps `.dropdown` and the track keeps `.dropdown-menu` purely
   because controllers/dashboard/*.js selects through them
   (`$("#…QuarterFilterBtn").closest(".dropdown").find("[data-quarter]")` and
   `$(".dropdown-menu [data-quarter]")`). Bootstrap dropdown behaviour is not
   used any more — `data-bs-toggle` is gone from the markup and the track is
   laid out statically here. Do not rename these two classes without changing
   the four controllers in the same commit.
   -------------------------------------------------------------------------- */

.dsh-qf {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
}

.dsh-qf__legend {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dsh-muted);
  white-space: nowrap;
}

/* Announced to screen readers when the quarter changes; the controllers
   already write the full quarter name into this element. */
.dsh-qf__live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dsh-qf .dsh-qf__track {
  position: static;
  display: inline-flex;
  float: none;
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 3px;
  gap: 2px;
  inset: auto;
  transform: none;
  background: var(--dsh-line-soft);
  border: 1px solid var(--dsh-line);
  border-radius: 999px;
  /* kaiadmin.css sets a !important drop shadow on every .dropdown-menu. */
  box-shadow: none !important;
  list-style: none;
  overflow: visible;
}

.dsh-qf .dsh-qf__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 2.75rem;
  padding: 0.35rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--dsh-ink-2);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  clear: none;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dsh-qf .dsh-qf__btn:hover,
.dsh-qf .dsh-qf__btn:focus {
  background: rgba(28, 78, 128, 0.08);
  color: var(--dsh-alloc);
}

.dsh-qf .dsh-qf__btn.active,
.dsh-qf .dsh-qf__btn.active:hover,
.dsh-qf .dsh-qf__btn.active:focus {
  background: var(--dsh-alloc);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.15);
}

.dsh-qf__btn-long {
  display: inline;
}

.dsh-qf__btn-short {
  display: none;
}

@media (max-width: 767.98px) {
  .dsh-qf {
    width: 100%;
  }
  .dsh-qf .dsh-qf__track {
    flex: 1 1 auto;
    justify-content: space-between;
  }
  .dsh-qf .dsh-qf__btn {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .dsh-qf__btn-long {
    display: none;
  }
  .dsh-qf__btn-short {
    display: inline;
  }
}

/* --------------------------------------------------------------------------
   3. Shared card shell
   -------------------------------------------------------------------------- */

.dsh-card {
  height: 100%;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 1) 0%,
      rgba(248, 251, 255, 0.96) 100%
    );
  border: 1px solid var(--dsh-line);
  border-radius: var(--dsh-radius);
  box-shadow: var(--dsh-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dsh-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--dsh-line-soft);
}

.dsh-card__title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dsh-ink);
}

.dsh-card__title i {
  color: var(--dsh-muted);
  font-size: 0.875rem;
}

.dsh-card__tag {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--dsh-line-soft);
  color: var(--dsh-ink-2);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.dsh-card__body {
  padding: 1.125rem 1.25rem 1.25rem;
}

.dsh-card--progress {
  --dsh-progress-accent: var(--dsh-alloc);
  position: relative;
  overflow: hidden;
}

.dsh-card--progress::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--dsh-progress-accent),
    rgba(28, 78, 128, 0.28)
  );
}

.dsh-card__head--progress {
  align-items: center;
}

.dsh-progress-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.dsh-progress-filter__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dsh-muted);
}

.dsh-progress-filter__select {
  min-width: 9rem;
  padding: 0.35rem 2rem 0.35rem 0.75rem;
  border: 1px solid var(--dsh-line);
  border-radius: 999px;
  background-color: var(--dsh-surface);
  color: var(--dsh-ink-2);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dsh-progress-filter__select:hover {
  border-color: var(--dsh-progress-accent);
}

/* --------------------------------------------------------------------------
   4. KPI cards
   -------------------------------------------------------------------------- */

.dsh-kpi {
  position: relative;
  height: 100%;
  padding: 1.125rem 1.25rem 1.25rem;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 1) 0%,
      var(--dsh-kpi-tint, rgba(248, 251, 255, 0.72)) 170%
    );
  border: 1px solid var(--dsh-line);
  border-radius: var(--dsh-radius);
  box-shadow: var(--dsh-shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Thin accent strip — the tint carries the metric, the card stays white. */
.dsh-kpi::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--dsh-kpi-accent, var(--dsh-alloc));
}

.dsh-kpi__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.dsh-kpi__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--dsh-radius-sm);
  background: var(--dsh-kpi-tint, var(--dsh-alloc-soft));
  color: var(--dsh-kpi-accent, var(--dsh-alloc));
  font-size: 0.8125rem;
}

.dsh-kpi__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--dsh-muted);
}

.dsh-kpi__value {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--dsh-ink);
  /* Long peso figures wrap instead of widening the card. */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dsh-kpi__meta {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: var(--dsh-muted);
}

.dsh-kpi--alloc {
  --dsh-kpi-accent: var(--dsh-alloc);
  --dsh-kpi-tint: var(--dsh-alloc-soft);
}

.dsh-kpi--util {
  --dsh-kpi-accent: var(--dsh-util);
  --dsh-kpi-tint: var(--dsh-util-soft);
}

.dsh-kpi--disb {
  --dsh-kpi-accent: var(--dsh-disb);
  --dsh-kpi-tint: var(--dsh-disb-soft);
}

@media (max-width: 991.98px) {
  .dsh-kpi__value {
    font-size: 1.4375rem;
  }
}

@media (max-width: 400px) {
  .dsh-kpi {
    padding: 1rem 1rem 1.0625rem;
  }
  .dsh-kpi__value {
    font-size: 1.3125rem;
  }
}

/* --------------------------------------------------------------------------
   5. Province cards
   -------------------------------------------------------------------------- */

/* Province identity.
   --------------------------------------------------------------------------
   These five colours are the ORIGINAL dashboard colours, recovered from the
   pre-redesign markup — do not substitute a new mapping, current users
   recognise these:

     Cavite   #f9a825 → #fdd835   (amber)
     Laguna   #e65100 → #ff9800   (deep orange)
     Batangas #2e7d32 → #43a047   (green)
     Rizal    #1565c0 → #1e88e5   (blue)
     Quezon   #ad1457 → #e91e63   (magenta)

   The old full-bleed gradient header band is now a 4px top rule using that
   same gradient, plus an 8% wash of the base behind the province name. The
   province colour never has to carry text: `--dsh-prov-on` is plain black or
   white, picked per province so the badge clears WCAG AA against the original
   colour itself. No shade here is derived or invented.

   Metric colours inside the card stay navy/amber/green on every province, so
   Allocated in Cavite is still comparable with Allocated in Rizal. */

.dsh-prov--cavite {
  --dsh-prov-base: #f9a825;
  --dsh-prov-lite: #fdd835;
  --dsh-prov-tint: #fff8ee;
  --dsh-prov-on: #101828;
}

.dsh-prov--laguna {
  --dsh-prov-base: #e65100;
  --dsh-prov-lite: #ff9800;
  --dsh-prov-tint: #fdf1eb;
  --dsh-prov-on: #101828;
}

.dsh-prov--batangas {
  --dsh-prov-base: #2e7d32;
  --dsh-prov-lite: #43a047;
  --dsh-prov-tint: #eef5ef;
  --dsh-prov-on: #ffffff;
}

.dsh-prov--rizal {
  --dsh-prov-base: #1565c0;
  --dsh-prov-lite: #1e88e5;
  --dsh-prov-tint: #ecf3fa;
  --dsh-prov-on: #ffffff;
}

.dsh-prov--quezon {
  --dsh-prov-base: #ad1457;
  --dsh-prov-lite: #e91e63;
  --dsh-prov-tint: #f8ecf2;
  --dsh-prov-on: #ffffff;
}

.dsh-prov {
  height: 100%;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 1) 0%,
      rgba(255, 255, 255, 0.94) 58%,
      var(--dsh-prov-tint, #fbfcfe) 150%
    );
  border: 1px solid var(--dsh-line);
  border-radius: var(--dsh-radius);
  box-shadow: var(--dsh-shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* The original header gradient, kept verbatim, slimmed to a top rule. */
.dsh-prov::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--dsh-prov-base, var(--dsh-line)),
    var(--dsh-prov-lite, var(--dsh-line))
  );
}

.dsh-prov__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1.125rem;
  background: var(--dsh-prov-tint, #fbfcfe);
  border-bottom: 1px solid var(--dsh-line-soft);
}

.dsh-prov__name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dsh-ink);
}

/* Neutral, not the province colour: on the pale tints an amber or orange
   glyph would sit around 1.9:1. The top rule and the wash carry the colour. */
.dsh-prov__name i {
  color: var(--dsh-ink-2);
  font-size: 0.75rem;
}

/* The quarter badge is the province's own original colour at full strength.
   Toggled by jQuery .show()/.hide(), so keep a display value in the
   stylesheet for .show() to restore to. */
.dsh-prov__badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--dsh-prov-base, var(--dsh-alloc));
  color: var(--dsh-prov-on, #ffffff);
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
}

.dsh-prov__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0.25rem 0.25rem 0.5rem;
}

.dsh-prov__metric {
  min-width: 0;
  padding: 0.75rem 0.875rem;
}

.dsh-prov__metric + .dsh-prov__metric {
  border-left: 1px solid var(--dsh-line-soft);
}

.dsh-prov__label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.3rem;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dsh-muted);
}

.dsh-prov__label i {
  font-size: 0.66rem;
  color: var(--dsh-metric-accent, var(--dsh-alloc));
}

.dsh-prov__value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--dsh-ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dsh-prov__track {
  height: 5px;
  margin-top: 0.5rem;
  border-radius: 999px;
  background: var(--dsh-line-soft);
  overflow: hidden;
}

/* Width is set inline by the controllers — never declare one here. */
.dsh-prov__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--dsh-metric-accent, var(--dsh-alloc));
  transition: width 0.45s ease;
}

.dsh-m--alloc {
  --dsh-metric-accent: var(--dsh-alloc);
}

.dsh-m--util {
  --dsh-metric-accent: var(--dsh-util);
}

.dsh-m--disb {
  --dsh-metric-accent: var(--dsh-disb);
}

@media (hover: hover) and (pointer: fine) {
  .dsh-card:hover,
  .dsh-kpi:hover,
  .dsh-prov:hover {
    transform: translateY(-2px);
    box-shadow: var(--dsh-shadow-hover);
  }

  .dsh-card:hover {
    border-color: #d5dde8;
  }

  .dsh-kpi:hover {
    border-color: var(--dsh-kpi-accent, var(--dsh-alloc));
  }

  .dsh-prov:hover {
    border-color: var(--dsh-prov-base, var(--dsh-line));
    background:
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.94) 50%,
        var(--dsh-prov-tint, #fbfcfe) 120%
      );
  }
}

.dsh-card:focus-visible,
.dsh-kpi:focus-visible,
.dsh-prov:focus-visible,
.dsh-card:focus-within,
.dsh-kpi:focus-within,
.dsh-prov:focus-within {
  border-color: var(--dsh-alloc);
  box-shadow: var(--dsh-shadow-hover);
}

/* Below `sm` three columns of peso figures stop being readable, so each
   metric becomes a full-width row instead. */
@media (max-width: 575.98px) {
  .dsh-prov__grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.25rem 0.5rem 0.625rem;
  }
  .dsh-prov__metric {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    padding: 0.625rem 0.5rem;
  }
  .dsh-prov__metric + .dsh-prov__metric {
    border-left: 0;
    border-top: 1px solid var(--dsh-line-soft);
  }
  .dsh-prov__label {
    margin-bottom: 0;
  }
  .dsh-prov__value {
    text-align: right;
    font-size: 0.9375rem;
  }
  .dsh-prov__track {
    grid-column: 1 / -1;
    margin-top: 0.125rem;
  }
}

/* --------------------------------------------------------------------------
   6. Quarter breakdown strip (PO Focal / PO TC)
   -------------------------------------------------------------------------- */

.dsh-qgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dsh-qgrid__cell {
  min-width: 0;
  padding: 0.25rem 1rem;
}

.dsh-qgrid__cell + .dsh-qgrid__cell {
  border-left: 1px solid var(--dsh-line-soft);
}

.dsh-qgrid__label {
  margin-bottom: 0.3rem;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dsh-muted);
}

.dsh-qgrid__value {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--dsh-ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dsh-qgrid__track {
  height: 4px;
  margin-top: 0.5rem;
  border-radius: 999px;
  background: var(--dsh-line-soft);
  overflow: hidden;
}

.dsh-qgrid__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--dsh-alloc);
  transition: width 0.45s ease;
}

@media (max-width: 767.98px) {
  .dsh-qgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dsh-qgrid__cell {
    padding: 0.625rem 0.75rem;
  }
  .dsh-qgrid__cell + .dsh-qgrid__cell {
    border-left: 0;
  }
  .dsh-qgrid__cell:nth-child(even) {
    border-left: 1px solid var(--dsh-line-soft);
  }
  .dsh-qgrid__cell:nth-child(n + 3) {
    border-top: 1px solid var(--dsh-line-soft);
  }
}

/* --------------------------------------------------------------------------
   7. Charts
   -------------------------------------------------------------------------- */

.dsh-chart {
  position: relative;
  width: 100%;
  height: 300px;
  /* Chart.js 2.x resizes its canvas a tick after the container narrows. Until
     it catches up the canvas is still at its old width, so clip it here rather
     than let it push the whole page into a horizontal scroll. */
  overflow: hidden;
}

.dsh-chart--donut {
  height: 280px;
}

.dsh-chart--progress {
  height: 320px;
}

@media (max-width: 991.98px) {
  .dsh-chart {
    height: 280px;
  }
  .dsh-chart--progress {
    height: 300px;
  }
}

@media (max-width: 575.98px) {
  .dsh-chart,
  .dsh-chart--donut {
    height: 240px;
  }
  .dsh-card__head--progress {
    align-items: stretch;
  }
  .dsh-progress-filter,
  .dsh-progress-filter__select {
    width: 100%;
  }
  .dsh-chart--progress {
    height: 260px;
  }
}

/* --------------------------------------------------------------------------
   8. "For Your Action" operational strip
   -------------------------------------------------------------------------- */

.dsh-fya-card {
  display: grid;
  grid-template-columns: minmax(0, auto) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 5rem;
  padding: 1rem 1.125rem;
  border: 1px solid #f3d29a;
  border-radius: var(--dsh-radius);
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 1) 0%,
      rgba(255, 251, 244, 0.98) 100%
    );
  box-shadow: var(--dsh-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dsh-fya-card--empty {
  grid-template-columns: minmax(0, 1fr);
  border-color: var(--dsh-line);
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 1) 0%,
      rgba(248, 251, 255, 0.96) 100%
    );
}

.dsh-fya-card__main {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.dsh-fya-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--dsh-radius-sm);
  background: #fff4df;
  color: var(--dsh-util);
  font-size: 0.95rem;
}

.dsh-fya-card__icon--success {
  background: var(--dsh-disb-soft);
  color: var(--dsh-disb);
}

.dsh-fya-card__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dsh-ink);
  line-height: 1.25;
}

.dsh-fya-card__sub {
  margin-top: 0.125rem;
  font-size: 0.76rem;
  color: var(--dsh-muted);
  line-height: 1.35;
}

.dsh-fya-card__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  height: 2.25rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: var(--dsh-util);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.dsh-fya-card__items {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
}

.dsh-fya-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.42rem 0.55rem 0.42rem 0.65rem;
  border: 1px solid rgba(28, 78, 128, 0.16);
  border-radius: 999px;
  background: rgba(28, 78, 128, 0.06);
  color: var(--dsh-ink-2);
  font-size: 0.76rem;
  font-weight: 600;
}

.dsh-fya-chip--warning {
  border-color: rgba(180, 83, 9, 0.2);
  background: rgba(180, 83, 9, 0.08);
}

.dsh-fya-chip__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dsh-fya-chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(28, 78, 128, 0.12);
  color: var(--dsh-alloc);
  font-size: 0.7rem;
  font-weight: 800;
}

.dsh-fya-chip--warning .dsh-fya-chip__count {
  background: rgba(180, 83, 9, 0.14);
  color: var(--dsh-util);
}

@media (hover: hover) and (pointer: fine) {
  .dsh-fya-card:hover {
    transform: translateY(-2px);
    border-color: #efbd69;
    box-shadow: var(--dsh-shadow-hover);
  }
}

@media (max-width: 767.98px) {
  .dsh-fya-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.8rem;
  }
  .dsh-fya-card__main {
    align-items: flex-start;
  }
  .dsh-fya-card__count {
    justify-self: start;
  }
  .dsh-fya-card__items {
    justify-content: flex-start;
  }
}

/* --------------------------------------------------------------------------
   9. Section rhythm — sections breathe, cards never touch.
   -------------------------------------------------------------------------- */

.dsh-section {
  margin-bottom: 1.5rem;
}

.dsh-section:last-child {
  margin-bottom: 0;
}

@media (min-width: 992px) {
  .dsh-section {
    margin-bottom: 1.75rem;
  }
}
