/* Eximious Tech ERP — mobile statistics clarity layer.
   Loaded last so charts remain readable after the premium and command-centre themes. */

.mobile-chart-values,
.command-mobile-value,
.mobile-chart-scroll-hint {
  display: none;
}

@media (max-width: 820px) {
  .mobile-chart-scroll-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
    padding: 8px 10px;
    border: 1px solid color-mix(in srgb, var(--primary, #1769e0) 22%, var(--line, #dce4ee));
    border-radius: 10px;
    background: color-mix(in srgb, var(--blue-soft, #eaf3ff) 80%, var(--surface, #fff));
    color: var(--muted, #64748b);
    font-size: 10px;
    font-weight: 750;
    line-height: 1.35;
  }

  .mobile-chart-scroll-hint::before {
    content: "↔";
    color: var(--primary, #1769e0);
    font-size: 16px;
    font-weight: 900;
  }

  /* Main dashboard: revenue, expenses and profit. */
  .multi-chart {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 322px !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 12px 8px 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-color: var(--primary, #1769e0) var(--surface-2, #f0f4f9);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .multi-group {
    flex: 0 0 92px !important;
    width: 92px !important;
    min-width: 92px !important;
    min-height: 286px;
    justify-content: flex-end;
    padding: 10px 7px 9px;
    scroll-snap-align: start;
    border: 1px solid var(--line, #dce4ee);
    border-radius: 13px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2, #f0f4f9) 58%, var(--surface, #fff)), var(--surface, #fff));
  }

  .multi-bars {
    position: relative;
    width: 100% !important;
    height: 176px !important;
    min-height: 176px !important;
    gap: 7px !important;
    padding: 8px 6px 0;
    overflow: hidden;
    border-bottom: 2px solid color-mix(in srgb, var(--muted, #64748b) 38%, transparent);
    border-radius: 9px 9px 3px 3px;
    background: repeating-linear-gradient(
      to top,
      transparent 0,
      transparent 43px,
      color-mix(in srgb, var(--line, #dce4ee) 74%, transparent) 44px
    );
  }

  .multi-bars i {
    width: 25px !important;
    min-width: 25px !important;
    border-radius: 7px 7px 2px 2px !important;
    box-shadow: 0 4px 10px color-mix(in srgb, currentColor 18%, transparent);
  }

  .multi-group > span {
    margin-top: 8px !important;
    color: var(--text, #182230) !important;
    font-size: 12px !important;
    font-weight: 850;
    letter-spacing: .03em;
  }

  .multi-group > small {
    display: block;
    max-width: 78px;
    margin-top: 3px !important;
    overflow: hidden;
    font-size: 9px !important;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
  }

  .mobile-chart-values {
    display: grid;
    width: 100%;
    gap: 4px;
    margin-top: 7px;
  }

  .mobile-chart-values span {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 4px 5px;
    border-radius: 7px;
    background: var(--surface-2, #f0f4f9);
    font-size: 8px;
    line-height: 1.2;
  }

  .mobile-chart-values b {
    width: 6px;
    height: 6px;
    overflow: hidden;
    border-radius: 2px;
    color: transparent;
  }

  .mobile-chart-values .revenue b { background: var(--primary, #1769e0); }
  .mobile-chart-values .expense b { background: var(--danger, #cf3545); }

  .mobile-chart-values em {
    min-width: 0;
    overflow: hidden;
    color: var(--text, #182230);
    font-style: normal;
    font-weight: 800;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chart-legend {
    position: sticky;
    left: 0;
    justify-content: flex-start !important;
    gap: 14px !important;
    padding: 8px 2px 0;
    font-size: 11px !important;
    font-weight: 750;
  }

  /* Administrator command centre: forecast history and projected collections. */
  .command-chart {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 304px !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 12px 8px 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-color: #35a7ff rgba(255,255,255,.12);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .command-bar-column {
    flex: 0 0 88px !important;
    width: 88px !important;
    min-width: 88px !important;
    min-height: 272px;
    justify-content: flex-end;
    padding: 8px 7px 9px;
    scroll-snap-align: start;
    border: 1px solid rgba(136, 188, 237, .2);
    border-radius: 13px;
    background: rgba(9, 39, 74, .42);
  }

  .command-bar-track {
    width: 100% !important;
    height: 204px !important;
    min-height: 204px !important;
    padding: 7px 9px 0;
    border-bottom: 2px solid rgba(167, 210, 248, .36);
    border-radius: 9px 9px 3px 3px;
    background: repeating-linear-gradient(
      to top,
      rgba(255,255,255,.025) 0,
      rgba(255,255,255,.025) 50px,
      rgba(151, 201, 246, .14) 51px
    );
  }

  .command-bar {
    width: 100% !important;
    min-width: 28px;
    border-radius: 8px 8px 2px 2px !important;
  }

  .command-bar-column > small {
    margin-top: 7px !important;
    color: #dcecff !important;
    font-size: 11px !important;
    font-weight: 850;
  }

  .command-mobile-value {
    display: block;
    width: 100%;
    margin-top: 4px;
    overflow: hidden;
    color: #9ed8ff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Older/simple bar charts used by reports. */
  .chart {
    width: 100%;
    min-width: 0;
    gap: 10px !important;
    padding: 14px 6px 8px !important;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .chart > .bar-group {
    flex: 0 0 68px !important;
    min-width: 68px !important;
    scroll-snap-align: start;
  }

  .chart .bar {
    width: 34px !important;
    max-width: 34px;
  }
}

@media (max-width: 420px) {
  .multi-group { flex-basis: 86px !important; width: 86px !important; min-width: 86px !important; }
  .command-bar-column { flex-basis: 84px !important; width: 84px !important; min-width: 84px !important; }
}
