/* ======== BỘ CSS TỐI ƯU GIAO DIỆN DI ĐỘNG (MOBILE) ======== */
@media (max-width: 768px) {
  /* Header Module Toolbar */
  .mtc-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px;
  }
  .mtc-header-right,
  .mtc-header-right button {
    width: 100%;
    justify-content: center;
  }
  
  .mtc-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px;
  }
  .mtc-toolbar > * {
    max-width: 100% !important;
    width: 100%;
  }
  
  .mtc-stats {
    flex-wrap: wrap !important;
    gap: 8px;
  }
  .mtc-stats .stat-item {
    width: calc(50% - 4px) !important;
  }
  
  /* Bảng responsive chuyển sang thẻ Card */
  .table-wrapper table, 
  .table-wrapper thead, 
  .table-wrapper tbody, 
  .table-wrapper tr, 
  .table-wrapper th, 
  .table-wrapper td {
    display: block;
    width: 100%;
  }
  .table-wrapper thead tr {
    display: none !important;
  }
  .table-wrapper tbody tr {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
  }
  .table-wrapper tbody tr[class*="-brand-row"] {
    margin-bottom: 4px;
    border-radius: 6px;
  }
  .table-wrapper tbody tr[class*="-brand-row"] td {
    display: block !important;
    text-align: left !important;
  }
  .table-wrapper tbody td {
    display: flex !important;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px !important;
    text-align: right !important;
    border-bottom: 1px dashed var(--border) !important;
  }
  .table-wrapper tbody td:last-child {
    border-bottom: none !important;
  }
  .table-wrapper tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    padding-right: 15px;
    text-align: left;
    display: block;
  }

  /* Ẩn data-label cho hàng group/thương hiệu để đỡ bị hiển thị sai */
  .table-wrapper tbody tr[class*="-brand-row"] td::before {
    display: none !important;
  }
  
  /* Totals */
  div[id$="-totals"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  div[id$="-totals"] > div {
    justify-content: space-between !important;
  }

  /* ======== DASHBOARD HOME ======== */
  .home-hero-content {
    padding: 30px 20px 40px !important;
  }
  .home-greeting {
    font-size: 24px !important;
  }
  .home-grid-wrap {
    padding: 16px 20px 48px !important;
  }
  .home-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .hmod-card {
    padding: 16px !important;
    gap: 16px !important;
  }
}
