@media (max-width: 1024px) {
  body.mobile-device {
    background: linear-gradient(180deg, #f7faff 0%, #eef3f9 100%);
  }

  body.mobile-device .logged-in-user {
    top: 10px;
    right: 12px;
    font-size: 11px;
    padding: 7px 10px;
    z-index: 1400;
  }

  body.mobile-device .app-container {
    display: block;
    min-height: 100vh;
  }

  body.mobile-device .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 320px);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    z-index: 1500;
    border-right: 1px solid #e8edf5;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1400;
  }

  body.mobile-nav-open .mobile-sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-device .main-content {
    min-height: 100vh;
  }

  body.mobile-device .top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 14px 16px 12px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid #e6ebf2;
    align-items: center;
  }

  body.mobile-device .content-area {
    padding: 14px 12px 110px;
  }

  .mobile-section-bar {
    display: none;
  }

  .mobile-topbar-leading {
    display: none !important;
  }

  .mobile-menu-toggle {
    border: 1px solid #d8e1ef;
    background: #fff;
    color: #1f2937;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  }

  body.mobile-device .business-selector {
    gap: 8px;
    min-width: 0;
    flex: 1;
  }

  body.mobile-device .business-name {
    font-size: 17px;
    line-height: 1.1;
  }

  body.mobile-device .business-dropdown {
    padding: 8px 10px;
    font-size: 13px;
    max-width: 100%;
  }

  body.mobile-device .customers-header,
  body.mobile-device .employee-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  body.mobile-device .mobile-section-bar {
    display: block !important;
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #dce6f2;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  }

  body.mobile-device .search-sort-group {
    flex-wrap: wrap;
    gap: 8px;
  }

  .mobile-section-switcher {
    display: none;
  }

  body.mobile-device .search-box,
  body.mobile-device .sort-dropdown {
    min-height: 44px;
    font-size: 15px;
    border-radius: 14px;
  }

  body.mobile-device .search-box {
    display: block;
    width: 100%;
    flex: 1 1 100%;
  }

  body.mobile-device .mobile-section-switcher {
    display: block !important;
    min-height: 44px;
    width: 100%;
    font-size: 15px;
    border-radius: 14px;
    padding: 11px 12px;
    border: 1px solid #dbe4f0;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    color: #111827;
  }

  body.mobile-device .sort-dropdown {
    flex: 1 1 100%;
  }

  body.mobile-device .btn-add {
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
    width: 100%;
  }

  body.mobile-device #customersSection .customers-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  body.mobile-device #customersSection .search-sort-group {
    display: contents;
  }

  body.mobile-device #customersSection #searchBox {
    grid-column: 1 / -1;
  }

  body.mobile-device #customersSection #sortDropdown {
    grid-column: 1;
    min-width: 0;
    width: 100%;
    flex: 0 1 auto;
  }

  body.mobile-device #customersSection #addCustomerBtn {
    grid-column: 2;
    width: auto;
    min-width: 132px;
    padding-left: 12px;
    padding-right: 12px;
    white-space: nowrap;
  }

  body.mobile-device .customers-list,
  body.mobile-device .employee-list {
    gap: 12px;
  }

  body.mobile-device .mobile-account-search-results {
    display: none;
  }

  body.mobile-device .mobile-account-search-results.active {
    display: block;
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid #dce6f2;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  }

  body.mobile-device .mobile-search-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 0 4px;
  }

  body.mobile-device .mobile-search-results-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
  }

  body.mobile-device .mobile-search-results-count {
    font-size: 12px;
    font-weight: 700;
    color: #1d4ed8;
  }

  body.mobile-device .mobile-search-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  body.mobile-device .mobile-search-result-item {
    border: 1px solid #e5edf6;
    background: #fff;
    border-radius: 16px;
    padding: 12px 14px;
    text-align: left;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  }

  body.mobile-device .mobile-search-result-section {
    grid-column: 1 / -1;
    font-size: 11px;
    color: #1d4ed8;
    font-weight: 800;
    letter-spacing: 0.02em;
  }

  body.mobile-device .mobile-search-result-name {
    font-size: 16px;
    font-weight: 780;
    color: #101828;
    line-height: 1.15;
  }

  body.mobile-device .mobile-search-result-subtitle {
    font-size: 11px;
    color: #7a8699;
    font-weight: 650;
    margin-top: 4px;
  }

  body.mobile-device .mobile-search-result-balance {
    align-self: center;
    justify-self: end;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.015em;
  }

  body.mobile-device .mobile-search-results-empty {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
  }

  body.mobile-device .customer-row {
    display: block;
    position: relative;
    padding: 14px 14px 12px;
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
    border-color: #e7edf5;
  }

  body.mobile-device .customer-row.selected {
    background: rgba(255, 255, 255, 0.99);
    border-color: #cfdaea;
    box-shadow: 0 10px 28px rgba(29, 78, 216, 0.06);
  }

  .customer-mobile-summary {
    display: none;
  }

  body.mobile-device .customer-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 10px;
  }

  body.mobile-device .customer-info > div:first-child {
    grid-column: 1 / -1;
  }

  body.mobile-device .customer-field-label {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  body.mobile-device .customer-field-value {
    font-size: 18px;
    line-height: 1.15;
  }

  body.mobile-device .customer-secondary {
    font-size: 12px;
  }

  body.mobile-device .customer-actions {
    margin-top: 12px;
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  body.mobile-device .customer-actions .action-btn {
    min-height: 42px;
    border-radius: 12px;
    padding: 8px 6px;
    width: 100%;
  }

  body.mobile-device .customer-mobile-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
  }

  body.mobile-device .customer-mobile-main {
    min-width: 0;
    flex: 1;
  }

  body.mobile-device .customer-mobile-name {
    font-size: 20px;
    line-height: 1.15;
    font-weight: 900;
    color: #17202a;
    margin-bottom: 8px;
  }

  body.mobile-device .customer-mobile-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  body.mobile-device .customer-mobile-balance {
    font-size: 14px;
    font-weight: 800;
  }

  body.mobile-device .customer-mobile-menu-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 12px;
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  body.mobile-device .customer-mobile-menu-btn:hover {
    background: #eef4fb;
  }

  body.mobile-device .customer-mobile-menu {
    position: absolute;
    top: 52px;
    right: 12px;
    display: none;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e5ebf3;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    padding: 8px;
    z-index: 30;
  }

  body.mobile-device .customer-mobile-menu.open {
    display: block;
  }

  body.mobile-device .customer-mobile-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 12px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    color: #1f2937;
    cursor: pointer;
  }

  body.mobile-device .customer-mobile-menu-item:hover {
    background: #f3f7fc;
  }

  body.mobile-device .customer-mobile-menu-item.danger {
    color: #c62828;
  }

  body.mobile-device #customersList .customer-info,
  body.mobile-device #customersList .customer-actions {
    display: none;
  }

  body.mobile-device #customersList .customer-mobile-summary {
    display: flex;
    margin-bottom: 0;
  }

  body.mobile-device .detail-header {
    display: block;
    margin-bottom: 12px;
  }

  body.mobile-device .detail-title {
    font-size: 22px;
    line-height: 1.08;
    margin-bottom: 6px;
  }

  body.mobile-device .detail-sub {
    font-size: 12px;
    line-height: 1.35;
    color: #6b7280;
  }

  body.mobile-device .detail-actions {
    margin-top: 12px;
    gap: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body.mobile-device .detail-actions .btn-back,
  body.mobile-device .detail-actions .btn-export,
  body.mobile-device .detail-actions .btn-charge,
  body.mobile-device .detail-actions .btn-payment {
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    width: 100%;
  }

  body.mobile-device .stats-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.mobile-device .stat-card {
    border-radius: 18px;
    text-align: left;
    padding: 14px 16px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
  }

  body.mobile-device .stat-label {
    margin-bottom: 4px;
    font-size: 10px;
  }

  body.mobile-device .stat-value {
    font-size: 22px;
    line-height: 1.15;
  }

  body.mobile-device .transactions-section {
    background: transparent;
    border: none;
    padding: 0;
  }

  body.mobile-device .transactions-header {
    margin-bottom: 8px;
    padding: 0 2px;
  }

  body.mobile-device .transactions-header h3 {
    font-size: 17px;
  }

  body.mobile-device .transactions-table,
  body.mobile-device .transactions-table tbody,
  body.mobile-device .transactions-table tr,
  body.mobile-device .transactions-table td {
    display: block;
    width: 100%;
  }

  body.mobile-device .transactions-table {
    white-space: normal;
  }

  body.mobile-device .transactions-table thead {
    display: none;
  }

  body.mobile-device .transactions-table tr {
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 18px;
    margin-bottom: 12px;
    padding: 11px 12px 10px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  }

  body.mobile-device .transactions-table td {
    border: none;
    padding: 4px 0;
    position: relative;
  }

  body.mobile-device .transactions-table td:nth-child(1) {
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
  }

  body.mobile-device .transactions-table td:nth-child(2)::before,
  body.mobile-device .transactions-table td:nth-child(4)::before,
  body.mobile-device .transactions-table td:nth-child(5)::before {
    display: block;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa4b2;
    margin-bottom: 2px;
    font-weight: 700;
  }

  body.mobile-device .transactions-table td:nth-child(2)::before { content: "Entered By"; }
  body.mobile-device .transactions-table td:nth-child(4)::before { content: "Amount"; }
  body.mobile-device .transactions-table td:nth-child(5)::before { content: "Plate"; }

  body.mobile-device .transactions-table td:nth-child(3) {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 2px;
  }

  body.mobile-device .transactions-table td:nth-child(4) {
    font-size: 18px;
    font-weight: 900;
    margin-top: 3px;
  }

  body.mobile-device .transactions-table td:nth-child(6) {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eef2f7;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  body.mobile-device .transactions-table td:nth-child(6) .action-btn,
  body.mobile-device .transactions-table td:nth-child(6) .receipt-action-btn {
    min-height: 34px;
    border-radius: 12px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
  }

  body.mobile-device.modal-open .mobile-detail-actions,
  body.mobile-device.modal-open .mobile-bottom-nav {
    display: none !important;
  }

  .mobile-bottom-nav {
    display: none;
  }

  body.mobile-device .mobile-bottom-nav {
    display: none !important;
  }

  .mobile-nav-btn {
    border: none;
    background: transparent;
    color: #64748b;
    padding: 8px 4px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-nav-btn .mobile-nav-icon {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-nav-btn.active {
    background: #e8f1ff;
    color: #1565c0;
  }

  .mobile-detail-actions {
    display: none;
  }

  body.mobile-device.mobile-detail-open .mobile-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 1290;
  }

  .mobile-detail-btn {
    min-height: 54px;
    border: none;
    border-radius: 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.02em;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
    cursor: pointer;
  }

  .mobile-detail-btn.charge {
    background: #18803a;
  }

  .mobile-detail-btn.payment {
    background: #d63b36;
  }

  body.mobile-device .modal {
    width: calc(100% - 20px);
    max-width: none;
    border-radius: 18px;
  }
}

/* Final mobile account and employee list polish. Keep at EOF so it wins the cascade. */
@media (max-width: 1024px) {
  body.mobile-device #customersList,
  body.mobile-device #employeesList {
    overflow: visible !important;
  }

  body.mobile-device #customersList .customer-row,
  body.mobile-device #employeesList .customer-row {
    position: relative !important;
    overflow: visible !important;
  }

  body.mobile-device #customersList .customer-row.menu-open,
  body.mobile-device #employeesList .customer-row.menu-open {
    z-index: 500 !important;
  }

  body.mobile-device #customersList .customer-mobile-summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 164px 42px !important;
    align-items: center !important;
    gap: 14px !important;
  }

  body.mobile-device #customersList .customer-mobile-leading,
  body.mobile-device #customersList .customer-mobile-main {
    min-width: 0 !important;
  }

  body.mobile-device #customersList .customer-mobile-name {
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  body.mobile-device #customersList .customer-mobile-trailing {
    width: 164px !important;
    min-width: 164px !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  body.mobile-device #customersList .customer-mobile-balance {
    font-variant-numeric: tabular-nums !important;
    white-space: nowrap !important;
  }

  body.mobile-device .customer-mobile-menu {
    top: calc(100% - 12px) !important;
    right: 20px !important;
    min-width: 210px !important;
    z-index: 700 !important;
  }

  body.mobile-device .customer-mobile-menu.open {
    display: block !important;
  }

  body.mobile-device .customer-mobile-menu-item {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  body.mobile-device #employeesList .employee-desktop-summary,
  body.mobile-device #employeesList .customer-info,
  body.mobile-device #employeesList .customer-actions {
    display: none !important;
  }

  body.mobile-device #employeesList .employee-row {
    min-height: auto !important;
    padding: 0 !important;
    border-radius: 22px !important;
    background: #fff !important;
  }

  body.mobile-device #employeesList .customer-mobile-summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 190px 42px !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 18px 18px !important;
  }

  body.mobile-device #employeesList .customer-mobile-leading {
    min-width: 0 !important;
    gap: 12px !important;
  }

  body.mobile-device #employeesList .customer-mobile-name {
    font-size: 17px !important;
    line-height: 1.15 !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.mobile-device #employeesList .customer-mobile-subtitle {
    margin-top: 4px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.mobile-device #employeesList .customer-mobile-trailing {
    width: 190px !important;
    min-width: 190px !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  body.mobile-device #employeesList .employee-mobile-role {
    text-align: left !important;
    font-size: 15px !important;
    white-space: nowrap !important;
  }

  body.mobile-device #employeesList .employee-mobile-status {
    font-size: 12px !important;
  }
}

@media (max-width: 720px) {
  body.mobile-device #customersList .customer-mobile-summary {
    grid-template-columns: minmax(0, 1fr) 118px 36px !important;
    gap: 10px !important;
  }

  body.mobile-device #customersList .customer-mobile-trailing {
    width: 118px !important;
    min-width: 118px !important;
  }

  body.mobile-device #employeesList .customer-mobile-summary {
    grid-template-columns: minmax(0, 1fr) 118px 36px !important;
    gap: 10px !important;
    padding: 16px 14px !important;
  }

  body.mobile-device #employeesList .customer-mobile-trailing {
    width: 118px !important;
    min-width: 118px !important;
  }
}

@media (max-width: 1024px) {
  body.mobile-device #customersSection .customers-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
  }

  body.mobile-device #customersSection .search-sort-group {
    display: contents !important;
  }

  body.mobile-device #customersSection #searchBox {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  body.mobile-device #customersSection #sortDropdown {
    grid-column: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    flex: 0 1 auto !important;
  }

  body.mobile-device #customersSection #addCustomerBtn {
    grid-column: 2 !important;
    width: auto !important;
    min-width: 132px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 1024px) {
  body.mobile-device #customersSection .customers-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
  }

  body.mobile-device #customersSection .search-sort-group {
    display: contents !important;
  }

  body.mobile-device #customersSection #searchBox {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  body.mobile-device #customersSection #sortDropdown {
    grid-column: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    flex: 0 1 auto !important;
  }

  body.mobile-device #customersSection #addCustomerBtn {
    grid-column: 2 !important;
    width: auto !important;
    min-width: 132px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 1024px) {
  body.mobile-device #customersSection .customers-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
  }

  body.mobile-device #customersSection .search-sort-group {
    display: contents !important;
  }

  body.mobile-device #customersSection #searchBox {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  body.mobile-device #customersSection #sortDropdown {
    grid-column: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    flex: 0 1 auto !important;
  }

  body.mobile-device #customersSection #addCustomerBtn {
    grid-column: 2 !important;
    width: auto !important;
    min-width: 132px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 1024px) {
  body.mobile-device .detail-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    align-items: stretch !important;
  }

  body.mobile-device .detail-actions .btn-back,
  body.mobile-device .detail-actions .btn-export,
  body.mobile-device .detail-actions .btn-charge,
  body.mobile-device .detail-actions .btn-payment {
    min-height: 40px !important;
    padding: 9px 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  body.mobile-device .transactions-table tr.transaction-row.no-plate {
    grid-template-areas:
      "date amount"
      "description amount"
      "entered amount"
      "actions actions" !important;
  }

  body.mobile-device .transactions-table tr.transaction-row.has-plate {
    grid-template-areas:
      "date amount"
      "description amount"
      "entered amount"
      "plate amount"
      "actions actions" !important;
  }

  body.mobile-device .transactions-table .tx-plate-cell.is-empty {
    display: none !important;
  }

  body.mobile-device .transactions-table .tx-date-cell {
    font-size: 9.5px !important;
    letter-spacing: 0.04em !important;
  }

  body.mobile-device .transactions-table .tx-description-cell {
    font-size: 12px !important;
    line-height: 1.18 !important;
    font-weight: 620 !important;
  }

  body.mobile-device .transactions-table .tx-entered-cell {
    font-size: 10px !important;
    font-weight: 520 !important;
  }

  body.mobile-device .transactions-table .tx-plate-cell {
    font-size: 10px !important;
    font-weight: 520 !important;
    color: #7b8797 !important;
    margin-top: 1px !important;
  }

  body.mobile-device .transactions-table .tx-amount-cell {
    font-size: 14px !important;
    line-height: 1.05 !important;
    font-weight: 720 !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell {
    margin-top: 6px !important;
    padding-top: 6px !important;
    border-top: none !important;
    gap: 6px !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell .action-btn,
  body.mobile-device .transactions-table .tx-actions-cell .receipt-action-btn {
    min-height: 28px !important;
    padding: 5px 8px !important;
    font-size: 10px !important;
    font-weight: 580 !important;
    border-radius: 10px !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell .receipt-action-btn.icon-only {
    width: 28px !important;
    min-width: 28px !important;
    padding: 0 !important;
    justify-content: center !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell .receipt-action-btn.icon-only .receipt-icon-symbol {
    font-size: 13px !important;
    line-height: 1 !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}

/* Last-pass mobile list layout. This must stay at the end of the file. */
@media (max-width: 1024px) {
  body.mobile-device #customersList,
  body.mobile-device #employeesList {
    overflow: visible !important;
  }

  body.mobile-device #customersList .customer-row,
  body.mobile-device #employeesList .customer-row {
    position: relative !important;
    overflow: visible !important;
  }

  body.mobile-device #customersList .customer-row.menu-open,
  body.mobile-device #employeesList .customer-row.menu-open {
    z-index: 500 !important;
  }

  body.mobile-device #customersList .customer-mobile-summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 164px 42px !important;
    align-items: center !important;
    gap: 14px !important;
  }

  body.mobile-device #customersList .customer-mobile-leading,
  body.mobile-device #customersList .customer-mobile-main {
    min-width: 0 !important;
  }

  body.mobile-device #customersList .customer-mobile-name {
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  body.mobile-device #customersList .customer-mobile-trailing {
    width: 164px !important;
    min-width: 164px !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  body.mobile-device #customersList .customer-mobile-balance {
    font-variant-numeric: tabular-nums !important;
    white-space: nowrap !important;
  }

  body.mobile-device .customer-mobile-menu {
    top: calc(100% - 12px) !important;
    right: 20px !important;
    min-width: 210px !important;
    z-index: 700 !important;
  }

  body.mobile-device .customer-mobile-menu.open {
    display: block !important;
  }

  body.mobile-device .customer-mobile-menu-item {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  body.mobile-device #employeesList .employee-desktop-summary,
  body.mobile-device #employeesList .customer-info,
  body.mobile-device #employeesList .customer-actions {
    display: none !important;
  }

  body.mobile-device #employeesList .employee-row {
    min-height: auto !important;
    padding: 0 !important;
    border-radius: 22px !important;
    background: #fff !important;
  }

  body.mobile-device #employeesList .customer-mobile-summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 190px 42px !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 18px !important;
  }

  body.mobile-device #employeesList .customer-mobile-leading {
    min-width: 0 !important;
    gap: 12px !important;
  }

  body.mobile-device #employeesList .customer-mobile-name {
    font-size: 17px !important;
    line-height: 1.15 !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.mobile-device #employeesList .customer-mobile-subtitle {
    margin-top: 4px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.mobile-device #employeesList .customer-mobile-trailing {
    width: 190px !important;
    min-width: 190px !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  body.mobile-device #employeesList .employee-mobile-role {
    text-align: left !important;
    font-size: 15px !important;
    white-space: nowrap !important;
  }

  body.mobile-device #employeesList .employee-mobile-status {
    font-size: 12px !important;
  }
}

@media (max-width: 720px) {
  body.mobile-device #customersList .customer-mobile-summary {
    grid-template-columns: minmax(0, 1fr) 118px 36px !important;
    gap: 10px !important;
  }

  body.mobile-device #customersList .customer-mobile-trailing {
    width: 118px !important;
    min-width: 118px !important;
  }

  body.mobile-device #employeesList .customer-mobile-summary {
    grid-template-columns: minmax(0, 1fr) 118px 36px !important;
    gap: 10px !important;
    padding: 16px 14px !important;
  }

  body.mobile-device #employeesList .customer-mobile-trailing {
    width: 118px !important;
    min-width: 118px !important;
  }
}

/* Final mobile account and employee list polish. Keep at EOF so it wins the cascade. */
@media (max-width: 1024px) {
  body.mobile-device #customersList,
  body.mobile-device #employeesList {
    overflow: visible !important;
  }

  body.mobile-device #customersList .customer-row,
  body.mobile-device #employeesList .customer-row {
    position: relative !important;
    overflow: visible !important;
  }

  body.mobile-device #customersList .customer-row.menu-open,
  body.mobile-device #employeesList .customer-row.menu-open {
    z-index: 500 !important;
  }

  body.mobile-device #customersList .customer-mobile-summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 164px 42px !important;
    align-items: center !important;
    gap: 14px !important;
  }

  body.mobile-device #customersList .customer-mobile-leading,
  body.mobile-device #customersList .customer-mobile-main {
    min-width: 0 !important;
  }

  body.mobile-device #customersList .customer-mobile-name {
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  body.mobile-device #customersList .customer-mobile-trailing {
    width: 164px !important;
    min-width: 164px !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  body.mobile-device #customersList .customer-mobile-balance {
    font-variant-numeric: tabular-nums !important;
    white-space: nowrap !important;
  }

  body.mobile-device .customer-mobile-menu {
    top: calc(100% - 12px) !important;
    right: 20px !important;
    min-width: 210px !important;
    z-index: 700 !important;
  }

  body.mobile-device .customer-mobile-menu.open {
    display: block !important;
  }

  body.mobile-device .customer-mobile-menu-item {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  body.mobile-device #employeesList .employee-desktop-summary,
  body.mobile-device #employeesList .customer-info,
  body.mobile-device #employeesList .customer-actions {
    display: none !important;
  }

  body.mobile-device #employeesList .employee-row {
    min-height: auto !important;
    padding: 0 !important;
    border-radius: 22px !important;
    background: #fff !important;
  }

  body.mobile-device #employeesList .customer-mobile-summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 190px 42px !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 18px 18px !important;
  }

  body.mobile-device #employeesList .customer-mobile-leading {
    min-width: 0 !important;
    gap: 12px !important;
  }

  body.mobile-device #employeesList .customer-mobile-name {
    font-size: 17px !important;
    line-height: 1.15 !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.mobile-device #employeesList .customer-mobile-subtitle {
    margin-top: 4px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.mobile-device #employeesList .customer-mobile-trailing {
    width: 190px !important;
    min-width: 190px !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  body.mobile-device #employeesList .employee-mobile-role {
    text-align: left !important;
    font-size: 15px !important;
    white-space: nowrap !important;
  }

  body.mobile-device #employeesList .employee-mobile-status {
    font-size: 12px !important;
  }
}

@media (max-width: 720px) {
  body.mobile-device #customersList .customer-mobile-summary {
    grid-template-columns: minmax(0, 1fr) 118px 36px !important;
    gap: 10px !important;
  }

  body.mobile-device #customersList .customer-mobile-trailing {
    width: 118px !important;
    min-width: 118px !important;
  }

  body.mobile-device #employeesList .customer-mobile-summary {
    grid-template-columns: minmax(0, 1fr) 118px 36px !important;
    gap: 10px !important;
    padding: 16px 14px !important;
  }

  body.mobile-device #employeesList .customer-mobile-trailing {
    width: 118px !important;
    min-width: 118px !important;
  }
}

@media (max-width: 1024px) {
  body.mobile-device #customersSection .customers-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
  }

  body.mobile-device #customersSection .search-sort-group {
    display: contents !important;
  }

  body.mobile-device #customersSection #searchBox {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  body.mobile-device #customersSection #sortDropdown {
    grid-column: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    flex: 0 1 auto !important;
  }

  body.mobile-device #customersSection #addCustomerBtn {
    grid-column: 2 !important;
    width: auto !important;
    min-width: 132px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 1024px) {
  /* Final phone/tablet detail layout: keep all primary actions visible in the header card. */
  body.mobile-device.mobile-detail-open .content-area {
    padding-bottom: 22px !important;
  }

  body.mobile-device.mobile-detail-open #customerDetailSection {
    padding-bottom: 18px !important;
  }

  body.mobile-device .detail-header {
    margin-bottom: 14px !important;
    overflow: visible !important;
  }

  body.mobile-device .detail-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-top: 14px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.mobile-device .detail-actions .btn-back,
  body.mobile-device .detail-actions .btn-export,
  body.mobile-device .detail-actions .btn-charge,
  body.mobile-device .detail-actions .btn-payment {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 50px !important;
    border-radius: 16px !important;
    font-size: 16px !important;
    font-weight: 820 !important;
    padding: 0 14px !important;
    box-shadow: none !important;
  }

  body.mobile-device .detail-actions .btn-back {
    order: 1;
  }

  body.mobile-device .detail-actions .btn-charge {
    order: 2;
  }

  body.mobile-device .detail-actions .btn-payment {
    order: 3;
  }

  body.mobile-device .detail-actions .btn-export {
    order: 4;
  }

  body.mobile-device .mobile-detail-actions,
  body.mobile-device.mobile-detail-open .mobile-detail-actions {
    display: none !important;
  }

  body.mobile-device .stats-row {
    margin-top: 0 !important;
  }
}

@media (max-width: 1024px) {
  /* Final mobile detail override: keep account detail stable on phone/tablet. */
  body.mobile-device.mobile-detail-open .content-area {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 126px) !important;
  }

  body.mobile-device.mobile-detail-open #customerDetailSection {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px) !important;
  }

  body.mobile-device .detail-header {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    margin-bottom: 14px !important;
    padding: 18px 16px 16px !important;
    border-radius: 22px !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 251, 255, 0.98) 100%) !important;
    backdrop-filter: none !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06) !important;
  }

  body.mobile-device .detail-title {
    font-size: 18px !important;
    line-height: 1.12 !important;
    margin: 0 0 6px !important;
  }

  body.mobile-device .detail-sub,
  body.mobile-device #detailGasCustomerExtra {
    font-size: 11px !important;
    line-height: 1.45 !important;
    color: #768397 !important;
  }

  body.mobile-device .detail-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-top: 12px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.mobile-device .detail-actions .btn-back,
  body.mobile-device .detail-actions .btn-export {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    width: 100% !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    box-shadow: none !important;
  }

  body.mobile-device .detail-actions .btn-charge,
  body.mobile-device .detail-actions .btn-payment {
    display: none !important;
  }

  body.mobile-device .stats-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  body.mobile-device .stat-card {
    padding: 14px 16px !important;
    border-radius: 18px !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04) !important;
  }

  body.mobile-device .mobile-detail-actions {
    display: none !important;
  }

  body.mobile-device.mobile-detail-open .mobile-detail-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px) !important;
    z-index: 1400 !important;
    padding: 12px !important;
    border-radius: 20px !important;
    background: rgba(248, 251, 255, 0.97) !important;
    backdrop-filter: blur(18px) !important;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18) !important;
  }

  body.mobile-device.mobile-detail-open .mobile-detail-btn {
    min-height: 54px !important;
    border-radius: 16px !important;
    font-size: 17px !important;
    font-weight: 900 !important;
  }
}

@media (max-width: 720px) {
  body.mobile-device {
    background:
      linear-gradient(180deg, #f8fbff 0%, #f1f6fc 38%, #eaf1f8 100%);
  }

  body.mobile-device .logged-in-user {
    display: none;
  }

  body.mobile-device .top-bar {
    padding: 14px 14px 12px;
    background: rgba(248, 251, 255, 0.96);
  }

  body.mobile-device .business-selector {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  body.mobile-device .business-name {
    font-size: 20px;
    letter-spacing: -0.02em;
  }

  body.mobile-device .business-dropdown {
    min-height: 38px;
    border-radius: 999px;
    padding: 7px 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  }

  body.mobile-device .content-area {
    padding: 12px 12px 24px;
  }

  body.mobile-device .customers-header,
  body.mobile-device .employee-header {
    margin-bottom: 10px;
    gap: 8px;
  }

  body.mobile-device .search-sort-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.mobile-device .search-box,
  body.mobile-device .sort-dropdown {
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid #dde5ef;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    font-size: 14px;
  }

  body.mobile-device .btn-add {
    min-height: 44px;
    border-radius: 14px;
    font-size: 15px;
    box-shadow: 0 10px 22px rgba(29, 78, 216, 0.18);
  }

  body.mobile-device .customers-list {
    gap: 10px;
  }

  body.mobile-device .customer-row {
    padding: 0;
    border: 1px solid rgba(221, 229, 239, 0.95);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 18px;
    overflow: visible;
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
    z-index: 1;
  }

  body.mobile-device .customer-row.menu-open {
    z-index: 80;
  }

  body.mobile-device #customersList .customer-mobile-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 13px;
    margin-bottom: 0;
  }

  body.mobile-device .customer-mobile-leading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  body.mobile-device .customer-mobile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    background: #edf3ff;
    color: #274c8e;
    flex: 0 0 auto;
  }

  body.mobile-device .customer-mobile-avatar.status-current,
  body.mobile-device .customer-mobile-avatar.mobile-tone-positive {
    background: #eaf7ef;
    color: #1f7a3d;
  }

  body.mobile-device .customer-mobile-avatar.status-due,
  body.mobile-device .customer-mobile-avatar.mobile-tone-neutral {
    background: #fff4e8;
    color: #cf6a11;
  }

  body.mobile-device .customer-mobile-avatar.status-overdue,
  body.mobile-device .customer-mobile-avatar.mobile-tone-negative {
    background: #feecec;
    color: #c73a36;
  }

  body.mobile-device .customer-mobile-main {
    min-width: 0;
  }

  body.mobile-device .customer-mobile-name {
    font-size: 16px;
    line-height: 1.18;
    font-weight: 780;
    color: #101828;
    margin: 0 0 3px;
    letter-spacing: -0.015em;
    overflow-wrap: anywhere;
  }

  body.mobile-device .customer-mobile-subtitle {
    font-size: 11px;
    color: #7a8699;
    font-weight: 650;
  }

  body.mobile-device .customer-mobile-section {
    font-size: 11px;
    color: #1d4ed8;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
  }

  body.mobile-device .customer-mobile-trailing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
    min-width: max-content;
  }

  body.mobile-device .customer-mobile-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    color: #94a3b8;
    font-weight: 800;
  }

  body.mobile-device .customer-mobile-balance {
    font-size: 16px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.015em;
  }

  body.mobile-device .customer-mobile-menu-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 22px;
    color: #98a2b3;
  }

  body.mobile-device .customer-mobile-menu {
    top: 56px;
    right: 10px;
    min-width: 170px;
    z-index: 60;
  }

  body.mobile-device .mobile-section-switcher {
    border-width: 1.5px;
    border-color: #c8d7ea;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  }

  body.mobile-device .detail-header {
    display: block;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 250, 252, 0.98) 100%);
    border: 1px solid #e3eaf3;
    border-radius: 24px;
    padding: 18px 16px 14px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
  }

  body.mobile-device .detail-title {
    font-size: 24px;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    color: #0f1728;
    font-weight: 820;
    overflow-wrap: anywhere;
  }

  body.mobile-device .detail-sub {
    font-size: 11px;
    line-height: 1.55;
    color: #667085;
    font-weight: 600;
  }

  body.mobile-device #detailGasCustomerExtra {
    margin-top: 10px !important;
    padding-top: 10px;
    border-top: 1px solid #edf1f5;
  }

  body.mobile-device #detailGasCustomerStatusWrap {
    margin-top: 12px !important;
  }

  body.mobile-device .detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
  }

  body.mobile-device .detail-actions .btn-back,
  body.mobile-device .detail-actions .btn-export,
  body.mobile-device .detail-actions .btn-charge,
  body.mobile-device .detail-actions .btn-payment {
    min-height: 44px;
    border-radius: 14px;
    font-size: 14px;
    width: 100%;
  }

  body.mobile-device .stats-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
  }

  body.mobile-device .stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px;
    padding: 16px 16px 14px;
    border: 1px solid #e3eaf3;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  }

  body.mobile-device .stat-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-right: 14px;
  }

  body.mobile-device .stat-value {
    font-size: 19px;
    line-height: 1;
    letter-spacing: -0.03em;
    text-align: right;
    font-weight: 800;
  }

  body.mobile-device .transactions-header {
    padding: 6px 4px 0;
  }

  body.mobile-device .transactions-header h3 {
    font-size: 18px;
    letter-spacing: -0.02em;
    color: #0f1728;
  }

  body.mobile-device .transactions-table tr {
    border-radius: 18px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e3eaf3;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  }

  body.mobile-device .transactions-table td:nth-child(1) {
    font-size: 11px;
    letter-spacing: 0.01em;
    color: #8a94a6;
  }

  body.mobile-device .transactions-table td:nth-child(3) {
    font-size: 17px;
    line-height: 1.22;
    color: #101828;
  }

  body.mobile-device .transactions-table td:nth-child(4) {
    font-size: 20px;
    letter-spacing: -0.02em;
  }

  body.mobile-device .transactions-table td:nth-child(6) .action-btn,
  body.mobile-device .transactions-table td:nth-child(6) .receipt-action-btn {
    min-height: 36px;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
  }

  body.mobile-device .modal {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  body.mobile-device .modal-overlay.active {
    align-items: stretch;
    padding: 0;
  }

  body.mobile-device .modal-header {
    padding: 14px 16px 12px;
  }

  body.mobile-device .modal-content {
    padding: 14px 16px;
    overflow: auto;
    flex: 1 1 auto;
    padding-bottom: 18px;
  }

  body.mobile-device .modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 3;
    padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
  }

  body.mobile-device .modal-footer .btn {
    min-height: 46px;
    border-radius: 14px;
    flex: 1 1 0;
  }

  body.mobile-device .transactions-table tr {
    position: relative;
    padding: 14px 14px 12px;
    margin-bottom: 10px;
    border-radius: 20px;
  }

  body.mobile-device .transactions-table td:nth-child(1) {
    margin-right: 120px;
    font-size: 11px;
    color: #98a2b3;
    letter-spacing: 0.03em;
  }

  body.mobile-device .transactions-table td:nth-child(2) {
    font-size: 12px;
    color: #667085;
    font-weight: 700;
    margin-bottom: 4px;
  }

  body.mobile-device .transactions-table td:nth-child(2)::before {
    display: none;
  }

  body.mobile-device .transactions-table td:nth-child(3) {
    margin-right: 120px;
    font-size: 16px;
    line-height: 1.28;
    margin-bottom: 8px;
  }

  body.mobile-device .transactions-table td:nth-child(4) {
    position: absolute;
    top: 14px;
    right: 14px;
    width: auto;
    text-align: right;
    margin-top: 0;
    font-size: 21px;
    line-height: 1;
  }

  body.mobile-device .transactions-table td:nth-child(4)::before {
    display: block;
    margin-bottom: 4px;
    text-align: right;
    font-size: 9px;
    color: #98a2b3;
    letter-spacing: 0.08em;
  }

  body.mobile-device .transactions-table td:nth-child(5) {
    display: inline-flex;
    align-items: center;
    width: auto;
    min-height: 28px;
    padding: 6px 10px;
    background: #eef4fb;
    color: #47617a;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    margin-top: 2px;
  }

  body.mobile-device .transactions-table td:nth-child(5)::before {
    display: none;
  }

  body.mobile-device .transactions-table td:nth-child(6) {
    margin-top: 12px;
    padding-top: 12px;
    gap: 6px;
  }

  body.mobile-device .transactions-table td:nth-child(6) .action-btn,
  body.mobile-device .transactions-table td:nth-child(6) .receipt-action-btn {
    min-height: 34px;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 11px;
    background: #f8fafc;
    box-shadow: none;
  }

  body.mobile-device .transactions-table td:nth-child(6) .action-edit {
    background: #edf5ff;
  }

  body.mobile-device .transactions-table td:nth-child(6) .action-delete-transaction {
    background: #fff1f2;
  }

  body.mobile-device .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }

  body.mobile-device #addChargeModal .form-row:first-child,
  body.mobile-device #addPaymentModal .form-row:first-child {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  body.mobile-device .form-group label {
    font-size: 12px;
    color: #667085;
    font-weight: 800;
  }

  body.mobile-device .form-input {
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid #dde5ef;
    background: #fbfdff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
    font-size: 16px;
  }

  body.mobile-device .receipt-inline-box {
    border-radius: 18px;
    border: 1px dashed #d8e3ef;
    background: #fbfdff;
    padding: 12px;
  }

  body.mobile-device .receipt-inline-actions {
    gap: 8px;
  }

  body.mobile-device .receipt-inline-actions .btn {
    min-height: 40px;
    border-radius: 12px;
  }

  body.mobile-device .receipt-inline-preview {
    max-width: 140px;
    max-height: 180px;
    border-radius: 14px;
  }

  body.mobile-device .customer-info,
  body.mobile-device #employeesList .customer-info {
    grid-template-columns: 1fr 1fr;
  }

  body.mobile-device #employeesList .customer-info > div:first-child,
  body.mobile-device #employeesList .customer-info > div:nth-child(2) {
    grid-column: 1 / -1;
  }

  body.mobile-device #employeesList .customer-info,
  body.mobile-device #employeesList .customer-actions {
    display: none !important;
  }

  body.mobile-device #employeesList .customer-mobile-summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 16px 14px;
  }

  body.mobile-device #employeesList .customer-mobile-avatar {
    background: #eef4fb;
    color: #47617a;
  }

  body.mobile-device .employee-mobile-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 2px;
  }

  body.mobile-device .employee-mobile-check input {
    width: 16px;
    height: 16px;
  }

  body.mobile-device .employee-mobile-role {
    font-size: 14px;
    line-height: 1.05;
    font-weight: 780;
    color: #0f1728;
    text-align: right;
  }

  body.mobile-device .employee-mobile-status {
    margin-top: 4px;
    display: block;
    font-size: 11px;
    font-weight: 700;
    background: transparent;
    color: #98a2b3;
    white-space: nowrap;
  }

  body.mobile-device .employee-mobile-status.pending {
    color: #d97706;
  }

  body.mobile-device .employee-mobile-status.accepted {
    color: #98a2b3;
  }

  body.mobile-device .employee-mobile-status.archived {
    color: #c73a36;
  }

  body.mobile-device #customersList .customer-info,
  body.mobile-device #customersList .customer-actions {
    display: none;
  }

  body.mobile-device .customer-actions {
    grid-template-columns: 1fr;
  }

  body.mobile-device .transactions-table td:nth-child(4) {
    font-size: 17px;
  }
}

@media (min-width: 721px) and (max-width: 1024px) {
  body.mobile-device .content-area {
    padding: 16px 16px 28px;
  }

  body.mobile-device .top-bar {
    padding: 16px 18px 14px;
  }

  body.mobile-device .business-name {
    font-size: 22px;
  }

  body.mobile-device .customers-header,
  body.mobile-device .employee-header {
    gap: 12px;
    padding: 14px;
  }

  body.mobile-device .mobile-section-bar {
    margin-bottom: 14px;
    padding: 12px;
  }

  body.mobile-device .search-sort-group {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 10px;
  }

  body.mobile-device .mobile-section-switcher {
    grid-column: 1 / -1;
    min-height: 48px;
    font-size: 16px;
    border-radius: 16px;
  }

  body.mobile-device .mobile-topbar-leading,
  body.mobile-device .mobile-menu-toggle,
  body.mobile-device #mobileSidebarOverlay,
  body.mobile-device #mobileBottomNav {
    display: none !important;
  }

  body.mobile-device .sort-dropdown {
    min-height: 46px;
    font-size: 15px;
  }

  body.mobile-device .btn-add {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
  }

  body.mobile-device #customersList .customer-mobile-summary {
    padding: 16px 18px 15px;
    grid-template-columns: minmax(0, 1.2fr) auto auto;
    gap: 14px;
  }

  body.mobile-device .customer-mobile-avatar {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    font-size: 16px;
  }

  body.mobile-device .customer-mobile-name {
    font-size: 18px;
  }

  body.mobile-device .customer-mobile-subtitle {
    font-size: 12px;
  }

  body.mobile-device .customer-mobile-balance {
    font-size: 18px;
  }

  body.mobile-device #employeesList .customer-info {
    display: none !important;
  }

  body.mobile-device #employeesList .customer-actions {
    display: none !important;
  }

  body.mobile-device #employeesList .customer-mobile-summary {
    display: grid !important;
  }

  body.mobile-device #employeesList .customer-row {
    padding: 0;
  }

  body.mobile-device .employee-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  body.mobile-device .employee-header-actions .btn-add,
  body.mobile-device .employee-header-actions .btn-add-secondary {
    flex: 1 1 0;
  }
}

@media (max-width: 540px) {
  body.mobile-device .content-area {
    padding-left: 10px;
    padding-right: 10px;
  }

  .mobile-nav-btn {
    font-size: 10px;
  }

  .mobile-nav-btn .mobile-nav-icon {
    font-size: 17px;
  }

  body.mobile-device.mobile-detail-open .mobile-detail-actions {
    left: 10px;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  }

  .mobile-detail-btn {
    min-height: 52px;
    font-size: 15px;
  }
}

@media (max-width: 1024px) {
  body.mobile-device {
    --wb-mobile-topbar-offset: 78px;
    --wb-mobile-controls-offset: 152px;
    --wb-mobile-bottom-actions-space: calc(env(safe-area-inset-bottom, 0px) + 108px);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  body.mobile-device .top-bar {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  }

  body.mobile-device .mobile-section-bar {
    position: sticky;
    top: var(--wb-mobile-topbar-offset);
    z-index: 995;
    margin-bottom: 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  }

  body.mobile-device #customersSection .customers-header,
  body.mobile-device #employeesSection .employee-header {
    position: sticky;
    top: var(--wb-mobile-controls-offset);
    z-index: 990;
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #dce6f2;
    border-radius: 20px;
    background: rgba(248, 251, 255, 0.94);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  }

  body.mobile-device .search-sort-group {
    gap: 10px;
  }

  body.mobile-device .search-box,
  body.mobile-device .sort-dropdown,
  body.mobile-device .mobile-section-switcher {
    box-shadow: none;
  }

  body.mobile-device .btn-add {
    box-shadow: 0 10px 20px rgba(29, 78, 216, 0.16);
  }

  body.mobile-device #customersSection #addCustomerBtn {
    width: auto;
  }

  body.mobile-device .customer-row {
    border-radius: 16px;
    border-color: #e4ebf4;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  }

  body.mobile-device .customer-row.selected {
    border-color: #d6e0eb;
    box-shadow: 0 6px 18px rgba(29, 78, 216, 0.06);
  }

  body.mobile-device #customersList .customer-mobile-summary {
    padding: 13px 14px 12px;
    gap: 10px;
  }

  body.mobile-device .customer-mobile-name {
    font-size: 15px;
    line-height: 1.18;
    font-weight: 760;
    letter-spacing: -0.015em;
  }

  body.mobile-device .customer-mobile-subtitle {
    font-size: 12px;
    color: #7b8798;
    font-weight: 650;
  }

  body.mobile-device .customer-mobile-label {
    font-size: 10px;
    color: #a0abba;
  }

  body.mobile-device .customer-mobile-balance {
    font-size: 15px;
    letter-spacing: -0.015em;
  }

  body.mobile-device.mobile-detail-open .content-area {
    padding-bottom: var(--wb-mobile-bottom-actions-space);
  }

  body.mobile-device.mobile-detail-open #customerDetailSection {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  }

  body.mobile-device.mobile-detail-open .detail-header {
    position: sticky;
    top: calc(var(--wb-mobile-topbar-offset) + 8px);
    z-index: 980;
    margin-bottom: 14px;
    border-radius: 20px;
    padding: 16px 16px 14px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
  }

  body.mobile-device .detail-title {
    font-size: 18px;
    line-height: 1.12;
    font-weight: 820;
    letter-spacing: -0.02em;
    margin-top: 0 !important;
    margin-bottom: 6px;
  }

  body.mobile-device .detail-sub {
    font-size: 12px;
    line-height: 1.45;
    color: #6b7280;
    font-weight: 650;
  }

  body.mobile-device .detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  body.mobile-device .detail-actions .btn-charge,
  body.mobile-device .detail-actions .btn-payment {
    display: none;
  }

  body.mobile-device .detail-actions .btn-back,
  body.mobile-device .detail-actions .btn-export {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 14px;
    width: 100%;
    box-shadow: none;
  }

  body.mobile-device .stats-row {
    gap: 8px;
    margin-bottom: 14px;
  }

  body.mobile-device .stat-card {
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  }

  body.mobile-device .stat-label {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  body.mobile-device .stat-value {
    font-size: 16px;
    letter-spacing: -0.02em;
  }

  body.mobile-device .transactions-section {
    padding-bottom: 0;
  }

  body.mobile-device .transactions-header {
    margin-bottom: 10px;
  }

  body.mobile-device .transactions-header h3 {
    font-size: 16px;
    font-weight: 820;
  }

  body.mobile-device .transactions-table tr {
    border-radius: 16px;
    border-color: #e4ebf4;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  }

  body.mobile-device .mobile-detail-actions {
    display: none;
  }

  body.mobile-device.mobile-detail-open .mobile-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    z-index: 1290;
  }

  body.mobile-device .mobile-detail-btn {
    min-height: 56px;
    border: none;
    border-radius: 18px;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.01em;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
  }

  body.mobile-device .mobile-detail-btn.charge {
    background: linear-gradient(135deg, #198a42 0%, #22a95b 100%);
  }

  body.mobile-device .mobile-detail-btn.payment {
    background: linear-gradient(135deg, #cf4138 0%, #de554c 100%);
  }
}

@media (max-width: 720px) {
  body.mobile-device {
    --wb-mobile-topbar-offset: 84px;
    --wb-mobile-controls-offset: 154px;
  }
}

@media (min-width: 721px) and (max-width: 1024px) {
  body.mobile-device {
    --wb-mobile-topbar-offset: 82px;
    --wb-mobile-controls-offset: 164px;
    --wb-mobile-bottom-actions-space: calc(env(safe-area-inset-bottom, 0px) + 116px);
  }

  body.mobile-device .customer-mobile-name {
    font-size: 17px;
  }

  body.mobile-device .customer-mobile-balance {
    font-size: 17px;
  }
}

@media (max-width: 1024px) {
  body.mobile-device {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  body.mobile-device .top-bar {
    position: sticky;
    top: 0;
    z-index: 1260;
    background: rgba(248, 251, 255, 0.94);
    backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 rgba(203, 213, 225, 0.7);
  }

  body.mobile-device .mobile-section-bar {
    position: static;
    top: auto;
    z-index: auto;
    background: transparent;
    backdrop-filter: none;
    margin: 0 0 8px;
    padding: 0;
    box-shadow: none;
  }

  body.mobile-device #customersSection .customers-header,
  body.mobile-device #employeesSection .employee-header {
    position: static;
    top: auto;
    z-index: auto;
    background: transparent;
    backdrop-filter: none;
    margin: 0 0 12px;
    padding: 0;
  }

  body.mobile-device .customer-row {
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  }

  body.mobile-device .customer-mobile-name {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 780;
    letter-spacing: -0.02em;
  }

  body.mobile-device .customer-mobile-subtitle {
    font-size: 11px;
    color: #7b8797;
  }

  body.mobile-device .customer-mobile-balance {
    font-size: 15px;
    font-weight: 760;
  }

  body.mobile-device .detail-header {
    position: sticky;
    top: calc(var(--wb-mobile-topbar-offset) + 6px);
    z-index: 1220;
    background: rgba(248, 251, 255, 0.98);
    backdrop-filter: blur(14px);
    padding: 14px 14px 12px;
    border-radius: 24px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  }

  body.mobile-device .detail-title {
    font-size: 18px;
    line-height: 1.12;
    letter-spacing: -0.025em;
    font-weight: 820;
  }

  body.mobile-device .detail-sub,
  body.mobile-device #detailGasCustomerExtra {
    font-size: 11px;
    line-height: 1.45;
    color: #778396;
  }

  body.mobile-device .detail-actions {
    grid-template-columns: 1fr 1fr;
  }

  body.mobile-device .detail-actions .btn-back,
  body.mobile-device .detail-actions .btn-export {
    min-height: 38px;
    font-size: 12px;
    border-radius: 12px;
    font-weight: 760;
  }

  body.mobile-device .stats-row {
    gap: 8px;
  }

  body.mobile-device .stat-card {
    padding: 14px 14px 13px;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  }

  body.mobile-device .stat-label {
    font-size: 10px;
    letter-spacing: 0.13em;
  }

  body.mobile-device .stat-value {
    font-size: 19px;
    font-weight: 820;
  }

  body.mobile-device .transactions-header {
    position: static;
    top: auto;
    z-index: auto;
    background: transparent;
    backdrop-filter: none;
    padding: 6px 0 8px;
  }

  body.mobile-device .transactions-heading h3 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  body.mobile-device .transactions-subtitle {
    font-size: 11px;
    color: #7b8797;
  }

  body.mobile-device .transactions-count {
    font-size: 11px;
    font-weight: 760;
  }

  body.mobile-device .transactions-table tr.transaction-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "date date"
      "description amount"
      "description balance"
      "entered amount"
      "plate amount"
      "actions actions";
    align-items: start;
    gap: 2px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
    padding: 13px 14px 12px;
    border: 1px solid #e4ebf4;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  }

  body.mobile-device .transactions-table.gas-account-table tr.transaction-row {
    grid-template-areas:
      "date date"
      "invoice amount"
      "description balance"
      "entered amount"
      "plate amount"
      "actions actions";
  }

  body.mobile-device .transactions-table.personal-account-table tr.transaction-row,
  body.mobile-device .transactions-table.vendor-tracking-table tr.transaction-row {
    grid-template-areas:
      "date date"
      "invoice amount"
      "entered balance"
      "actions actions";
  }

  body.mobile-device .transactions-table tr.transaction-row > td {
    width: auto;
    padding: 0;
  }

  body.mobile-device .transactions-table .tx-date-cell {
    grid-area: date;
    color: #7d8898;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 760;
    margin-bottom: 3px;
  }

  body.mobile-device .transactions-table .tx-description-cell {
    grid-area: description;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 780;
    letter-spacing: -0.015em;
    color: #152236;
    margin-bottom: 1px;
  }

  body.mobile-device .transactions-table .tx-description-cell .invoice-subtext {
    font-size: 11px;
    color: #7c8696;
    margin-top: 3px;
  }

  body.mobile-device .transactions-table .tx-invoice-cell {
    grid-area: invoice;
    font-size: 12px;
    color: #475467;
    font-weight: 680;
    margin-top: 2px;
  }

  body.mobile-device .transactions-table .tx-invoice-cell::before {
    content: "Invoice";
    display: inline-block;
    margin-right: 6px;
    color: #a0a9b8;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 760;
  }

  body.mobile-device .transactions-table.gas-account-table .tx-invoice-cell::before,
  body.mobile-device .transactions-table.personal-account-table .tx-invoice-cell::before {
    content: "Trans #";
  }

  body.mobile-device .transactions-table .tx-entered-cell {
    grid-area: entered;
    font-size: 12px;
    color: #7b8797;
    font-weight: 680;
  }

  body.mobile-device .transactions-table .tx-entered-cell::before,
  body.mobile-device .transactions-table .tx-amount-cell::before,
  body.mobile-device .transactions-table .tx-actions-cell::before {
    display: none !important;
  }

  body.mobile-device .transactions-table .tx-plate-cell {
    grid-area: plate;
    font-size: 11px;
    color: #7b8797;
    font-weight: 680;
    margin-top: 2px;
  }

  body.mobile-device .transactions-table .tx-plate-cell::before {
    content: "Plate";
    display: inline-block;
    margin-right: 6px;
    color: #a0a9b8;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 760;
  }

  body.mobile-device .transactions-table .tx-amount-cell {
    grid-area: amount;
    align-self: start;
    justify-self: end;
    text-align: right;
    margin-top: 0;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 820;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }

  body.mobile-device .transactions-table .tx-balance-cell {
    grid-area: balance;
    justify-self: end;
    text-align: right;
    font-size: 11px;
    font-weight: 560 !important;
    white-space: nowrap;
  }

  body.mobile-device .transactions-table .tx-balance-cell::before {
    content: "Balance";
    display: block;
    color: #a0a9b8;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 650;
    margin-bottom: 2px;
  }

  body.mobile-device .transactions-table .tx-actions-cell {
    grid-area: actions;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ecf1f7;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  body.mobile-device .transactions-table .tx-actions-cell .action-btn,
  body.mobile-device .transactions-table .tx-actions-cell .receipt-action-btn {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 760;
    box-shadow: none;
  }

  body.mobile-device.mobile-detail-open .mobile-detail-actions {
    grid-template-columns: 1fr 1fr;
    left: 0;
    right: 0;
    bottom: 0;
    gap: 0;
    padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
    background: rgba(248, 251, 255, 0.97);
    backdrop-filter: blur(18px);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  }

  body.mobile-device .mobile-detail-btn {
    min-height: 52px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    box-shadow: none;
  }
}

@media (max-width: 1024px) {
  body.mobile-device .detail-header {
    position: static !important;
    top: auto !important;
    padding: 16px 14px 14px !important;
    border-radius: 22px !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05) !important;
  }

  body.mobile-device .detail-header-main {
    display: block;
  }

  body.mobile-device .detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  body.mobile-device .detail-title {
    font-size: 20px !important;
    line-height: 1.08 !important;
    margin-bottom: 0 !important;
    font-weight: 800 !important;
  }

  body.mobile-device .detail-info-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7e1ee;
    background: #f8fbff;
    color: #506173;
    border-radius: 999px;
    min-height: 32px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }

  body.mobile-device .detail-info-panel {
    margin-top: 10px;
  }

  body.mobile-device .detail-sub,
  body.mobile-device #detailGasCustomerExtra {
    font-size: 10.5px !important;
    line-height: 1.45 !important;
    color: #7b8797 !important;
    font-weight: 560 !important;
  }

  body.mobile-device #detailGasCustomerExtra {
    margin-top: 8px !important;
    padding-top: 8px !important;
  }

  body.mobile-device #detailGasCustomerStatusWrap {
    margin-top: 10px !important;
  }

  body.mobile-device .detail-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 12px !important;
  }

  body.mobile-device .detail-actions .btn-back,
  body.mobile-device .detail-actions .btn-export,
  body.mobile-device .detail-actions .btn-charge,
  body.mobile-device .detail-actions .btn-payment {
    min-height: 42px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    font-weight: 760 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body.mobile-device .stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 10px !important;
    margin-bottom: 14px !important;
  }

  body.mobile-device .stat-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 6px;
    min-width: 0;
    padding: 11px 10px 10px !important;
    border-radius: 16px !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04) !important;
  }

  body.mobile-device .stat-label {
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    font-size: 9px !important;
    letter-spacing: 0.11em !important;
    line-height: 1.2 !important;
  }

  body.mobile-device .stat-value {
    font-size: 14px !important;
    line-height: 1.1 !important;
    letter-spacing: -0.02em !important;
    font-weight: 780 !important;
    word-break: break-word;
  }

  body.mobile-device .transactions-table tr.transaction-row {
    padding: 10px 12px 9px !important;
    margin-bottom: 8px !important;
    border-radius: 16px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    column-gap: 10px !important;
  }

  body.mobile-device .transactions-table .tx-date-cell {
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 2px !important;
  }

  body.mobile-device .transactions-table .tx-description-cell {
    font-size: 13px !important;
    line-height: 1.18 !important;
    font-weight: 680 !important;
    letter-spacing: -0.01em !important;
    margin-bottom: 0 !important;
  }

  body.mobile-device .transactions-table .tx-description-cell .invoice-subtext {
    font-size: 10px !important;
    margin-top: 2px !important;
  }

  body.mobile-device .transactions-table .tx-entered-cell {
    font-size: 10.5px !important;
    font-weight: 560 !important;
    line-height: 1.25 !important;
  }

  body.mobile-device .transactions-table .tx-plate-cell {
    font-size: 10px !important;
    font-weight: 560 !important;
  }

  body.mobile-device .transactions-table .tx-amount-cell {
    font-size: 15px !important;
    line-height: 1.05 !important;
    font-weight: 760 !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell {
    margin-top: 8px !important;
    padding-top: 8px !important;
    gap: 6px !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell .action-btn,
  body.mobile-device .transactions-table .tx-actions-cell .receipt-action-btn {
    min-height: 30px !important;
    padding: 6px 8px !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
  }
}

/* Final phone/tablet detail compaction. Keep near EOF so it wins the cascade. */
@media (max-width: 1180px) {
  body.mobile-device .detail-actions {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-top: 10px !important;
  }

  body.mobile-device .detail-actions .btn-back,
  body.mobile-device .detail-actions .btn-export,
  body.mobile-device .detail-actions .btn-charge,
  body.mobile-device .detail-actions .btn-payment {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 36px !important;
    padding: 7px 4px !important;
    border-radius: 11px !important;
    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
  }

  body.mobile-device .detail-actions .btn-export {
    font-size: 9.5px !important;
  }

  body.mobile-device .transactions-table tr.transaction-row.no-plate {
    grid-template-areas:
      "date amount"
      "invoice amount"
      "description amount"
      "description balance"
      "entered amount"
      "actions actions" !important;
  }

  body.mobile-device .transactions-table.normal-account-table tr.transaction-row.no-plate,
  body.mobile-device .transactions-table.normal-account-table tr.transaction-row.has-plate {
    grid-template-areas:
      "date amount"
      "description amount"
      "invoice amount"
      "entered amount"
      "actions actions" !important;
  }

  body.mobile-device .transactions-table tr.transaction-row.has-plate {
    grid-template-areas:
      "date amount"
      "invoice amount"
      "description amount"
      "description balance"
      "entered amount"
      "plate amount"
      "actions actions" !important;
  }

  body.mobile-device .transactions-table .tx-plate-cell.is-empty {
    display: none !important;
  }

  body.mobile-device .transactions-table .tx-plate-cell.is-empty::before {
    content: none !important;
    display: none !important;
  }

  body.mobile-device .transactions-table .tx-plate-cell:not(.is-empty) {
    display: block !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-top: 1px !important;
    color: #7b8797 !important;
    font-size: 10px !important;
    font-weight: 520 !important;
  }

  body.mobile-device .transactions-table .tx-date-cell {
    font-size: 9.5px !important;
    letter-spacing: 0.04em !important;
    font-weight: 650 !important;
  }

  body.mobile-device .transactions-table .tx-description-cell {
    font-size: 12px !important;
    line-height: 1.18 !important;
    font-weight: 620 !important;
    letter-spacing: 0 !important;
  }

  body.mobile-device .transactions-table .tx-invoice-cell {
    grid-area: invoice;
    font-size: 10px !important;
    line-height: 1.2 !important;
    color: #7b8797 !important;
    font-weight: 560 !important;
  }

  body.mobile-device .transactions-table .tx-invoice-cell:empty {
    display: none !important;
  }

  body.mobile-device .transactions-table .tx-entered-cell {
    font-size: 10px !important;
    line-height: 1.2 !important;
    font-weight: 520 !important;
  }

  body.mobile-device .transactions-table .tx-amount-cell {
    font-size: 14px !important;
    line-height: 1.05 !important;
    font-weight: 720 !important;
  }

  body.mobile-device .transactions-table .tx-balance-cell {
    font-size: 10px !important;
    font-weight: 560 !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell {
    margin-top: 6px !important;
    padding-top: 6px !important;
    border-top: none !important;
    gap: 6px !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell .action-btn,
  body.mobile-device .transactions-table .tx-actions-cell .receipt-action-btn {
    min-height: 28px !important;
    padding: 5px 8px !important;
    font-size: 10px !important;
    font-weight: 580 !important;
    border-radius: 10px !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell .receipt-action-btn.icon-only {
    width: 28px !important;
    min-width: 28px !important;
    padding: 0 !important;
    justify-content: center !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell .receipt-action-btn.icon-only .receipt-icon-symbol {
    font-size: 13px !important;
    line-height: 1 !important;
  }

  body.mobile-device .transactions-table .tx-actions-cell .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}

/* Last-pass mobile list layout. This must stay at the end of the file. */
@media (max-width: 1024px) {
  body.mobile-device #customersList,
  body.mobile-device #employeesList {
    overflow: visible !important;
  }

  body.mobile-device #customersList .customer-row,
  body.mobile-device #employeesList .customer-row {
    position: relative !important;
    overflow: visible !important;
  }

  body.mobile-device #customersList .customer-row.menu-open,
  body.mobile-device #employeesList .customer-row.menu-open {
    z-index: 500 !important;
  }

  body.mobile-device #customersList .customer-mobile-summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 164px 42px !important;
    align-items: center !important;
    gap: 14px !important;
  }

  body.mobile-device #customersList .customer-mobile-leading,
  body.mobile-device #customersList .customer-mobile-main {
    min-width: 0 !important;
  }

  body.mobile-device #customersList .customer-mobile-name {
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  body.mobile-device #customersList .customer-mobile-trailing {
    width: 164px !important;
    min-width: 164px !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  body.mobile-device #customersList .customer-mobile-balance {
    font-variant-numeric: tabular-nums !important;
    white-space: nowrap !important;
  }

  body.mobile-device .customer-mobile-menu {
    top: calc(100% - 12px) !important;
    right: 20px !important;
    min-width: 210px !important;
    z-index: 700 !important;
  }

  body.mobile-device .customer-mobile-menu.open {
    display: block !important;
  }

  body.mobile-device .customer-mobile-menu-item {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  body.mobile-device #employeesList .employee-desktop-summary,
  body.mobile-device #employeesList .customer-info,
  body.mobile-device #employeesList .customer-actions {
    display: none !important;
  }

  body.mobile-device #employeesList .employee-row {
    min-height: auto !important;
    padding: 0 !important;
    border-radius: 22px !important;
    background: #fff !important;
  }

  body.mobile-device #employeesList .customer-mobile-summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 190px 42px !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 18px !important;
  }

  body.mobile-device #employeesList .customer-mobile-leading {
    min-width: 0 !important;
    gap: 12px !important;
  }

  body.mobile-device #employeesList .customer-mobile-name {
    font-size: 17px !important;
    line-height: 1.15 !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.mobile-device #employeesList .customer-mobile-subtitle {
    margin-top: 4px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.mobile-device #employeesList .customer-mobile-trailing {
    width: 190px !important;
    min-width: 190px !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  body.mobile-device #employeesList .employee-mobile-role {
    text-align: left !important;
    font-size: 15px !important;
    white-space: nowrap !important;
  }

  body.mobile-device #employeesList .employee-mobile-status {
    font-size: 12px !important;
  }
}

@media (max-width: 720px) {
  body.mobile-device #customersList .customer-mobile-summary {
    grid-template-columns: minmax(0, 1fr) 118px 36px !important;
    gap: 10px !important;
  }

  body.mobile-device #customersList .customer-mobile-trailing {
    width: 118px !important;
    min-width: 118px !important;
  }

  body.mobile-device #employeesList .customer-mobile-summary {
    grid-template-columns: minmax(0, 1fr) 118px 36px !important;
    gap: 10px !important;
    padding: 16px 14px !important;
  }

  body.mobile-device #employeesList .customer-mobile-trailing {
    width: 118px !important;
    min-width: 118px !important;
  }
}
