
/* V176 — Báo cáo doanh thu mobile. Desktop remains unchanged. */
@media (max-width: 639px) {
  .v176-report-mobile {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  /* Header/filter controls fit the phone width. */
  .v176-report-mobile [data-loc*="shared.tsx:305"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
    gap: 8px !important;
  }

  .v176-report-mobile [data-loc*="shared.tsx:305"] > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .v176-report-mobile [data-slot="select-trigger"] {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Tabs wrap instead of forcing horizontal drag. */
  .v176-report-mobile [role="tablist"] {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100%;
    overflow: visible !important;
  }

  .v176-report-mobile [role="tab"] {
    min-width: 0 !important;
    width: 100% !important;
    white-space: normal !important;
    text-align: center;
    line-height: 1.2;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* Convert shared report tables to vertical cards.
     Ci already adds data-label to every td, so no data is lost. */
  .v176-report-mobile .responsive-report-table {
    overflow: visible !important;
    width: 100%;
    max-width: 100%;
  }

  .v176-report-mobile .responsive-report-table table,
  .v176-report-mobile .responsive-report-table tbody,
  .v176-report-mobile .responsive-report-table tr,
  .v176-report-mobile .responsive-report-table td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .v176-report-mobile .responsive-report-table table {
    min-width: 0 !important;
  }

  .v176-report-mobile .responsive-report-table thead {
    display: none !important;
  }

  .v176-report-mobile .responsive-report-table tbody {
    display: grid !important;
    gap: 10px;
  }

  .v176-report-mobile .responsive-report-table tr {
    border: 1px solid var(--border) !important;
    border-radius: 9px;
    background: var(--background);
    padding: 4px 11px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .035);
    overflow: hidden;
  }

  .v176-report-mobile .responsive-report-table td {
    display: grid !important;
    grid-template-columns: minmax(92px, 42%) minmax(0, 1fr) !important;
    align-items: start;
    gap: 10px;
    padding: 8px 0 !important;
    border-bottom: 1px dashed color-mix(in srgb, currentColor 10%, transparent);
    white-space: normal !important;
    text-align: right !important;
    overflow-wrap: anywhere;
    font-size: 11.5px;
    line-height: 1.4;
  }

  .v176-report-mobile .responsive-report-table td:last-child {
    border-bottom: 0;
  }

  .v176-report-mobile .responsive-report-table td::before {
    content: attr(data-label);
    display: block;
    min-width: 0;
    color: var(--muted-foreground);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .025em;
    text-align: left;
    text-transform: uppercase;
  }

  .v176-report-mobile .responsive-report-table td > * {
    min-width: 0;
    max-width: 100%;
    justify-self: end;
    text-align: right;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  /* First identity field reads like a card title. */
  .v176-report-mobile .responsive-report-table td:first-child {
    grid-template-columns: 1fr !important;
    padding-top: 10px !important;
    text-align: left !important;
  }

  .v176-report-mobile .responsive-report-table td:first-child::before {
    margin-bottom: 2px;
  }

  .v176-report-mobile .responsive-report-table td:first-child > * {
    justify-self: start;
    text-align: left;
  }

  /* Charts fit naturally inside cards. */
  .v176-report-mobile .recharts-responsive-container {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Report cards use mobile space efficiently. */
  .v176-report-mobile .ledger-cell {
    max-width: 100%;
    overflow: hidden;
  }

  .v176-report-mobile .ledger-cell.p-4,
  .v176-report-mobile .ledger-cell.lg\:p-5 {
    padding: 13px !important;
  }
}
