/* AL Mohandes Automotive V4.24 — Consistent centered dashboard KPIs.
   Pure presentation change. No business logic, database or print template changes. */
@media screen {
  /* Logistics: four equal KPI tiles, centered values and captions */
  .lg-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
  }
  .lg-kpis > div {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 126px;
    gap: 8px;
    padding: 18px 12px;
  }
  .lg-kpis strong {
    display: block;
    margin: 0;
    font-size: clamp(28px, 2.5vw, 36px);
    font-weight: 790;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
  }
  .lg-kpis span {
    display: block;
    max-width: 100%;
    margin: 0;
    font-size: 13px;
    font-weight: 620;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: break-word;
  }
  /* Executive dashboard: same centered typographic rhythm across all counters. */
  #main .cards .card {
    min-width: 0;
    min-height: 132px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
  }
  #main .cards .card::before {
    flex: 0 0 3px;
    margin-inline: auto;
  }
  #main .cards .card > span,
  #main .cards .card > strong {
    width: 100%;
    margin: 0;
    text-align: center;
    overflow-wrap: anywhere;
  }
  #main .cards .card > span { font-size: 13px; line-height: 1.4; }
  #main .cards .card > strong { line-height: 1.18; }
  /* Nine executive metrics form a balanced 3 by 3 grid on desktop. */
  @media (min-width: 1201px) {
    #main .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  /* Customer-service KPIs: centered labels and monetary values. */
  #main .aftersales-stats > div {
    box-sizing: border-box;
    min-width: 0;
    min-height: 112px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 18px 12px;
    text-align: center;
  }
  #main .aftersales-stats small,
  #main .aftersales-stats strong {
    max-width: 100%;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
  }
  #main .aftersales-stats small { font-size: 13px; font-weight: 620; }
  #main .aftersales-stats strong { font-variant-numeric: tabular-nums; }
  /* Financial metrics were already centered; lock their height for symmetry. */
  #main .ama-fincard { min-height: 106px; }
  @media (max-width: 900px) {
    .lg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  }
  @media (max-width: 600px) {
    .lg-kpis { gap: 9px; }
    .lg-kpis > div { min-height: 108px; padding: 13px 8px; gap: 7px; }
    .lg-kpis strong { font-size: 29px; }
    .lg-kpis span { font-size: 11px; }
    #main .cards .card { min-height: 120px; gap: 8px; }
    #main .aftersales-stats > div { min-height: 104px; }
  }
  /* The ninth item on a two-column executive grid stays horizontally centered. */
  @media (min-width: 361px) and (max-width: 1200px) {
    #main .cards > .card:last-child:nth-child(odd) {
      grid-column: 1 / -1;
      width: calc((100% - 16px) / 2);
      justify-self: center;
    }
  }
  @media (min-width: 361px) and (max-width: 760px) {
    #main .cards > .card:last-child:nth-child(odd) {
      width: calc((100% - 10px) / 2);
    }
  }
  @media (max-width: 360px) {
    #main .cards { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  }
}
