/* ============================================================
   Phase 20b: Admin + Customer mobile/desktop polish
   Safe CSS-only visual upgrade with small JS helper.
   ============================================================ */

:root {
  --p20b-bg: #f8fafc;
  --p20b-card: #ffffff;
  --p20b-text: #0f172a;
  --p20b-muted: #64748b;
  --p20b-line: #e2e8f0;
  --p20b-soft: #f1f5f9;
  --p20b-primary: #111827;
  --p20b-primary-hover: #020617;
  --p20b-radius: 18px;
  --p20b-shadow: 0 12px 32px rgba(15, 23, 42, .08);
  --p20b-shadow-soft: 0 8px 24px rgba(15, 23, 42, .06);
}

/* Page background only for admin/account/customer tracking areas */
body.p20b-admin-page,
body.p20b-customer-page {
  background: var(--p20b-bg);
}

/* Main containers */
body.p20b-admin-page main,
body.p20b-customer-page main,
body.p20b-admin-page .container,
body.p20b-admin-page .container-fluid,
body.p20b-customer-page .container,
body.p20b-customer-page .container-fluid {
  max-width: 1320px;
}

/* Cards */
body.p20b-admin-page .card,
body.p20b-customer-page .card {
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: var(--p20b-radius);
  box-shadow: var(--p20b-shadow-soft);
  overflow: hidden;
}

body.p20b-admin-page .card-header,
body.p20b-customer-page .card-header {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--p20b-line);
  font-weight: 800;
}

/* Headings */
body.p20b-admin-page h1,
body.p20b-admin-page .h1,
body.p20b-admin-page h2,
body.p20b-admin-page .h2,
body.p20b-customer-page h1,
body.p20b-customer-page .h1,
body.p20b-customer-page h2,
body.p20b-customer-page .h2 {
  letter-spacing: -.025em;
  color: var(--p20b-text);
}

body.p20b-admin-page .text-muted,
body.p20b-customer-page .text-muted {
  color: var(--p20b-muted) !important;
}

/* Forms */
body.p20b-admin-page .form-control,
body.p20b-admin-page .form-select,
body.p20b-customer-page .form-control,
body.p20b-customer-page .form-select {
  border-radius: 13px;
  border-color: #cbd5e1;
  min-height: 42px;
}

body.p20b-admin-page textarea.form-control,
body.p20b-customer-page textarea.form-control {
  min-height: 96px;
}

body.p20b-admin-page .form-control:focus,
body.p20b-admin-page .form-select:focus,
body.p20b-customer-page .form-control:focus,
body.p20b-customer-page .form-select:focus {
  border-color: #334155;
  box-shadow: 0 0 0 .2rem rgba(15, 23, 42, .12);
}

/* Buttons */
body.p20b-admin-page .btn,
body.p20b-customer-page .btn {
  border-radius: 13px;
  font-weight: 700;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}

body.p20b-admin-page .btn-primary,
body.p20b-customer-page .btn-primary {
  background: var(--p20b-primary);
  border-color: var(--p20b-primary);
}

body.p20b-admin-page .btn-primary:hover,
body.p20b-customer-page .btn-primary:hover {
  background: var(--p20b-primary-hover);
  border-color: var(--p20b-primary-hover);
}

body.p20b-admin-page .btn-outline-primary,
body.p20b-customer-page .btn-outline-primary {
  border-color: #334155;
  color: #111827;
}

body.p20b-admin-page .btn-outline-primary:hover,
body.p20b-customer-page .btn-outline-primary:hover {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

/* Badges */
body.p20b-admin-page .badge,
body.p20b-customer-page .badge {
  border-radius: 999px;
  padding: .45em .65em;
  font-weight: 800;
}

/* Table shell */
.p20b-table-shell {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--p20b-radius);
  border: 1px solid var(--p20b-line);
  background: #fff;
}

.p20b-table-shell > table {
  margin-bottom: 0 !important;
}

body.p20b-admin-page table,
body.p20b-customer-page table {
  vertical-align: middle;
}

body.p20b-admin-page table thead th,
body.p20b-customer-page table thead th {
  background: #f8fafc;
  color: #334155;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--p20b-line) !important;
  white-space: nowrap;
}

body.p20b-admin-page table td,
body.p20b-customer-page table td {
  border-color: #eef2f7 !important;
}

/* Desktop layout polish */
@media (min-width: 768px) {
  body.p20b-admin-page .card-body,
  body.p20b-customer-page .card-body {
    padding: 1.25rem;
  }

  body.p20b-admin-page .table td,
  body.p20b-admin-page .table th,
  body.p20b-customer-page .table td,
  body.p20b-customer-page .table th {
    padding: .82rem .9rem;
  }

  body.p20b-admin-page .btn-sm,
  body.p20b-customer-page .btn-sm {
    min-height: 34px;
    border-radius: 11px;
  }
}

/* Mobile: convert normal tables into readable cards */
@media (max-width: 767.98px) {
  body.p20b-admin-page,
  body.p20b-customer-page {
    font-size: 15px;
  }

  body.p20b-admin-page main,
  body.p20b-customer-page main,
  body.p20b-admin-page .container,
  body.p20b-admin-page .container-fluid,
  body.p20b-customer-page .container,
  body.p20b-customer-page .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-bottom: 86px !important;
  }

  body.p20b-admin-page h1,
  body.p20b-admin-page .h1,
  body.p20b-customer-page h1,
  body.p20b-customer-page .h1 {
    font-size: 1.55rem;
  }

  body.p20b-admin-page h2,
  body.p20b-admin-page .h2,
  body.p20b-customer-page h2,
  body.p20b-customer-page .h2 {
    font-size: 1.25rem;
  }

  body.p20b-admin-page .card,
  body.p20b-customer-page .card {
    border-radius: 16px;
    margin-bottom: 14px;
  }

  body.p20b-admin-page .card-body,
  body.p20b-customer-page .card-body {
    padding: 1rem;
  }

  body.p20b-admin-page .row,
  body.p20b-customer-page .row {
    row-gap: .75rem;
  }

  body.p20b-admin-page .btn,
  body.p20b-customer-page .btn {
    min-height: 44px;
  }

  body.p20b-admin-page .btn-sm,
  body.p20b-customer-page .btn-sm {
    min-height: 38px;
  }

  body.p20b-admin-page form.d-flex,
  body.p20b-customer-page form.d-flex,
  body.p20b-admin-page .d-flex.flex-wrap,
  body.p20b-customer-page .d-flex.flex-wrap {
    gap: .55rem !important;
  }

  body.p20b-admin-page form.d-flex .form-control,
  body.p20b-admin-page form.d-flex .form-select,
  body.p20b-customer-page form.d-flex .form-control,
  body.p20b-customer-page form.d-flex .form-select {
    min-width: 180px;
  }

  .p20b-table-shell {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  table.p20b-responsive-table,
  table.p20b-responsive-table tbody,
  table.p20b-responsive-table tr,
  table.p20b-responsive-table td {
    display: block;
    width: 100%;
  }

  table.p20b-responsive-table thead {
    display: none;
  }

  table.p20b-responsive-table tr {
    background: #fff;
    border: 1px solid var(--p20b-line);
    border-radius: 16px;
    box-shadow: var(--p20b-shadow-soft);
    margin-bottom: .8rem;
    padding: .65rem .75rem;
  }

  table.p20b-responsive-table td {
    border: 0 !important;
    padding: .55rem .15rem !important;
    min-height: 34px;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    color: #0f172a;
  }

  table.p20b-responsive-table td::before {
    content: attr(data-label);
    font-weight: 800;
    color: #475569;
    max-width: 42%;
    flex: 0 0 42%;
  }

  table.p20b-responsive-table td:empty {
    display: none;
  }

  table.p20b-responsive-table td[data-label=""],
  table.p20b-responsive-table td:not([data-label]) {
    display: block;
  }

  table.p20b-responsive-table td[data-label=""]::before,
  table.p20b-responsive-table td:not([data-label])::before {
    display: none;
  }

  table.p20b-responsive-table td.p20b-actions-cell,
  table.p20b-responsive-table td[data-label*="Action"],
  table.p20b-responsive-table td[data-label*="action"] {
    display: block;
  }

  table.p20b-responsive-table td.p20b-actions-cell::before,
  table.p20b-responsive-table td[data-label*="Action"]::before,
  table.p20b-responsive-table td[data-label*="action"]::before {
    display: block;
    max-width: none;
    margin-bottom: .4rem;
  }

  table.p20b-responsive-table td.p20b-actions-cell .btn,
  table.p20b-responsive-table td[data-label*="Action"] .btn,
  table.p20b-responsive-table td[data-label*="action"] .btn {
    width: 100%;
    margin: .18rem 0;
  }

  table.p20b-responsive-table td .btn + .btn,
  table.p20b-responsive-table td form + form {
    margin-top: .35rem;
  }

  /* Make button groups stack nicely */
  body.p20b-admin-page .btn-group,
  body.p20b-customer-page .btn-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: .35rem;
    width: 100%;
  }

  body.p20b-admin-page .btn-group > .btn,
  body.p20b-customer-page .btn-group > .btn {
    border-radius: 12px !important;
    width: 100%;
  }

  /* Search/filter areas */
  body.p20b-admin-page .card-body > form:first-child,
  body.p20b-customer-page .card-body > form:first-child {
    margin-bottom: .85rem;
  }

  /* Avoid mobile FAB covering content */
  .p20a-create-order-btn,
  .phase20a-create-order-fab {
    box-shadow: 0 16px 36px rgba(15,23,42,.32) !important;
  }
}

/* Nice status blocks */
.p20b-soft-panel {
  background: #fff;
  border: 1px solid var(--p20b-line);
  border-radius: var(--p20b-radius);
  box-shadow: var(--p20b-shadow-soft);
  padding: 1rem;
}

/* Print safety */
@media print {
  .p20b-table-shell {
    border: 0;
    overflow: visible;
  }

  table.p20b-responsive-table,
  table.p20b-responsive-table tbody,
  table.p20b-responsive-table tr,
  table.p20b-responsive-table td {
    display: revert;
  }

  table.p20b-responsive-table thead {
    display: table-header-group;
  }

  table.p20b-responsive-table td::before {
    content: none !important;
  }
}

/* ============================================================
   Phase 20d: mobile inline admin shortcut bar
   Desktop stays as Phase 20c dropdown menu.
   Mobile shows all admin shortcuts in one bottom row.
   ============================================================ */

@media (max-width: 767.98px) {
  body.p20b-admin-page {
    padding-bottom: 104px !important;
  }

  body.p20b-admin-page main,
  body.p20b-admin-page .container,
  body.p20b-admin-page .container-fluid {
    padding-bottom: 112px !important;
  }

  .p20c-admin-quick {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) !important;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -10px 28px rgba(15, 23, 42, .12);
    backdrop-filter: blur(14px);
  }

  /* Hide the big "Admin Menu" button on mobile */
  .p20c-admin-main,
  .p20c-admin-backdrop,
  .p20c-admin-quick input {
    display: none !important;
  }

  /* Always show menu as inline row */
  .p20c-admin-menu {
    display: flex !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 7px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .p20c-admin-menu::-webkit-scrollbar {
    display: none;
  }

  .p20c-admin-menu-title {
    display: none !important;
  }

  .p20c-admin-menu a {
    flex: 0 0 auto !important;
    min-width: 74px !important;
    max-width: 86px !important;
    min-height: 66px !important;
    padding: 8px 7px !important;
    border-radius: 16px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: .68rem !important;
    line-height: 1.05 !important;
    text-align: center !important;
    white-space: normal !important;
  }

  .p20c-admin-menu a:hover,
  .p20c-admin-menu a:active {
    background: #eef2ff !important;
    transform: translateY(-1px);
  }

  .p20c-admin-menu a.p20c-primary {
    background: #111827 !important;
    border-color: #111827 !important;
    color: #fff !important;
    margin-bottom: 0 !important;
    min-width: 86px !important;
  }

  .p20c-admin-menu a.p20c-primary:hover,
  .p20c-admin-menu a.p20c-primary:active {
    background: #020617 !important;
    color: #fff !important;
  }

  .p20c-emoji {
    width: 28px !important;
    height: 28px !important;
    flex: 0 0 28px !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    background: #e2e8f0 !important;
  }

  .p20c-primary .p20c-emoji {
    background: rgba(255,255,255,.16) !important;
  }
}

/* ============================================================
   Phase 20e: Customer/admin mobile compact polish
   Focus: customers page first, compact badges, no overflow.
   ============================================================ */

@media (max-width: 767.98px) {
  body.p20e-customers-page main,
  body.p20e-customers-page .container,
  body.p20e-customers-page .container-fluid {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  body.p20e-customers-page h1,
  body.p20e-customers-page .h1 {
    font-size: 1.32rem !important;
    margin-bottom: .65rem !important;
  }

  body.p20e-customers-page .card {
    border-radius: 14px !important;
    margin-bottom: 10px !important;
  }

  body.p20e-customers-page .card-body {
    padding: .75rem !important;
  }

  body.p20e-customers-page .card-header {
    padding: .75rem .85rem !important;
  }

  /* Customer search/filter should not push screen sideways */
  body.p20e-customers-page form.d-flex,
  body.p20e-customers-page .card-body > form {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .5rem !important;
    width: 100% !important;
  }

  body.p20e-customers-page form.d-flex .form-control,
  body.p20e-customers-page form.d-flex .form-select,
  body.p20e-customers-page form.d-flex .btn,
  body.p20e-customers-page .card-body > form .form-control,
  body.p20e-customers-page .card-body > form .form-select,
  body.p20e-customers-page .card-body > form .btn {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Customer table/card rows: use grid, not wide flex */
  body.p20e-customers-page table.p20b-responsive-table tr {
    padding: .55rem .65rem !important;
    margin-bottom: .62rem !important;
    border-radius: 14px !important;
  }

  body.p20e-customers-page table.p20b-responsive-table td {
    display: grid !important;
    grid-template-columns: minmax(82px, 32%) minmax(0, 1fr) !important;
    gap: .45rem !important;
    align-items: start !important;
    padding: .38rem .05rem !important;
    min-height: 28px !important;
    overflow: hidden !important;
    word-break: break-word !important;
  }

  body.p20e-customers-page table.p20b-responsive-table td::before {
    max-width: none !important;
    flex: none !important;
    font-size: .72rem !important;
    line-height: 1.15 !important;
    color: #64748b !important;
    padding-top: .08rem !important;
  }

  body.p20e-customers-page table.p20b-responsive-table td > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Badges were too big on mobile */
  body.p20e-customers-page .badge,
  body.p20b-admin-page .badge {
    font-size: .66rem !important;
    line-height: 1.08 !important;
    padding: .22rem .38rem !important;
    border-radius: 999px !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: center !important;
  }

  body.p20e-customers-page td .badge + .badge,
  body.p20e-customers-page .badge + .badge {
    margin-left: .2rem !important;
    margin-top: .2rem !important;
  }

  /* Actions should be full width and tidy */
  body.p20e-customers-page table.p20b-responsive-table td.p20b-actions-cell,
  body.p20e-customers-page table.p20b-responsive-table td[data-label*="Action"],
  body.p20e-customers-page table.p20b-responsive-table td[data-label*="action"],
  body.p20e-customers-page table.p20b-responsive-table td[data-label*="Manage"],
  body.p20e-customers-page table.p20b-responsive-table td[data-label*="manage"] {
    display: block !important;
    padding-top: .55rem !important;
  }

  body.p20e-customers-page table.p20b-responsive-table td.p20b-actions-cell::before,
  body.p20e-customers-page table.p20b-responsive-table td[data-label*="Action"]::before,
  body.p20e-customers-page table.p20b-responsive-table td[data-label*="action"]::before,
  body.p20e-customers-page table.p20b-responsive-table td[data-label*="Manage"]::before,
  body.p20e-customers-page table.p20b-responsive-table td[data-label*="manage"]::before {
    display: none !important;
  }

  body.p20e-customers-page table.p20b-responsive-table td .btn,
  body.p20e-customers-page table.p20b-responsive-table td form .btn {
    width: 100% !important;
    min-height: 38px !important;
    font-size: .82rem !important;
    border-radius: 11px !important;
    padding: .38rem .55rem !important;
  }

  /* Long emails/phones should wrap safely */
  body.p20e-customers-page a,
  body.p20e-customers-page td,
  body.p20e-customers-page small {
    overflow-wrap: anywhere !important;
  }

  /* Less wasted vertical space on admin/customer pages */
  body.p20b-admin-page .alert,
  body.p20b-customer-page .alert {
    border-radius: 13px !important;
    padding: .65rem .75rem !important;
    margin-bottom: .7rem !important;
    font-size: .88rem !important;
  }

  body.p20b-admin-page .mb-4,
  body.p20b-customer-page .mb-4 {
    margin-bottom: .8rem !important;
  }

  body.p20b-admin-page .mb-3,
  body.p20b-customer-page .mb-3 {
    margin-bottom: .65rem !important;
  }

  /* New Order button inside Orders page */
  .p20e-orders-page-action {
    display: flex !important;
    width: 100% !important;
    margin: 0 0 .75rem 0 !important;
  }

  .p20e-orders-page-action a {
    width: 100% !important;
    min-height: 46px !important;
    border-radius: 14px !important;
    font-weight: 900 !important;
    text-decoration: none !important;
  }
}

@media (min-width: 768px) {
  .p20e-orders-page-action {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
  }
}

/* ============================================================
   Phase 20f: smaller mobile badges + repeat/new-order actions
   ============================================================ */

@media (max-width: 767.98px) {
  /* Smaller badges everywhere in admin/customer mobile */
  body.p20b-admin-page .badge,
  body.p20b-customer-page .badge,
  body.p20e-customers-page .badge {
    font-size: .56rem !important;
    line-height: 1 !important;
    padding: .16rem .3rem !important;
    border-radius: 999px !important;
    letter-spacing: 0 !important;
    font-weight: 800 !important;
    max-width: 100% !important;
    white-space: normal !important;
  }

  body.p20b-admin-page .badge + .badge,
  body.p20b-customer-page .badge + .badge,
  body.p20e-customers-page .badge + .badge {
    margin-left: .12rem !important;
    margin-top: .12rem !important;
  }

  /* Reduce wasted row/card spacing on mobile tables */
  body.p20b-admin-page table.p20b-responsive-table tr,
  body.p20b-customer-page table.p20b-responsive-table tr {
    padding: .48rem .58rem !important;
    margin-bottom: .55rem !important;
  }

  body.p20b-admin-page table.p20b-responsive-table td,
  body.p20b-customer-page table.p20b-responsive-table td {
    padding-top: .32rem !important;
    padding-bottom: .32rem !important;
    min-height: 25px !important;
  }

  body.p20b-admin-page table.p20b-responsive-table td::before,
  body.p20b-customer-page table.p20b-responsive-table td::before {
    font-size: .68rem !important;
  }

  /* Repeat/new order button injected by Phase 20f */
  .p20f-repeat-order-wrap {
    width: 100%;
    margin: .45rem 0 .75rem 0;
  }

  .p20f-repeat-order-wrap .btn {
    width: 100%;
    min-height: 44px;
    border-radius: 14px !important;
    font-weight: 900 !important;
  }

  .p20f-repeat-order-link {
    margin-top: .35rem !important;
    width: 100% !important;
    min-height: 36px !important;
    border-radius: 11px !important;
    font-size: .78rem !important;
    font-weight: 850 !important;
  }

  td .p20f-repeat-order-link {
    display: inline-flex !important;
  }
}

@media (min-width: 768px) {
  .p20f-repeat-order-wrap {
    display: flex;
    justify-content: flex-end;
    margin: .25rem 0 1rem;
  }

  .p20f-repeat-order-wrap .btn {
    border-radius: 999px;
    font-weight: 800;
  }

  .p20f-repeat-order-link {
    margin-left: .35rem;
  }
}

/* ============================================================
   Phase 20g: cleaner mobile admin bar + customer action polish
   ============================================================ */

@media (max-width: 767.98px) {
  /* Bottom bar should be navigation only.
     New Order is inside Orders page, so hide Create Order tile on mobile. */
  .p20c-admin-menu a.p20c-primary {
    display: none !important;
  }

  .p20c-admin-quick {
    padding: 6px 7px calc(6px + env(safe-area-inset-bottom)) !important;
  }

  .p20c-admin-menu {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 5px !important;
    overflow: visible !important;
  }

  .p20c-admin-menu a {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
    min-height: 54px !important;
    padding: 6px 3px !important;
    border-radius: 13px !important;
    font-size: .56rem !important;
    line-height: 1.05 !important;
    gap: 3px !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .05) !important;
  }

  .p20c-emoji {
    width: 23px !important;
    height: 23px !important;
    flex: 0 0 23px !important;
    border-radius: 9px !important;
    font-size: .82rem !important;
  }

  body.p20b-admin-page main,
  body.p20b-admin-page .container,
  body.p20b-admin-page .container-fluid {
    padding-bottom: 88px !important;
  }

  body.p20b-admin-page {
    padding-bottom: 82px !important;
  }

  /* Hide table-level repeat/new-order buttons on mobile.
     It was making rows messy. Main customer detail button remains. */
  body.p20b-admin-page table .p20f-repeat-order-link {
    display: none !important;
  }

  /* New Customer button inside Customers page */
  .p20g-customers-page-action {
    display: flex !important;
    width: 100% !important;
    margin: 0 0 .7rem 0 !important;
  }

  .p20g-customers-page-action a,
  .p20g-customers-page-action button {
    width: 100% !important;
    min-height: 42px !important;
    border-radius: 13px !important;
    font-weight: 900 !important;
    font-size: .9rem !important;
    text-decoration: none !important;
  }

  /* Slightly smaller customer page tile/card style */
  body.p20e-customers-page .card {
    border-radius: 12px !important;
  }

  body.p20e-customers-page .card-body {
    padding: .62rem !important;
  }

  body.p20e-customers-page table.p20b-responsive-table tr {
    border-radius: 12px !important;
    padding: .42rem .52rem !important;
  }
}

@media (min-width: 768px) {
  .p20g-customers-page-action {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
  }

  .p20g-customers-page-action a,
  .p20g-customers-page-action button {
    border-radius: 999px;
    font-weight: 800;
  }
}

/* ============================================================
   Phase 20h: dashboard first in mobile admin bottom bar
   ============================================================ */

@media (max-width: 767.98px) {
  .p20c-admin-menu a[href="/admin/"] {
    order: 1 !important;
  }

  .p20c-admin-menu a[href="/admin/orders"] {
    order: 2 !important;
  }

  .p20c-admin-menu a[href="/admin/customers"] {
    order: 3 !important;
  }

  .p20c-admin-menu a[href="/admin/queue"] {
    order: 4 !important;
  }

  .p20c-admin-menu a[href="/admin/stock/strings"] {
    order: 5 !important;
  }
}

/* ============================================================
   Phase 20i: Admin dashboard mobile + desktop home screen
   ============================================================ */

body.p20i-dashboard-page {
  background:
    radial-gradient(circle at top left, rgba(15, 23, 42, .08), transparent 28rem),
    #f8fafc;
}

/* Dashboard hero */
.p20i-dashboard-hero {
  margin-bottom: 1rem;
  border-radius: 24px;
  padding: 1.1rem;
  background: linear-gradient(135deg, #111827 0%, #1e293b 55%, #334155 100%);
  color: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .20);
  overflow: hidden;
  position: relative;
}

.p20i-dashboard-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.p20i-dashboard-hero-title {
  position: relative;
  z-index: 1;
  font-weight: 950;
  letter-spacing: -.035em;
  margin: 0;
}

.p20i-dashboard-hero-subtitle {
  position: relative;
  z-index: 1;
  margin: .25rem 0 0;
  color: rgba(255,255,255,.78);
  font-weight: 650;
}

.p20i-dashboard-actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .65rem;
  margin-top: 1rem;
}

.p20i-dashboard-action {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 58px;
  padding: .75rem .85rem;
  border-radius: 18px;
  text-decoration: none !important;
  background: rgba(255, 255, 255, .11);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff !important;
  font-weight: 850;
  backdrop-filter: blur(10px);
}

.p20i-dashboard-action:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff !important;
  transform: translateY(-1px);
}

.p20i-dashboard-action.p20i-primary-action {
  background: #fff;
  color: #111827 !important;
}

.p20i-dashboard-action.p20i-primary-action:hover {
  background: #f8fafc;
  color: #020617 !important;
}

.p20i-dashboard-action-icon {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.16);
  flex: 0 0 34px;
}

.p20i-primary-action .p20i-dashboard-action-icon {
  background: #e2e8f0;
}

.p20i-dashboard-action-text {
  min-width: 0;
}

.p20i-dashboard-action-text strong {
  display: block;
  line-height: 1.05;
}

.p20i-dashboard-action-text small {
  display: block;
  margin-top: .16rem;
  color: rgba(255,255,255,.70);
  font-weight: 650;
  line-height: 1.1;
}

.p20i-primary-action .p20i-dashboard-action-text small {
  color: #64748b;
}

/* Desktop dashboard */
@media (min-width: 768px) {
  body.p20i-dashboard-page main,
  body.p20i-dashboard-page .container,
  body.p20i-dashboard-page .container-fluid {
    max-width: 1280px;
  }

  .p20i-dashboard-hero {
    padding: 1.35rem;
    margin-bottom: 1.25rem;
  }

  .p20i-dashboard-hero-title {
    font-size: 1.75rem;
  }

  .p20i-dashboard-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.p20i-dashboard-page .card {
    border-radius: 20px;
  }

  body.p20i-dashboard-page .card-body {
    padding: 1.15rem;
  }

  body.p20i-dashboard-page .row {
    row-gap: 1rem;
  }
}

/* Mobile dashboard */
@media (max-width: 767.98px) {
  body.p20i-dashboard-page main,
  body.p20i-dashboard-page .container,
  body.p20i-dashboard-page .container-fluid {
    padding-left: 9px !important;
    padding-right: 9px !important;
    padding-bottom: 92px !important;
  }

  body.p20i-dashboard-page h1,
  body.p20i-dashboard-page .h1 {
    font-size: 1.32rem !important;
    margin-bottom: .55rem !important;
  }

  .p20i-dashboard-hero {
    border-radius: 20px;
    padding: .95rem;
    margin-bottom: .75rem;
  }

  .p20i-dashboard-hero-title {
    font-size: 1.35rem;
  }

  .p20i-dashboard-hero-subtitle {
    font-size: .86rem;
  }

  .p20i-dashboard-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .48rem;
    margin-top: .75rem;
  }

  .p20i-dashboard-action {
    min-height: 72px;
    border-radius: 16px;
    padding: .6rem .55rem;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: .34rem;
  }

  .p20i-dashboard-action-icon {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
    border-radius: 12px;
    font-size: .95rem;
  }

  .p20i-dashboard-action-text strong {
    font-size: .76rem;
  }

  .p20i-dashboard-action-text small {
    display: none;
  }

  body.p20i-dashboard-page .card {
    border-radius: 13px !important;
    margin-bottom: .6rem !important;
  }

  body.p20i-dashboard-page .card-header {
    padding: .65rem .75rem !important;
    font-size: .88rem !important;
  }

  body.p20i-dashboard-page .card-body {
    padding: .68rem !important;
  }

  body.p20i-dashboard-page .row {
    row-gap: .55rem !important;
  }

  body.p20i-dashboard-page .btn {
    min-height: 39px !important;
    border-radius: 12px !important;
    font-size: .84rem !important;
  }

  body.p20i-dashboard-page .badge {
    font-size: .55rem !important;
    padding: .15rem .28rem !important;
  }

  body.p20i-dashboard-page p,
  body.p20i-dashboard-page small,
  body.p20i-dashboard-page .small {
    line-height: 1.28;
  }
}

/* ============================================================
   Phase 20j: organised admin dashboard
   Clean top home area + old info moved into More section.
   ============================================================ */

body.p20j-dashboard-page {
  background: #f8fafc !important;
}

/* Hide old Phase 20i dashboard hero to avoid duplicate/overlap */
body.p20j-dashboard-page .p20i-dashboard-hero {
  display: none !important;
}

.p20j-dashboard-home {
  margin-bottom: 1rem;
}

.p20j-dashboard-top {
  border-radius: 22px;
  padding: 1rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 65%, #334155 100%);
  color: #fff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
  position: relative;
  overflow: hidden;
}

.p20j-dashboard-top::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.p20j-dashboard-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.55rem;
  font-weight: 950;
  letter-spacing: -.035em;
}

.p20j-dashboard-subtitle {
  position: relative;
  z-index: 1;
  margin: .28rem 0 0;
  color: rgba(255,255,255,.78);
  font-weight: 650;
  font-size: .95rem;
}

.p20j-dashboard-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .62rem;
  margin-top: .95rem;
}

.p20j-dashboard-tile {
  min-width: 0;
  min-height: 76px;
  padding: .75rem;
  border-radius: 18px;
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: .7rem;
  font-weight: 850;
}

.p20j-dashboard-tile:hover {
  background: rgba(255,255,255,.18);
  color: #fff !important;
  transform: translateY(-1px);
}

.p20j-dashboard-tile-primary {
  background: #fff !important;
  color: #0f172a !important;
}

.p20j-dashboard-tile-primary:hover {
  background: #f8fafc !important;
  color: #020617 !important;
}

.p20j-dashboard-icon {
  width: 38px;
  height: 38px;
  border-radius: 15px;
  background: rgba(255,255,255,.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  font-size: 1.1rem;
}

.p20j-dashboard-tile-primary .p20j-dashboard-icon {
  background: #e2e8f0;
}

.p20j-dashboard-copy {
  min-width: 0;
}

.p20j-dashboard-copy strong {
  display: block;
  line-height: 1.1;
  font-size: .98rem;
}

.p20j-dashboard-copy small {
  display: block;
  margin-top: .18rem;
  line-height: 1.15;
  color: rgba(255,255,255,.70);
  font-weight: 650;
}

.p20j-dashboard-tile-primary .p20j-dashboard-copy small {
  color: #64748b;
}

/* More info section */
.p20j-dashboard-more {
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
  overflow: hidden;
  margin-top: .85rem;
}

.p20j-dashboard-more > summary {
  cursor: pointer;
  list-style: none;
  padding: .9rem 1rem;
  font-weight: 900;
  color: #0f172a;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.p20j-dashboard-more > summary::-webkit-details-marker {
  display: none;
}

.p20j-dashboard-more > summary::after {
  content: "⌄";
  font-size: 1.15rem;
  color: #64748b;
  transform: rotate(0deg);
}

.p20j-dashboard-more[open] > summary::after {
  transform: rotate(180deg);
}

.p20j-dashboard-more-body {
  padding: .85rem;
}

.p20j-dashboard-more-body > *:last-child {
  margin-bottom: 0 !important;
}

body.p20j-dashboard-page .card {
  border-radius: 16px !important;
  overflow: hidden;
}

body.p20j-dashboard-page .card-header {
  font-size: .92rem;
}

body.p20j-dashboard-page .card-body {
  font-size: .94rem;
}

/* Desktop */
@media (min-width: 768px) {
  body.p20j-dashboard-page main,
  body.p20j-dashboard-page .container,
  body.p20j-dashboard-page .container-fluid {
    max-width: 1240px !important;
  }

  .p20j-dashboard-top {
    padding: 1.25rem;
  }

  .p20j-dashboard-title {
    font-size: 1.75rem;
  }

  .p20j-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .p20j-dashboard-more-body {
    padding: 1rem;
  }

  body.p20j-dashboard-page .row {
    row-gap: 1rem;
  }
}

/* Mobile */
@media (max-width: 767.98px) {
  body.p20j-dashboard-page main,
  body.p20j-dashboard-page .container,
  body.p20j-dashboard-page .container-fluid {
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-bottom: 104px !important;
  }

  .p20j-dashboard-home {
    margin-bottom: .7rem;
  }

  .p20j-dashboard-top {
    border-radius: 18px;
    padding: .82rem;
  }

  .p20j-dashboard-title {
    font-size: 1.28rem;
  }

  .p20j-dashboard-subtitle {
    font-size: .82rem;
  }

  .p20j-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
    margin-top: .7rem;
  }

  .p20j-dashboard-tile {
    min-height: 70px;
    border-radius: 15px;
    padding: .54rem .46rem;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: .32rem;
  }

  .p20j-dashboard-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border-radius: 11px;
    font-size: .92rem;
  }

  .p20j-dashboard-copy strong {
    font-size: .72rem;
  }

  .p20j-dashboard-copy small {
    display: none;
  }

  .p20j-dashboard-more {
    border-radius: 15px;
    margin-top: .65rem;
  }

  .p20j-dashboard-more > summary {
    padding: .72rem .78rem;
    font-size: .86rem;
  }

  .p20j-dashboard-more-body {
    padding: .6rem;
  }

  body.p20j-dashboard-page .card {
    border-radius: 12px !important;
    margin-bottom: .55rem !important;
  }

  body.p20j-dashboard-page .card-header {
    padding: .58rem .65rem !important;
    font-size: .8rem !important;
  }

  body.p20j-dashboard-page .card-body {
    padding: .6rem !important;
    font-size: .82rem !important;
  }

  body.p20j-dashboard-page .row {
    row-gap: .5rem !important;
  }

  body.p20j-dashboard-page .btn {
    min-height: 36px !important;
    border-radius: 11px !important;
    font-size: .78rem !important;
  }

  body.p20j-dashboard-page .badge {
    font-size: .52rem !important;
    padding: .13rem .25rem !important;
  }

  body.p20j-dashboard-page table.p20b-responsive-table tr {
    padding: .42rem .5rem !important;
    margin-bottom: .5rem !important;
  }

  body.p20j-dashboard-page table.p20b-responsive-table td {
    padding: .3rem .02rem !important;
  }
}

/* ============================================================
   Phase 20k: clean repeated dashboard buttons/menus
   Dashboard should have one clear top action area only.
   ============================================================ */

/* Hide floating admin quick menu on dashboard only.
   Dashboard already has action tiles. */
body.p20k-dashboard-clean .p20c-admin-quick {
  display: none !important;
}

/* Hide old Phase 20i hero if still present */
body.p20k-dashboard-clean .p20i-dashboard-hero {
  display: none !important;
}

/* Hide the More box if JS marks it as wrong/duplicate nav */
body.p20k-dashboard-clean .p20j-dashboard-more.p20k-hide-more {
  display: none !important;
}

/* Make dashboard top area use screen better */
body.p20k-dashboard-clean .p20j-dashboard-home {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
}

body.p20k-dashboard-clean .p20j-dashboard-top {
  margin-bottom: 1rem;
}

/* Reduce old scattered dashboard quick tools if they remain below */
body.p20k-dashboard-clean .p20k-old-quick-tools {
  display: none !important;
}

/* Desktop: cleaner top dashboard */
@media (min-width: 768px) {
  body.p20k-dashboard-clean .p20j-dashboard-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  body.p20k-dashboard-clean .p20j-dashboard-tile {
    min-height: 96px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: .5rem;
  }

  body.p20k-dashboard-clean .p20j-dashboard-copy small {
    display: none;
  }

  body.p20k-dashboard-clean .p20j-dashboard-title {
    font-size: 1.65rem;
  }
}

/* Mobile still clean */
@media (max-width: 767.98px) {
  body.p20k-dashboard-clean main,
  body.p20k-dashboard-clean .container,
  body.p20k-dashboard-clean .container-fluid {
    padding-bottom: 22px !important;
  }

  body.p20k-dashboard-clean .p20j-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.p20k-dashboard-clean .p20j-dashboard-tile {
    min-height: 68px !important;
  }
}

/* ============================================================
   Phase 20l: Dashboard buttons belong at bottom, not top
   ============================================================ */

/* Hide dashboard top shortcut tiles */
body.p20l-dashboard-bottom-buttons .p20j-dashboard-home,
body.p20l-dashboard-bottom-buttons .p20i-dashboard-hero {
  display: none !important;
}

/* Undo Phase 20k dashboard hiding of bottom/admin menu */
body.p20l-dashboard-bottom-buttons .p20c-admin-quick {
  display: block !important;
}

/* Keep dashboard content away from bottom menu */
body.p20l-dashboard-bottom-buttons main,
body.p20l-dashboard-bottom-buttons .container,
body.p20l-dashboard-bottom-buttons .container-fluid {
  padding-bottom: 98px !important;
}

/* Desktop: make dashboard menu small and at bottom-right */
@media (min-width: 768px) {
  body.p20l-dashboard-bottom-buttons .p20c-admin-quick {
    right: 22px !important;
    bottom: 22px !important;
    left: auto !important;
  }

  body.p20l-dashboard-bottom-buttons .p20c-admin-main {
    min-width: 54px !important;
    width: 54px !important;
    height: 54px !important;
    padding: 0 !important;
    border-radius: 999px !important;
  }

  body.p20l-dashboard-bottom-buttons .p20c-admin-main span:not(.p20c-admin-icon) {
    display: none !important;
  }

  body.p20l-dashboard-bottom-buttons .p20c-admin-icon {
    width: 32px !important;
    height: 32px !important;
  }

  body.p20l-dashboard-bottom-buttons .p20c-admin-menu {
    bottom: 66px !important;
  }
}

/* Mobile: same inline bottom icons as all other admin pages */
@media (max-width: 767.98px) {
  body.p20l-dashboard-bottom-buttons main,
  body.p20l-dashboard-bottom-buttons .container,
  body.p20l-dashboard-bottom-buttons .container-fluid {
    padding-bottom: 92px !important;
  }

  body.p20l-dashboard-bottom-buttons .p20c-admin-quick {
    display: block !important;
  }

  body.p20l-dashboard-bottom-buttons .p20c-admin-menu a.p20c-primary {
    display: none !important;
  }

  body.p20l-dashboard-bottom-buttons .p20c-admin-main,
  body.p20l-dashboard-bottom-buttons .p20c-admin-backdrop,
  body.p20l-dashboard-bottom-buttons .p20c-admin-quick input {
    display: none !important;
  }

  body.p20l-dashboard-bottom-buttons .p20c-admin-menu {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

/* ============================================================
   Phase 20m: dashboard quick access icon cards
   Compact, clean, mobile-friendly dashboard section
   ============================================================ */

body.p20m-dashboard-page .p20m-dashboard-shortcuts {
  margin: 0 0 1rem 0;
}

body.p20m-dashboard-page .p20m-dashboard-card {
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
  overflow: hidden;
}

body.p20m-dashboard-page .p20m-dashboard-card-header {
  padding: .95rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

body.p20m-dashboard-page .p20m-dashboard-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -.02em;
}

body.p20m-dashboard-page .p20m-dashboard-card-subtitle {
  margin: .18rem 0 0;
  color: #64748b;
  font-size: .88rem;
  font-weight: 600;
}

body.p20m-dashboard-page .p20m-dashboard-grid {
  display: grid;
  gap: .85rem;
  padding: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.p20m-dashboard-page .p20m-dashboard-link {
  min-width: 0;
  min-height: 110px;
  padding: .95rem .9rem;
  border-radius: 18px;
  text-decoration: none !important;
  color: #0f172a !important;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .55rem;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

body.p20m-dashboard-page .p20m-dashboard-link:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
  color: #020617 !important;
}

body.p20m-dashboard-page .p20m-dashboard-link-primary {
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  border-color: #111827;
  color: #fff !important;
}

body.p20m-dashboard-page .p20m-dashboard-link-primary:hover {
  background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
  color: #fff !important;
}

body.p20m-dashboard-page .p20m-dashboard-icon {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  font-size: 1.15rem;
  line-height: 1;
}

body.p20m-dashboard-page .p20m-dashboard-link-primary .p20m-dashboard-icon {
  background: rgba(255,255,255,.14);
}

body.p20m-dashboard-page .p20m-dashboard-copy strong {
  display: block;
  font-size: 1rem;
  line-height: 1.08;
  font-weight: 900;
}

body.p20m-dashboard-page .p20m-dashboard-copy small {
  display: block;
  margin-top: .18rem;
  line-height: 1.15;
  font-size: .82rem;
  color: #64748b;
  font-weight: 650;
}

body.p20m-dashboard-page .p20m-dashboard-link-primary .p20m-dashboard-copy small {
  color: rgba(255,255,255,.74);
}

/* Desktop */
@media (min-width: 768px) {
  body.p20m-dashboard-page .p20m-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 767.98px) {
  body.p20m-dashboard-page .p20m-dashboard-shortcuts {
    margin-bottom: .75rem;
  }

  body.p20m-dashboard-page .p20m-dashboard-card {
    border-radius: 16px;
  }

  body.p20m-dashboard-page .p20m-dashboard-card-header {
    padding: .75rem .85rem;
  }

  body.p20m-dashboard-page .p20m-dashboard-card-title {
    font-size: .96rem;
  }

  body.p20m-dashboard-page .p20m-dashboard-card-subtitle {
    font-size: .78rem;
    margin-top: .12rem;
  }

  body.p20m-dashboard-page .p20m-dashboard-grid {
    padding: .75rem;
    gap: .55rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.p20m-dashboard-page .p20m-dashboard-link {
    min-height: 88px;
    padding: .7rem .58rem;
    border-radius: 15px;
    gap: .38rem;
    text-align: center;
    align-items: center;
  }

  body.p20m-dashboard-page .p20m-dashboard-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    font-size: .95rem;
  }

  body.p20m-dashboard-page .p20m-dashboard-copy strong {
    font-size: .78rem;
  }

  body.p20m-dashboard-page .p20m-dashboard-copy small {
    display: none;
  }
}

/* ============================================================
   Phase 20n: simple neat dashboard buttons
   One clean quick access area only.
   ============================================================ */

body.p20n-dashboard-simple {
  background: #f8fafc !important;
}

/* Hide older custom dashboard shortcut blocks */
body.p20n-dashboard-simple .p20i-dashboard-hero,
body.p20n-dashboard-simple .p20j-dashboard-home,
body.p20n-dashboard-simple .p20m-dashboard-shortcuts,
body.p20n-dashboard-simple .p20j-dashboard-more {
  display: none !important;
}

/* Dashboard content spacing */
body.p20n-dashboard-simple main,
body.p20n-dashboard-simple .container,
body.p20n-dashboard-simple .container-fluid {
  padding-bottom: 96px !important;
}

/* Main simple shortcuts block */
.p20n-dashboard-shortcuts {
  margin: 0 0 1rem 0;
}

.p20n-dashboard-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
  overflow: hidden;
}

.p20n-dashboard-panel-head {
  padding: 1rem 1rem .85rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.p20n-dashboard-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -.02em;
}

.p20n-dashboard-subtitle {
  margin: .18rem 0 0;
  font-size: .88rem;
  color: #64748b;
  font-weight: 600;
}

.p20n-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  padding: 1rem;
}

.p20n-dashboard-btn {
  min-width: 0;
  min-height: 100px;
  padding: .85rem .8rem;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-decoration: none !important;
  color: #0f172a !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .45rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.p20n-dashboard-btn:hover {
  background: #f1f5f9;
  color: #020617 !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

.p20n-dashboard-btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}

.p20n-dashboard-btn-copy {
  min-width: 0;
}

.p20n-dashboard-btn-copy strong {
  display: block;
  font-size: .98rem;
  line-height: 1.08;
  font-weight: 900;
}

.p20n-dashboard-btn-copy small {
  display: block;
  margin-top: .15rem;
  font-size: .8rem;
  line-height: 1.15;
  color: #64748b;
  font-weight: 650;
}

/* Desktop */
@media (min-width: 768px) {
  .p20n-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 767.98px) {
  .p20n-dashboard-shortcuts {
    margin-bottom: .75rem;
  }

  .p20n-dashboard-panel {
    border-radius: 16px;
  }

  .p20n-dashboard-panel-head {
    padding: .8rem .85rem .7rem;
  }

  .p20n-dashboard-title {
    font-size: .96rem;
  }

  .p20n-dashboard-subtitle {
    font-size: .76rem;
  }

  .p20n-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    padding: .75rem;
  }

  .p20n-dashboard-btn {
    min-height: 84px;
    padding: .7rem .55rem;
    border-radius: 15px;
    align-items: center;
    text-align: center;
    gap: .32rem;
  }

  .p20n-dashboard-btn-icon {
    width: 31px;
    height: 31px;
    border-radius: 12px;
    font-size: .95rem;
  }

  .p20n-dashboard-btn-copy strong {
    font-size: .76rem;
  }

  .p20n-dashboard-btn-copy small {
    display: none;
  }
}

/* ============================================================
   Phase 20o v2: Dashboard order status snapshot
   ============================================================ */

.p20o-order-snapshot {
  margin: 0 0 1rem 0;
}

.p20o-snapshot-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
  overflow: hidden;
}

.p20o-snapshot-head {
  padding: .9rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.p20o-snapshot-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  color: #0f172a;
}

.p20o-snapshot-subtitle {
  margin: .12rem 0 0;
  font-size: .8rem;
  color: #64748b;
  font-weight: 650;
}

.p20o-snapshot-view-all {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: .42rem .65rem;
  background: #111827;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 850;
  font-size: .76rem;
}

.p20o-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .6rem;
  padding: .9rem;
}

.p20o-snapshot-card {
  min-width: 0;
  min-height: 88px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  text-decoration: none !important;
  color: #0f172a !important;
  padding: .65rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .28rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}

.p20o-snapshot-card:hover {
  background: #f1f5f9;
  color: #020617 !important;
  transform: translateY(-1px);
}

.p20o-snapshot-icon {
  width: 28px;
  height: 28px;
  border-radius: 11px;
  background: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.p20o-snapshot-count {
  font-size: 1.28rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.04em;
}

.p20o-snapshot-label {
  font-size: .7rem;
  line-height: 1.05;
  color: #64748b;
  font-weight: 850;
}

@media (max-width: 767.98px) {
  .p20o-order-snapshot {
    margin-bottom: .7rem;
  }

  .p20o-snapshot-panel {
    border-radius: 16px;
  }

  .p20o-snapshot-head {
    padding: .7rem .78rem;
  }

  .p20o-snapshot-title {
    font-size: .9rem;
  }

  .p20o-snapshot-subtitle {
    font-size: .7rem;
  }

  .p20o-snapshot-view-all {
    font-size: .66rem;
    padding: .35rem .5rem;
  }

  .p20o-snapshot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: .65rem;
    gap: .45rem;
  }

  .p20o-snapshot-card {
    min-height: 72px;
    border-radius: 13px;
    padding: .5rem .32rem;
    align-items: center;
    text-align: center;
    gap: .22rem;
  }

  .p20o-snapshot-icon {
    width: 24px;
    height: 24px;
    border-radius: 9px;
    font-size: .8rem;
  }

  .p20o-snapshot-count {
    font-size: 1rem;
  }

  .p20o-snapshot-label {
    font-size: .56rem;
  }
}

/* ============================================================
   Phase 20p: Orders page filter hub
   ============================================================ */

.p20p-orders-filter-panel {
  margin: 0 0 1rem 0;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
  overflow: hidden;
}

.p20p-orders-filter-head {
  padding: .9rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
}

.p20p-orders-filter-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  color: #0f172a;
}

.p20p-orders-filter-subtitle {
  margin: .15rem 0 0;
  font-size: .78rem;
  color: #64748b;
  font-weight: 650;
}

.p20p-orders-filter-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
  padding: .35rem .58rem;
}

.p20p-orders-filter-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .55rem;
  padding: .85rem;
}

.p20p-orders-filter-chip {
  min-width: 0;
  min-height: 58px;
  border-radius: 15px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a !important;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .18rem;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .04);
}

.p20p-orders-filter-chip:hover {
  background: #f1f5f9;
  color: #020617 !important;
}

.p20p-orders-filter-chip.is-active {
  background: #111827;
  border-color: #111827;
  color: #fff !important;
}

.p20p-orders-filter-chip span {
  font-size: 1rem;
  line-height: 1;
}

.p20p-orders-filter-chip small {
  font-size: .66rem;
  line-height: 1;
}

.p20p-orders-hidden-row {
  display: none !important;
}

.p20p-no-orders-message {
  display: none;
  margin: .75rem 0;
  padding: .8rem;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-weight: 750;
  text-align: center;
}

.p20p-no-orders-message.is-visible {
  display: block;
}

@media (max-width: 767.98px) {
  .p20p-orders-filter-panel {
    border-radius: 16px;
    margin-bottom: .75rem;
  }

  .p20p-orders-filter-head {
    padding: .72rem .78rem;
  }

  .p20p-orders-filter-title {
    font-size: .9rem;
  }

  .p20p-orders-filter-subtitle {
    font-size: .68rem;
  }

  .p20p-orders-filter-count {
    font-size: .62rem;
    padding: .3rem .45rem;
  }

  .p20p-orders-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .42rem;
    padding: .65rem;
  }

  .p20p-orders-filter-chip {
    min-height: 55px;
    border-radius: 13px;
  }

  .p20p-orders-filter-chip span {
    font-size: .92rem;
  }

  .p20p-orders-filter-chip small {
    font-size: .56rem;
  }
}

/* ============================================================
   Phase 20q: Clean Orders page mobile + desktop
   ============================================================ */

body.p20q-orders-clean {
  background: #f8fafc !important;
}

/* Top New Order button cleaner */
body.p20q-orders-clean .p20e-orders-page-action {
  margin-bottom: .65rem !important;
}

body.p20q-orders-clean .p20e-orders-page-action a {
  border-radius: 14px !important;
  font-weight: 900 !important;
}

/* Make order filter hub smaller and less noisy */
body.p20q-orders-clean .p20p-orders-filter-panel {
  border-radius: 16px !important;
  margin-bottom: .75rem !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05) !important;
}

body.p20q-orders-clean .p20p-orders-filter-head {
  padding: .7rem .8rem !important;
}

body.p20q-orders-clean .p20p-orders-filter-title {
  font-size: .9rem !important;
}

body.p20q-orders-clean .p20p-orders-filter-subtitle {
  display: none !important;
}

body.p20q-orders-clean .p20p-orders-filter-grid {
  padding: .65rem !important;
  gap: .4rem !important;
}

body.p20q-orders-clean .p20p-orders-filter-chip {
  min-height: 48px !important;
  border-radius: 12px !important;
}

body.p20q-orders-clean .p20p-orders-filter-chip span {
  font-size: .82rem !important;
}

body.p20q-orders-clean .p20p-orders-filter-chip small {
  font-size: .58rem !important;
}

/* Desktop: cleaner table */
@media (min-width: 768px) {
  body.p20q-orders-clean table {
    font-size: .92rem;
  }

  body.p20q-orders-clean table thead th {
    font-size: .72rem !important;
    padding: .65rem .7rem !important;
  }

  body.p20q-orders-clean table td {
    padding: .62rem .7rem !important;
  }

  body.p20q-orders-clean .badge {
    font-size: .67rem !important;
    padding: .25rem .45rem !important;
  }

  body.p20q-orders-clean .btn-sm {
    min-height: 31px !important;
    padding: .28rem .5rem !important;
    font-size: .78rem !important;
  }
}

/* Mobile: clean order cards */
@media (max-width: 767.98px) {
  body.p20q-orders-clean main,
  body.p20q-orders-clean .container,
  body.p20q-orders-clean .container-fluid {
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-bottom: 92px !important;
  }

  body.p20q-orders-clean h1,
  body.p20q-orders-clean .h1 {
    font-size: 1.22rem !important;
    margin-bottom: .5rem !important;
  }

  body.p20q-orders-clean .p20e-orders-page-action a {
    min-height: 40px !important;
    font-size: .86rem !important;
  }

  body.p20q-orders-clean .p20p-orders-filter-head {
    padding: .58rem .65rem !important;
  }

  body.p20q-orders-clean .p20p-orders-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    padding: .55rem !important;
    gap: .34rem !important;
  }

  body.p20q-orders-clean .p20p-orders-filter-chip {
    min-height: 43px !important;
    border-radius: 11px !important;
  }

  body.p20q-orders-clean .p20p-orders-filter-chip span {
    font-size: .76rem !important;
  }

  body.p20q-orders-clean .p20p-orders-filter-chip small {
    font-size: .52rem !important;
  }

  body.p20q-orders-clean .p20b-table-shell {
    border: 0 !important;
    background: transparent !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table tr {
    position: relative;
    padding: .55rem .62rem .62rem !important;
    margin-bottom: .62rem !important;
    border-radius: 15px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06) !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td {
    display: grid !important;
    grid-template-columns: minmax(82px, 33%) minmax(0, 1fr) !important;
    gap: .45rem !important;
    padding: .34rem .02rem !important;
    min-height: 26px !important;
    align-items: start !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td::before {
    font-size: .66rem !important;
    line-height: 1.1 !important;
    color: #64748b !important;
    font-weight: 900 !important;
    padding-top: .08rem !important;
  }

  /* Less important fields are hidden until More details is tapped */
  body.p20q-orders-clean table.p20b-responsive-table tr:not(.p20q-expanded) td.p20q-extra-cell {
    display: none !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td.p20q-important-cell {
    display: grid !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td.p20b-actions-cell,
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="Action"],
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="action"],
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="View"],
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="Manage"] {
    display: block !important;
    padding-top: .45rem !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td.p20b-actions-cell::before,
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="Action"]::before,
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="action"]::before,
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="View"]::before,
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="Manage"]::before {
    display: none !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td .btn,
  body.p20q-orders-clean table.p20b-responsive-table td form .btn {
    width: 100% !important;
    min-height: 36px !important;
    border-radius: 11px !important;
    font-size: .76rem !important;
    padding: .34rem .45rem !important;
    margin-top: .25rem !important;
  }

  body.p20q-orders-clean .badge {
    font-size: .53rem !important;
    line-height: 1 !important;
    padding: .14rem .28rem !important;
  }

  .p20q-row-more-btn {
    width: 100%;
    min-height: 34px;
    margin-top: .35rem;
    border-radius: 11px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: .74rem;
    font-weight: 900;
  }

  .p20q-row-more-btn:active {
    background: #e2e8f0;
  }
}

/* ============================================================
   Phase 20q: Clean Orders page mobile + desktop
   ============================================================ */

body.p20q-orders-clean {
  background: #f8fafc !important;
}

/* Top New Order button cleaner */
body.p20q-orders-clean .p20e-orders-page-action {
  margin-bottom: .65rem !important;
}

body.p20q-orders-clean .p20e-orders-page-action a {
  border-radius: 14px !important;
  font-weight: 900 !important;
}

/* Make order filter hub smaller and less noisy */
body.p20q-orders-clean .p20p-orders-filter-panel {
  border-radius: 16px !important;
  margin-bottom: .75rem !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05) !important;
}

body.p20q-orders-clean .p20p-orders-filter-head {
  padding: .7rem .8rem !important;
}

body.p20q-orders-clean .p20p-orders-filter-title {
  font-size: .9rem !important;
}

body.p20q-orders-clean .p20p-orders-filter-subtitle {
  display: none !important;
}

body.p20q-orders-clean .p20p-orders-filter-grid {
  padding: .65rem !important;
  gap: .4rem !important;
}

body.p20q-orders-clean .p20p-orders-filter-chip {
  min-height: 48px !important;
  border-radius: 12px !important;
}

body.p20q-orders-clean .p20p-orders-filter-chip span {
  font-size: .82rem !important;
}

body.p20q-orders-clean .p20p-orders-filter-chip small {
  font-size: .58rem !important;
}

/* Desktop: cleaner table */
@media (min-width: 768px) {
  body.p20q-orders-clean table {
    font-size: .92rem;
  }

  body.p20q-orders-clean table thead th {
    font-size: .72rem !important;
    padding: .65rem .7rem !important;
  }

  body.p20q-orders-clean table td {
    padding: .62rem .7rem !important;
  }

  body.p20q-orders-clean .badge {
    font-size: .67rem !important;
    padding: .25rem .45rem !important;
  }

  body.p20q-orders-clean .btn-sm {
    min-height: 31px !important;
    padding: .28rem .5rem !important;
    font-size: .78rem !important;
  }
}

/* Mobile: clean order cards */
@media (max-width: 767.98px) {
  body.p20q-orders-clean main,
  body.p20q-orders-clean .container,
  body.p20q-orders-clean .container-fluid {
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-bottom: 92px !important;
  }

  body.p20q-orders-clean h1,
  body.p20q-orders-clean .h1 {
    font-size: 1.22rem !important;
    margin-bottom: .5rem !important;
  }

  body.p20q-orders-clean .p20e-orders-page-action a {
    min-height: 40px !important;
    font-size: .86rem !important;
  }

  body.p20q-orders-clean .p20p-orders-filter-head {
    padding: .58rem .65rem !important;
  }

  body.p20q-orders-clean .p20p-orders-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    padding: .55rem !important;
    gap: .34rem !important;
  }

  body.p20q-orders-clean .p20p-orders-filter-chip {
    min-height: 43px !important;
    border-radius: 11px !important;
  }

  body.p20q-orders-clean .p20p-orders-filter-chip span {
    font-size: .76rem !important;
  }

  body.p20q-orders-clean .p20p-orders-filter-chip small {
    font-size: .52rem !important;
  }

  body.p20q-orders-clean .p20b-table-shell {
    border: 0 !important;
    background: transparent !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table tr {
    position: relative;
    padding: .55rem .62rem .62rem !important;
    margin-bottom: .62rem !important;
    border-radius: 15px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06) !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td {
    display: grid !important;
    grid-template-columns: minmax(82px, 33%) minmax(0, 1fr) !important;
    gap: .45rem !important;
    padding: .34rem .02rem !important;
    min-height: 26px !important;
    align-items: start !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td::before {
    font-size: .66rem !important;
    line-height: 1.1 !important;
    color: #64748b !important;
    font-weight: 900 !important;
    padding-top: .08rem !important;
  }

  /* Less important fields are hidden until More details is tapped */
  body.p20q-orders-clean table.p20b-responsive-table tr:not(.p20q-expanded) td.p20q-extra-cell {
    display: none !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td.p20q-important-cell {
    display: grid !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td.p20b-actions-cell,
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="Action"],
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="action"],
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="View"],
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="Manage"] {
    display: block !important;
    padding-top: .45rem !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td.p20b-actions-cell::before,
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="Action"]::before,
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="action"]::before,
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="View"]::before,
  body.p20q-orders-clean table.p20b-responsive-table td[data-label*="Manage"]::before {
    display: none !important;
  }

  body.p20q-orders-clean table.p20b-responsive-table td .btn,
  body.p20q-orders-clean table.p20b-responsive-table td form .btn {
    width: 100% !important;
    min-height: 36px !important;
    border-radius: 11px !important;
    font-size: .76rem !important;
    padding: .34rem .45rem !important;
    margin-top: .25rem !important;
  }

  body.p20q-orders-clean .badge {
    font-size: .53rem !important;
    line-height: 1 !important;
    padding: .14rem .28rem !important;
  }

  .p20q-row-more-btn {
    width: 100%;
    min-height: 34px;
    margin-top: .35rem;
    border-radius: 11px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: .74rem;
    font-weight: 900;
  }

  .p20q-row-more-btn:active {
    background: #e2e8f0;
  }
}

/* ============================================================
   Phase 20r: Orders mobile simple cards
   Hide cluttered row buttons on mobile and show one Open button.
   ============================================================ */

@media (max-width: 767.98px) {
  body.p20r-orders-simple main,
  body.p20r-orders-simple .container,
  body.p20r-orders-simple .container-fluid {
    padding-left: 7px !important;
    padding-right: 7px !important;
    padding-bottom: 92px !important;
  }

  /* New order button smaller */
  body.p20r-orders-simple .p20e-orders-page-action {
    margin-bottom: .55rem !important;
  }

  body.p20r-orders-simple .p20e-orders-page-action a {
    min-height: 38px !important;
    border-radius: 12px !important;
    font-size: .82rem !important;
    padding: .35rem .6rem !important;
  }

  /* Filter buttons become small horizontal chips */
  body.p20r-orders-simple .p20p-orders-filter-panel {
    border-radius: 14px !important;
    margin-bottom: .55rem !important;
  }

  body.p20r-orders-simple .p20p-orders-filter-head {
    display: none !important;
  }

  body.p20r-orders-simple .p20p-orders-filter-grid {
    display: flex !important;
    overflow-x: auto !important;
    gap: .35rem !important;
    padding: .5rem !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.p20r-orders-simple .p20p-orders-filter-grid::-webkit-scrollbar {
    display: none;
  }

  body.p20r-orders-simple .p20p-orders-filter-chip {
    flex: 0 0 auto !important;
    min-width: 58px !important;
    min-height: 36px !important;
    border-radius: 999px !important;
    padding: .25rem .45rem !important;
    display: inline-flex !important;
    flex-direction: row !important;
    gap: .25rem !important;
  }

  body.p20r-orders-simple .p20p-orders-filter-chip span {
    font-size: .72rem !important;
  }

  body.p20r-orders-simple .p20p-orders-filter-chip small {
    font-size: .58rem !important;
  }

  /* Order card shape */
  body.p20r-orders-simple table.p20b-responsive-table tr {
    padding: .52rem .58rem !important;
    margin-bottom: .55rem !important;
    border-radius: 14px !important;
    box-shadow: 0 7px 18px rgba(15, 23, 42, .06) !important;
  }

  /* Hide all less useful details unless explicitly marked important */
  body.p20r-orders-simple table.p20b-responsive-table tr td {
    display: none !important;
  }

  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-show-cell {
    display: grid !important;
    grid-template-columns: 78px minmax(0, 1fr) !important;
    gap: .35rem !important;
    padding: .24rem .02rem !important;
    min-height: 22px !important;
    align-items: start !important;
    overflow-wrap: anywhere !important;
  }

  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-show-cell::before {
    content: attr(data-label);
    font-size: .62rem !important;
    line-height: 1.1 !important;
    color: #64748b !important;
    font-weight: 900 !important;
    padding-top: .06rem;
  }

  /* First visible field becomes stronger */
  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-main-cell {
    display: block !important;
    padding: .1rem 0 .35rem !important;
    border-bottom: 1px solid #eef2f7 !important;
    margin-bottom: .22rem;
  }

  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-main-cell::before {
    display: none !important;
  }

  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-main-cell,
  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-main-cell a {
    font-size: .9rem !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    text-decoration: none !important;
  }

  /* Make badges tiny and safe */
  body.p20r-orders-simple table.p20b-responsive-table .badge {
    font-size: .5rem !important;
    line-height: 1 !important;
    padding: .12rem .24rem !important;
    border-radius: 999px !important;
    white-space: normal !important;
  }

  /* Hide all original clutter action buttons/forms on mobile */
  body.p20r-orders-simple table.p20b-responsive-table tr td a.btn:not(.p20r-open-order),
  body.p20r-orders-simple table.p20b-responsive-table tr td button:not(.p20r-open-order),
  body.p20r-orders-simple table.p20b-responsive-table tr td form,
  body.p20r-orders-simple table.p20b-responsive-table tr td .btn-group,
  body.p20r-orders-simple table.p20b-responsive-table tr td .dropdown,
  body.p20r-orders-simple table.p20b-responsive-table tr td .p20q-row-more-btn,
  body.p20r-orders-simple table.p20b-responsive-table tr td .p20f-repeat-order-link {
    display: none !important;
  }

  /* Only one clean Open button */
  body.p20r-orders-simple .p20r-actions-cell {
    display: block !important;
    padding: .48rem 0 0 !important;
  }

  body.p20r-orders-simple .p20r-actions-cell::before {
    display: none !important;
  }

  body.p20r-orders-simple .p20r-open-order {
    display: flex !important;
    width: 100% !important;
    min-height: 36px !important;
    border-radius: 11px !important;
    align-items: center !important;
    justify-content: center !important;
    background: #111827 !important;
    border: 1px solid #111827 !important;
    color: #fff !important;
    font-size: .78rem !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    padding: .35rem .55rem !important;
    margin-top: .2rem !important;
  }

  body.p20r-orders-simple .p20r-open-order:hover,
  body.p20r-orders-simple .p20r-open-order:active {
    background: #020617 !important;
    color: #fff !important;
  }
}

/* ============================================================
   Phase 20r: Orders mobile simple cards
   Hide cluttered row buttons on mobile and show one Open button.
   ============================================================ */

@media (max-width: 767.98px) {
  body.p20r-orders-simple main,
  body.p20r-orders-simple .container,
  body.p20r-orders-simple .container-fluid {
    padding-left: 7px !important;
    padding-right: 7px !important;
    padding-bottom: 92px !important;
  }

  /* New order button smaller */
  body.p20r-orders-simple .p20e-orders-page-action {
    margin-bottom: .55rem !important;
  }

  body.p20r-orders-simple .p20e-orders-page-action a {
    min-height: 38px !important;
    border-radius: 12px !important;
    font-size: .82rem !important;
    padding: .35rem .6rem !important;
  }

  /* Filter buttons become small horizontal chips */
  body.p20r-orders-simple .p20p-orders-filter-panel {
    border-radius: 14px !important;
    margin-bottom: .55rem !important;
  }

  body.p20r-orders-simple .p20p-orders-filter-head {
    display: none !important;
  }

  body.p20r-orders-simple .p20p-orders-filter-grid {
    display: flex !important;
    overflow-x: auto !important;
    gap: .35rem !important;
    padding: .5rem !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.p20r-orders-simple .p20p-orders-filter-grid::-webkit-scrollbar {
    display: none;
  }

  body.p20r-orders-simple .p20p-orders-filter-chip {
    flex: 0 0 auto !important;
    min-width: 58px !important;
    min-height: 36px !important;
    border-radius: 999px !important;
    padding: .25rem .45rem !important;
    display: inline-flex !important;
    flex-direction: row !important;
    gap: .25rem !important;
  }

  body.p20r-orders-simple .p20p-orders-filter-chip span {
    font-size: .72rem !important;
  }

  body.p20r-orders-simple .p20p-orders-filter-chip small {
    font-size: .58rem !important;
  }

  /* Order card shape */
  body.p20r-orders-simple table.p20b-responsive-table tr {
    padding: .52rem .58rem !important;
    margin-bottom: .55rem !important;
    border-radius: 14px !important;
    box-shadow: 0 7px 18px rgba(15, 23, 42, .06) !important;
  }

  /* Hide all less useful details unless explicitly marked important */
  body.p20r-orders-simple table.p20b-responsive-table tr td {
    display: none !important;
  }

  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-show-cell {
    display: grid !important;
    grid-template-columns: 78px minmax(0, 1fr) !important;
    gap: .35rem !important;
    padding: .24rem .02rem !important;
    min-height: 22px !important;
    align-items: start !important;
    overflow-wrap: anywhere !important;
  }

  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-show-cell::before {
    content: attr(data-label);
    font-size: .62rem !important;
    line-height: 1.1 !important;
    color: #64748b !important;
    font-weight: 900 !important;
    padding-top: .06rem;
  }

  /* First visible field becomes stronger */
  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-main-cell {
    display: block !important;
    padding: .1rem 0 .35rem !important;
    border-bottom: 1px solid #eef2f7 !important;
    margin-bottom: .22rem;
  }

  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-main-cell::before {
    display: none !important;
  }

  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-main-cell,
  body.p20r-orders-simple table.p20b-responsive-table tr td.p20r-main-cell a {
    font-size: .9rem !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    text-decoration: none !important;
  }

  /* Make badges tiny and safe */
  body.p20r-orders-simple table.p20b-responsive-table .badge {
    font-size: .5rem !important;
    line-height: 1 !important;
    padding: .12rem .24rem !important;
    border-radius: 999px !important;
    white-space: normal !important;
  }

  /* Hide all original clutter action buttons/forms on mobile */
  body.p20r-orders-simple table.p20b-responsive-table tr td a.btn:not(.p20r-open-order),
  body.p20r-orders-simple table.p20b-responsive-table tr td button:not(.p20r-open-order),
  body.p20r-orders-simple table.p20b-responsive-table tr td form,
  body.p20r-orders-simple table.p20b-responsive-table tr td .btn-group,
  body.p20r-orders-simple table.p20b-responsive-table tr td .dropdown,
  body.p20r-orders-simple table.p20b-responsive-table tr td .p20q-row-more-btn,
  body.p20r-orders-simple table.p20b-responsive-table tr td .p20f-repeat-order-link {
    display: none !important;
  }

  /* Only one clean Open button */
  body.p20r-orders-simple .p20r-actions-cell {
    display: block !important;
    padding: .48rem 0 0 !important;
  }

  body.p20r-orders-simple .p20r-actions-cell::before {
    display: none !important;
  }

  body.p20r-orders-simple .p20r-open-order {
    display: flex !important;
    width: 100% !important;
    min-height: 36px !important;
    border-radius: 11px !important;
    align-items: center !important;
    justify-content: center !important;
    background: #111827 !important;
    border: 1px solid #111827 !important;
    color: #fff !important;
    font-size: .78rem !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    padding: .35rem .55rem !important;
    margin-top: .2rem !important;
  }

  body.p20r-orders-simple .p20r-open-order:hover,
  body.p20r-orders-simple .p20r-open-order:active {
    background: #020617 !important;
    color: #fff !important;
  }
}

/* ============================================================
   Phase 20s: Real mobile order cards
   Hide messy original orders table on mobile and show clean cards.
   ============================================================ */

.p20s-mobile-orders-list {
  display: none;
}

@media (max-width: 767.98px) {
  body.p20s-orders-mobile-cards main,
  body.p20s-orders-mobile-cards .container,
  body.p20s-orders-mobile-cards .container-fluid {
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-bottom: 92px !important;
  }

  /* Hide original messy orders table only on mobile */
  body.p20s-orders-mobile-cards .p20b-table-shell,
  body.p20s-orders-mobile-cards table.p20b-responsive-table {
    display: none !important;
  }

  .p20s-mobile-orders-list {
    display: grid;
    gap: .6rem;
    margin: .65rem 0 .9rem;
  }

  .p20s-order-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
    padding: .72rem;
    overflow: hidden;
  }

  .p20s-order-top {
    display: flex;
    justify-content: space-between;
    gap: .65rem;
    align-items: flex-start;
    padding-bottom: .45rem;
    border-bottom: 1px solid #eef2f7;
  }

  .p20s-order-title {
    min-width: 0;
  }

  .p20s-order-title strong {
    display: block;
    font-size: .94rem;
    line-height: 1.08;
    color: #0f172a;
    font-weight: 950;
    overflow-wrap: anywhere;
  }

  .p20s-order-title small {
    display: block;
    margin-top: .15rem;
    font-size: .72rem;
    line-height: 1.15;
    color: #64748b;
    font-weight: 750;
    overflow-wrap: anywhere;
  }

  .p20s-status-pill {
    flex: 0 0 auto;
    max-width: 44%;
    border-radius: 999px;
    padding: .22rem .42rem;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-size: .58rem;
    line-height: 1.05;
    font-weight: 900;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .p20s-order-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
    margin-top: .55rem;
  }

  .p20s-mini {
    min-width: 0;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    padding: .42rem .38rem;
  }

  .p20s-mini span {
    display: block;
    font-size: .55rem;
    line-height: 1;
    color: #64748b;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
  }

  .p20s-mini strong {
    display: block;
    margin-top: .2rem;
    font-size: .72rem;
    line-height: 1.08;
    color: #0f172a;
    font-weight: 900;
    overflow-wrap: anywhere;
  }

  .p20s-order-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: .4rem;
    margin-top: .58rem;
  }

  .p20s-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 12px;
    background: #111827;
    color: #fff !important;
    text-decoration: none !important;
    font-size: .8rem;
    font-weight: 950;
  }

  .p20s-open-btn:hover,
  .p20s-open-btn:active {
    background: #020617;
    color: #fff !important;
  }

  .p20s-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: .9rem;
    background: #fff;
    color: #64748b;
    font-weight: 800;
    text-align: center;
    font-size: .85rem;
  }

  /* Make filter chips even smaller above clean cards */
  body.p20s-orders-mobile-cards .p20p-orders-filter-panel {
    margin-bottom: .45rem !important;
  }

  body.p20s-orders-mobile-cards .p20p-orders-filter-grid {
    padding: .45rem !important;
  }

  body.p20s-orders-mobile-cards .p20p-orders-filter-chip {
    min-height: 34px !important;
    min-width: 54px !important;
  }

  body.p20s-orders-mobile-cards .p20e-orders-page-action a {
    min-height: 37px !important;
    font-size: .82rem !important;
  }
}

/* ============================================================
   Phase 20s: Real mobile order cards
   Hide messy original orders table on mobile and show clean cards.
   ============================================================ */

.p20s-mobile-orders-list {
  display: none;
}

@media (max-width: 767.98px) {
  body.p20s-orders-mobile-cards main,
  body.p20s-orders-mobile-cards .container,
  body.p20s-orders-mobile-cards .container-fluid {
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-bottom: 92px !important;
  }

  /* Hide original messy orders table only on mobile */
  body.p20s-orders-mobile-cards .p20b-table-shell,
  body.p20s-orders-mobile-cards table.p20b-responsive-table {
    display: none !important;
  }

  .p20s-mobile-orders-list {
    display: grid;
    gap: .6rem;
    margin: .65rem 0 .9rem;
  }

  .p20s-order-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
    padding: .72rem;
    overflow: hidden;
  }

  .p20s-order-top {
    display: flex;
    justify-content: space-between;
    gap: .65rem;
    align-items: flex-start;
    padding-bottom: .45rem;
    border-bottom: 1px solid #eef2f7;
  }

  .p20s-order-title {
    min-width: 0;
  }

  .p20s-order-title strong {
    display: block;
    font-size: .94rem;
    line-height: 1.08;
    color: #0f172a;
    font-weight: 950;
    overflow-wrap: anywhere;
  }

  .p20s-order-title small {
    display: block;
    margin-top: .15rem;
    font-size: .72rem;
    line-height: 1.15;
    color: #64748b;
    font-weight: 750;
    overflow-wrap: anywhere;
  }

  .p20s-status-pill {
    flex: 0 0 auto;
    max-width: 44%;
    border-radius: 999px;
    padding: .22rem .42rem;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-size: .58rem;
    line-height: 1.05;
    font-weight: 900;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .p20s-order-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
    margin-top: .55rem;
  }

  .p20s-mini {
    min-width: 0;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    padding: .42rem .38rem;
  }

  .p20s-mini span {
    display: block;
    font-size: .55rem;
    line-height: 1;
    color: #64748b;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
  }

  .p20s-mini strong {
    display: block;
    margin-top: .2rem;
    font-size: .72rem;
    line-height: 1.08;
    color: #0f172a;
    font-weight: 900;
    overflow-wrap: anywhere;
  }

  .p20s-order-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: .4rem;
    margin-top: .58rem;
  }

  .p20s-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 12px;
    background: #111827;
    color: #fff !important;
    text-decoration: none !important;
    font-size: .8rem;
    font-weight: 950;
  }

  .p20s-open-btn:hover,
  .p20s-open-btn:active {
    background: #020617;
    color: #fff !important;
  }

  .p20s-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: .9rem;
    background: #fff;
    color: #64748b;
    font-weight: 800;
    text-align: center;
    font-size: .85rem;
  }

  /* Make filter chips even smaller above clean cards */
  body.p20s-orders-mobile-cards .p20p-orders-filter-panel {
    margin-bottom: .45rem !important;
  }

  body.p20s-orders-mobile-cards .p20p-orders-filter-grid {
    padding: .45rem !important;
  }

  body.p20s-orders-mobile-cards .p20p-orders-filter-chip {
    min-height: 34px !important;
    min-width: 54px !important;
  }

  body.p20s-orders-mobile-cards .p20e-orders-page-action a {
    min-height: 37px !important;
    font-size: .82rem !important;
  }
}

/* ============================================================
   Phase 20u: Order detail + create order mobile fix
   Fix vertical order numbers, messy forms, selects and racket fields.
   ============================================================ */

/* Order detail/create pages should not inherit aggressive mobile table-card styling */
body.p20u-order-detail-page,
body.p20u-order-create-page {
  background: #f8fafc !important;
}

@media (max-width: 767.98px) {
  body.p20u-order-detail-page main,
  body.p20u-order-detail-page .container,
  body.p20u-order-detail-page .container-fluid,
  body.p20u-order-create-page main,
  body.p20u-order-create-page .container,
  body.p20u-order-create-page .container-fluid {
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-bottom: 92px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Fix vertical / squeezed text like ORD-2026... */
  body.p20u-order-detail-page h1,
  body.p20u-order-detail-page h2,
  body.p20u-order-detail-page h3,
  body.p20u-order-detail-page .h1,
  body.p20u-order-detail-page .h2,
  body.p20u-order-detail-page .h3,
  body.p20u-order-detail-page .badge,
  body.p20u-order-detail-page .btn,
  body.p20u-order-detail-page a,
  body.p20u-order-detail-page strong,
  body.p20u-order-detail-page .card-title,
  body.p20u-order-create-page h1,
  body.p20u-order-create-page h2,
  body.p20u-order-create-page h3,
  body.p20u-order-create-page .h1,
  body.p20u-order-create-page .h2,
  body.p20u-order-create-page .h3,
  body.p20u-order-create-page .badge,
  body.p20u-order-create-page .btn,
  body.p20u-order-create-page a,
  body.p20u-order-create-page strong,
  body.p20u-order-create-page .card-title {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
  }

  /* Badges should be small but not vertical */
  body.p20u-order-detail-page .badge,
  body.p20u-order-create-page .badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: .58rem !important;
    line-height: 1.05 !important;
    padding: .18rem .36rem !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  /* Cards */
  body.p20u-order-detail-page .card,
  body.p20u-order-create-page .card {
    border-radius: 15px !important;
    margin-bottom: .65rem !important;
    overflow: visible !important;
    width: 100% !important;
  }

  body.p20u-order-detail-page .card-header,
  body.p20u-order-create-page .card-header {
    padding: .7rem .78rem !important;
    font-size: .9rem !important;
  }

  body.p20u-order-detail-page .card-body,
  body.p20u-order-create-page .card-body {
    padding: .75rem !important;
  }

  /* Stop rows/flex areas from pushing content off screen */
  body.p20u-order-detail-page .row,
  body.p20u-order-create-page .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    row-gap: .55rem !important;
  }

  body.p20u-order-detail-page [class*="col-"],
  body.p20u-order-create-page [class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  body.p20u-order-detail-page .d-flex,
  body.p20u-order-create-page .d-flex {
    flex-wrap: wrap !important;
    gap: .45rem !important;
  }

  body.p20u-order-detail-page .justify-content-between,
  body.p20u-order-create-page .justify-content-between {
    align-items: stretch !important;
  }

  /* Forms/selects */
  body.p20u-order-detail-page form,
  body.p20u-order-create-page form {
    max-width: 100% !important;
  }

  body.p20u-order-detail-page .form-control,
  body.p20u-order-detail-page .form-select,
  body.p20u-order-create-page .form-control,
  body.p20u-order-create-page .form-select {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    border-radius: 13px !important;
    font-size: 16px !important; /* iPhone: stops zoom */
  }

  body.p20u-order-detail-page label,
  body.p20u-order-create-page label,
  body.p20u-order-detail-page .form-label,
  body.p20u-order-create-page .form-label {
    font-size: .78rem !important;
    font-weight: 850 !important;
    color: #334155 !important;
    margin-bottom: .25rem !important;
  }

  body.p20u-order-detail-page .btn,
  body.p20u-order-create-page .btn {
    min-height: 40px !important;
    border-radius: 12px !important;
    font-size: .82rem !important;
    font-weight: 850 !important;
    padding: .4rem .65rem !important;
  }

  body.p20u-order-detail-page .btn-sm,
  body.p20u-order-create-page .btn-sm {
    min-height: 36px !important;
    font-size: .76rem !important;
  }

  /* Button groups stack cleanly */
  body.p20u-order-detail-page .btn-group,
  body.p20u-order-create-page .btn-group {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .35rem !important;
    width: 100% !important;
  }

  body.p20u-order-detail-page .btn-group .btn,
  body.p20u-order-create-page .btn-group .btn {
    width: 100% !important;
    border-radius: 12px !important;
  }

  /* Tables inside order detail should scroll, not become broken vertical cards */
  body.p20u-order-detail-page .table-responsive,
  body.p20u-order-create-page .table-responsive {
    overflow-x: auto !important;
    border-radius: 13px !important;
    border: 1px solid #e2e8f0 !important;
  }

  body.p20u-order-detail-page table,
  body.p20u-order-create-page table {
    display: table !important;
    width: 100% !important;
    min-width: 640px !important;
    font-size: .8rem !important;
  }

  body.p20u-order-detail-page table thead,
  body.p20u-order-create-page table thead {
    display: table-header-group !important;
  }

  body.p20u-order-detail-page table tbody,
  body.p20u-order-create-page table tbody {
    display: table-row-group !important;
  }

  body.p20u-order-detail-page table tr,
  body.p20u-order-create-page table tr {
    display: table-row !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  body.p20u-order-detail-page table th,
  body.p20u-order-detail-page table td,
  body.p20u-order-create-page table th,
  body.p20u-order-create-page table td {
    display: table-cell !important;
    padding: .48rem .5rem !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  body.p20u-order-detail-page table td::before,
  body.p20u-order-create-page table td::before {
    display: none !important;
    content: none !important;
  }

  /* Create order page / racket area */
  body.p20u-order-create-page .racket,
  body.p20u-order-create-page .racket-row,
  body.p20u-order-create-page .racket-card,
  body.p20u-order-create-page [id*="racket"],
  body.p20u-order-create-page [class*="racket"] {
    max-width: 100% !important;
    overflow: visible !important;
  }

  body.p20u-order-create-page select[name*="racket"],
  body.p20u-order-create-page input[name*="racket"],
  body.p20u-order-create-page select[name*="string"],
  body.p20u-order-create-page input[name*="brand"],
  body.p20u-order-create-page input[name*="model"],
  body.p20u-order-create-page input[name*="tension"] {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* New racket detail block should stay visible and clean */
  body.p20u-order-create-page .p20u-new-racket-box,
  body.p20u-order-detail-page .p20u-new-racket-box {
    border: 1px dashed #cbd5e1 !important;
    background: #f8fafc !important;
    border-radius: 14px !important;
    padding: .65rem !important;
    margin-top: .55rem !important;
  }

  /* Reduce giant top whitespace if page header/nav creates it */
  body.p20u-order-detail-page .mb-4,
  body.p20u-order-create-page .mb-4 {
    margin-bottom: .7rem !important;
  }

  body.p20u-order-detail-page .mt-4,
  body.p20u-order-create-page .mt-4 {
    margin-top: .7rem !important;
  }
}

/* ============================================================
   Phase 20v: hard cleanup for Orders list + Create Order mobile
   ============================================================ */

/* New real orders template should not show old generated mobile-card overlays */
body:has(.orders-page-clean) .p20s-mobile-orders-list,
body:has(.orders-page-clean) .p20p-orders-filter-panel,
body:has(.orders-page-clean) .p20e-orders-page-action {
  display: none !important;
}

/* Force the new orders page layout to win on mobile */
@media (max-width: 767.98px) {
  body:has(.orders-page-clean) .orders-desktop-panel {
    display: none !important;
  }

  body:has(.orders-page-clean) .orders-mobile-list {
    display: grid !important;
    width: 100% !important;
  }

  body:has(.orders-page-clean) .order-card {
    width: 100% !important;
    max-width: 100% !important;
    writing-mode: horizontal-tb !important;
  }

  body:has(.orders-page-clean) .order-main strong,
  body:has(.orders-page-clean) .order-main small,
  body:has(.orders-page-clean) .order-status-pill,
  body:has(.orders-page-clean) .order-mini strong,
  body:has(.orders-page-clean) .order-mini span {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }
}

/* Create order page: proper mobile form */
@media (max-width: 767.98px) {
  .admin-create-order-page {
    padding: .65rem .5rem 92px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .admin-create-order-page .page-header {
    gap: .55rem !important;
    margin-bottom: .75rem !important;
  }

  .admin-create-order-page .page-header h1 {
    font-size: 1.22rem !important;
    font-weight: 950 !important;
  }

  .admin-create-order-page .page-subtitle {
    font-size: .78rem !important;
    line-height: 1.25 !important;
  }

  .admin-create-order-page .section-card {
    border-radius: 15px !important;
    margin-bottom: .7rem !important;
  }

  .admin-create-order-page .section-card .card-body {
    padding: .72rem !important;
  }

  .admin-create-order-page .section-title {
    font-size: .95rem !important;
    margin-bottom: .6rem !important;
  }

  .admin-create-order-page .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    row-gap: .55rem !important;
  }

  .admin-create-order-page [class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .admin-create-order-page .d-flex {
    flex-wrap: wrap !important;
    gap: .42rem !important;
  }

  .admin-create-order-page .form-label {
    font-size: .75rem !important;
    font-weight: 900 !important;
    margin-bottom: .22rem !important;
  }

  .admin-create-order-page .form-control,
  .admin-create-order-page .form-select {
    min-height: 43px !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .admin-create-order-page .btn {
    min-height: 39px !important;
    border-radius: 12px !important;
    font-size: .8rem !important;
    font-weight: 900 !important;
  }

  .admin-create-order-page .rackets-toolbar {
    display: block !important;
    margin-bottom: .6rem !important;
  }

  .admin-create-order-page .racket-line {
    border-radius: 14px !important;
    padding: .65rem !important;
    margin-bottom: .65rem !important;
    background: #fff !important;
  }

  .admin-create-order-page .racket-footer {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .45rem !important;
    margin-top: .65rem !important;
    padding-top: .65rem !important;
  }

  .admin-create-order-page .racket-footer .btn,
  .admin-create-order-page .rackets-toolbar .btn {
    width: 100% !important;
  }

  .admin-create-order-page .meta-chip {
    font-size: .62rem !important;
    padding: .18rem .38rem !important;
    white-space: normal !important;
  }

  .admin-create-order-page .alert,
  .admin-create-order-page .alert-soft,
  .admin-create-order-page .loaded-customer-alert {
    padding: .58rem .65rem !important;
    font-size: .78rem !important;
    border-radius: 12px !important;
  }

  .admin-create-order-page .extras-item {
    padding: .6rem !important;
    border-radius: 12px !important;
  }

  .admin-create-order-page .aside-note {
    padding: .65rem !important;
    border-radius: 13px !important;
    font-size: .78rem !important;
  }
}

/* ============================================================
   Phase 20w: Clean create-order racket form
   Simple mobile layout: Brand, Model, String, Qty, Tension, Price.
   ============================================================ */

/* Hide confusing existing brand/model dropdown columns.
   Typed brand/model inputs are now the source of truth. */
.admin-create-order-page .racket-brand-select,
.admin-create-order-page .racket-model-select {
  display: none !important;
}

.admin-create-order-page .racket-brand-select.closest-hidden,
.admin-create-order-page .racket-model-select.closest-hidden {
  display: none !important;
}

.admin-create-order-page .p20w-hidden-pick-col {
  display: none !important;
}

.admin-create-order-page .p20w-racket-help {
  font-size: .86rem;
}

/* Desktop: make racket form cleaner */
@media (min-width: 768px) {
  .admin-create-order-page .racket-line .row {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: .85rem !important;
    align-items: end !important;
  }

  .admin-create-order-page .racket-line .row > div {
    width: auto !important;
    max-width: none !important;
  }

  .admin-create-order-page .racket-line .row > div:has(.p20w-racket-brand) {
    grid-column: span 3;
  }

  .admin-create-order-page .racket-line .row > div:has(.p20w-racket-model) {
    grid-column: span 3;
  }

  .admin-create-order-page .racket-line .row > div:has(select[name="string_product_id"]) {
    grid-column: span 4;
  }

  .admin-create-order-page .racket-line .row > div:has(input[name="qty"]) {
    grid-column: span 2;
  }

  .admin-create-order-page .racket-line .row > div:has(input[name="tension_main"]),
  .admin-create-order-page .racket-line .row > div:has(input[name="tension_cross"]),
  .admin-create-order-page .racket-line .row > div:has(input[name="restring_price"]),
  .admin-create-order-page .racket-line .row > div:has(input[name="item_unit_price"]) {
    grid-column: span 2;
  }

  .admin-create-order-page .racket-line .row > div:has(input[name="item_notes"]) {
    grid-column: span 4;
  }

  .admin-create-order-page .racket-line .row > div:has(.remove-racket-btn) {
    grid-column: span 2;
  }
}

/* Mobile: simple stacked card */
@media (max-width: 767.98px) {
  .admin-create-order-page {
    padding: .55rem .45rem 92px !important;
  }

  .admin-create-order-page .page-header {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .5rem !important;
  }

  .admin-create-order-page .page-header h1 {
    font-size: 1.18rem !important;
  }

  .admin-create-order-page .page-subtitle {
    display: none !important;
  }

  .admin-create-order-page .section-card {
    border-radius: 14px !important;
    margin-bottom: .6rem !important;
  }

  .admin-create-order-page .section-card .card-body {
    padding: .66rem !important;
  }

  .admin-create-order-page .section-title {
    font-size: .92rem !important;
    margin-bottom: .5rem !important;
  }

  .admin-create-order-page .alert-soft {
    font-size: .74rem !important;
    line-height: 1.22 !important;
    padding: .55rem .6rem !important;
    border-radius: 12px !important;
  }

  .admin-create-order-page .rackets-toolbar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .5rem !important;
  }

  .admin-create-order-page .rackets-toolbar .small-help {
    display: none !important;
  }

  .admin-create-order-page #add-racket-btn {
    width: 100% !important;
    min-height: 38px !important;
  }

  .admin-create-order-page .meta-chip {
    display: none !important;
  }

  .admin-create-order-page .p20w-racket-help {
    margin-bottom: .55rem !important;
    font-size: .72rem !important;
  }

  .admin-create-order-page .racket-line {
    border-radius: 14px !important;
    padding: .62rem !important;
    margin-bottom: .62rem !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 7px 18px rgba(15,23,42,.05) !important;
  }

  .admin-create-order-page .racket-line::before {
    content: "Racket line";
    display: block;
    font-weight: 950;
    color: #0f172a;
    font-size: .82rem;
    margin-bottom: .45rem;
  }

  .admin-create-order-page .racket-line .row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .5rem !important;
    margin: 0 !important;
  }

  .admin-create-order-page .racket-line .row > div {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .admin-create-order-page .racket-line .row > div:has(.p20w-racket-brand),
  .admin-create-order-page .racket-line .row > div:has(.p20w-racket-model),
  .admin-create-order-page .racket-line .row > div:has(select[name="string_product_id"]),
  .admin-create-order-page .racket-line .row > div:has(input[name="item_notes"]),
  .admin-create-order-page .racket-line .row > div:has(.remove-racket-btn) {
    grid-column: 1 / -1 !important;
  }

  .admin-create-order-page .form-label {
    font-size: .68rem !important;
    font-weight: 950 !important;
    margin-bottom: .18rem !important;
    color: #334155 !important;
  }

  .admin-create-order-page .form-control,
  .admin-create-order-page .form-select {
    min-height: 40px !important;
    border-radius: 11px !important;
    font-size: 16px !important;
    padding: .4rem .55rem !important;
  }

  .admin-create-order-page select[name="string_product_id"] {
    min-height: 44px !important;
  }

  .admin-create-order-page input[name="qty"],
  .admin-create-order-page input[name="tension_main"],
  .admin-create-order-page input[name="tension_cross"],
  .admin-create-order-page input[name="restring_price"],
  .admin-create-order-page input[name="item_unit_price"] {
    text-align: center !important;
    font-weight: 850 !important;
  }

  .admin-create-order-page .remove-racket-btn {
    width: 100% !important;
    min-height: 34px !important;
    font-size: .78rem !important;
  }

  .admin-create-order-page .remove-racket-btn::after {
    content: " Remove racket line";
  }

  .admin-create-order-page .racket-footer {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .5rem !important;
    margin-top: .6rem !important;
    padding-top: .6rem !important;
  }

  .admin-create-order-page .racket-footer .small-help {
    display: none !important;
  }

  .admin-create-order-page .racket-footer .btn[type="submit"] {
    width: 100% !important;
    min-height: 44px !important;
    font-size: .9rem !important;
    font-weight: 950 !important;
  }
}
