/* Paged list panels own bounded widths; desktop columns adapt, phones scroll. */
.admin-layout.is-customers-view .managed-users { grid-template-columns:minmax(0,1fr); grid-template-rows:none; grid-auto-rows:auto; }
.managed-users>*,#managed-users-table,#payment-order-table,#registration-table,#audit-table { min-width:0; max-width:100%; }
.list-pagination { display:flex; min-width:0; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; padding:12px 16px; border-bottom:1px solid var(--line); }
.list-pagination>span { flex:1 1 180px; color:var(--muted); font-size:var(--font-caption); }
.list-pagination>label { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:var(--font-caption); }
.list-pagination select { width:86px; height:32px; }
.list-pagination button { min-height:32px; padding:5px 10px; }
.list-pagination.has-error>span { color:#efa7a4; }
.list-is-pending { opacity:.45; }
#managed-users-table .table-wrap,#payment-order-table .table-wrap,#registration-table .table-wrap,#audit-table .table-wrap { max-width:100%; max-height:65vh; max-height:65dvh; overflow:auto; overscroll-behavior:none; overflow-anchor:none; scrollbar-gutter:stable; isolation:isolate; }
#managed-users-table .table-wrap { overflow-y:auto; }
#managed-users-table thead,#payment-order-table thead,#registration-table thead,#audit-table thead { position:sticky; top:-1px; z-index:2; background:#141a1f; box-shadow:0 1px 0 var(--line); }
#managed-users-table th,#payment-order-table th,#registration-table th,#audit-table th { position:static; }
/* A fractional scrollport edge can otherwise expose one pixel of a scrolled
   row above the sticky head at browser zoom or fractional device scaling. */
#managed-users-table .table-wrap,#payment-order-table .table-wrap,#registration-table .table-wrap,#audit-table .table-wrap { clip-path:inset(0); }
#managed-users-table .data-table,#payment-order-table .data-table,#registration-table .data-table,#audit-table .data-table { width:100%; min-width:0; table-layout:fixed; border-collapse:separate; border-spacing:0; }
#managed-users-table th,#managed-users-table td,#payment-order-table th,#payment-order-table td,#registration-table th,#registration-table td,#audit-table th,#audit-table td { white-space:normal; overflow-wrap:anywhere; vertical-align:middle; padding:10px; }
#managed-users-table th:nth-child(n),#managed-users-table td:nth-child(n) { display:table-cell; }
#managed-users-table th:nth-child(1) { width:9%; }
#managed-users-table th:nth-child(2) { width:26%; }
#managed-users-table th:nth-child(3),#managed-users-table th:nth-child(4),#managed-users-table th:nth-child(5) { width:14%; }
#managed-users-table th:nth-child(6) { width:23%; }
#managed-users-table .summary-actions { display:flex; width:100%; min-width:0; max-width:none; flex-wrap:wrap; justify-content:center; gap:6px; }
#managed-users-table .summary-actions button { width:auto; flex:0 0 auto; min-width:0; }
#managed-users-table .summary-actions .release-device-button { width:auto; min-width:0; }
#managed-users-table .summary-actions .user-details-button { width:32px; }
#managed-users-table .user-identity { display:flex; width:100%; min-width:0; max-width:none; flex-wrap:wrap; gap:5px 8px; }
#managed-users-table .user-identity strong,#managed-users-table .user-identity small,#managed-users-table .user-identity .user-price { width:auto; min-width:0; max-width:100%; white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
#managed-users-table .user-identity strong { flex-basis:100%; }
#managed-users-table .user-price { line-height:1.5; border-radius:5px; }
#payment-order-table th:nth-child(1) { width:19%; }
#payment-order-table th:nth-child(2) { width:15%; }
#payment-order-table th:nth-child(3) { width:7%; }
#payment-order-table th:nth-child(4) { width:9%; }
#payment-order-table th:nth-child(5) { width:15%; }
#payment-order-table th:nth-child(6) { width:14%; }
#payment-order-table th:nth-child(7) { width:12%; }
#payment-order-table th:nth-child(8) { width:9%; }
#payment-order-table .payment-order-number { display:flex; min-width:0; max-width:100%; flex-wrap:wrap; }
#payment-order-table .payment-order-number code { min-width:0; white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
#payment-order-table .product-identity,#payment-order-table .product-identity strong,#payment-order-table .product-identity small { min-width:0; max-width:100%; white-space:normal; overflow:visible; overflow-wrap:anywhere; text-overflow:clip; }
#payment-order-table .product-actions { min-width:0; flex-wrap:wrap; justify-content:center; }
#payment-order-table .product-actions button { max-width:100%; white-space:normal; }
#payment-order-table th:nth-child(5),#payment-order-table td:nth-child(5) { text-align:center; }
.payment-order-validity { display:flex; min-width:0; align-items:center; justify-content:center; }
.payment-order-validity strong { font-weight:650; font-variant-numeric:tabular-nums; }
#registration-table th:nth-child(1) { width:25%; }
#registration-table th:nth-child(2) { width:18%; }
#registration-table th:nth-child(3) { width:9%; }
#registration-table th:nth-child(4),#registration-table th:nth-child(5) { width:18%; }
#registration-table th:nth-child(6) { width:12%; }
#registration-table .user-actions { display:flex; min-width:0; flex-wrap:wrap; }
#registration-table .user-actions button { width:auto; max-width:100%; }
#audit-table th:nth-child(1) { width:12%; }
#audit-table th:nth-child(2) { width:7%; }
#audit-table th:nth-child(3) { width:9%; }
#audit-table th:nth-child(4) { width:7%; }
#audit-table th:nth-child(5) { width:12%; }
#audit-table th:nth-child(6) { width:10%; }
#audit-table th:nth-child(7) { width:20%; }
#audit-table th:nth-child(8) { width:16%; }
#audit-table th:nth-child(9) { width:7%; }
.audit-cell-text { display:block; overflow-wrap:anywhere; white-space:normal; }
#audit-table .status { padding:4px 5px; gap:4px; white-space:nowrap; }
#audit-table td:last-child button { padding:6px; min-width:42px; white-space:nowrap; }
.audit-source-diagnosis { display:grid; gap:5px; }
.audit-source-diagnosis>.audit-cell-text { font-family:monospace; }
.audit-source-diagnosis>small { color:var(--muted); line-height:1.5; }
@media(min-width:901px) and (max-width:1100px) {
  #audit-table th,#audit-table td { padding:6px; }
  #audit-table .status { padding:3px; gap:3px; font-size:11px; }
}
.sidebar { overflow-y:auto; }
/* On desktop the controls consume their own height and the list takes the
   remainder. Short screens keep document scrolling so filters stay usable. */
@media(min-width:901px) and (min-height:700px) {
  #customers-view,#registrations-view,#payments-view,#audit-view {
    display:flex; flex-direction:column; height:calc(100dvh - 120px); min-height:0;
  }
  #customers-view>.managed-users,#registrations-view>.registration-panel,
  #payments-view>.payment-record-panel,#audit-view>.panel:last-child {
    display:flex; flex:1 1 0; flex-direction:column; min-height:0;
  }
  #audit-view>.audit-controls { flex:0 0 auto; }
  .has-list-toolbar>.panel-heading,.has-list-toolbar>.list-toolbar { flex:0 0 auto; }
  #managed-users-table,#registration-table,#payment-order-table,#audit-table {
    display:flex; flex:1 1 0; flex-direction:column; min-height:0;
  }
  #managed-users-table .table-wrap,#registration-table .table-wrap,
  #payment-order-table .table-wrap,#audit-table .table-wrap {
    flex:1 1 0; min-height:0; max-height:none; overflow:auto;
  }
  .admin-layout.is-customers-view #managed-users-table .table-wrap { height:auto; overflow:auto; }
}
@media(max-width:900px) {
  #managed-users-table .data-table { min-width:1080px; }
  #payment-order-table .data-table { min-width:1060px; }
  #registration-table .data-table { min-width:850px; }
  #audit-table .data-table { min-width:1250px; }
}
@media(max-width:720px) {
  .sidebar { overflow-y:visible; }
  .list-pagination { justify-content:flex-start; padding:10px; gap:6px; }
  .list-pagination>span { flex-basis:100%; }
}

#managed-users-table .user-identity small { display:block; flex:0 1 100%; width:100%; max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
#managed-users-table .summary-action-placeholder { display:none; }
.instant-note-tooltip { position:fixed; z-index:2000; width:max-content; max-width:min(480px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:auto; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--text); box-shadow:0 8px 24px #0005; font-size:13px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; pointer-events:none; }
.instant-note-tooltip[hidden] { display:none; }

/* One compact row; the field picker uses the browser top layer, outside tables. */
.has-list-toolbar { overflow:visible; }
.list-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:10px 20px; padding:10px 16px; border-bottom:1px solid var(--line); }
.list-toolbar>.manage-tools { flex:1 1 190px; min-width:0; padding:0; border:0; background:none; }
.list-toolbar .user-search { width:100%; max-width:280px; }
.list-toolbar .user-search input { width:100%; height:32px; }
.list-toolbar .user-search svg { top:8px; }
.list-toolbar>.list-pagination { flex:1 1 530px; padding:0; border:0; }
.list-pagination>span { white-space:nowrap; flex:1 1 auto; text-align:center; }
.list-pagination>.table-columns { flex:0 0 auto; }
.list-pagination .select-control { width:92px; flex:0 0 92px; }
.list-pagination .select-trigger { height:32px; padding:0 27px 0 10px; gap:0; white-space:nowrap; }
.list-pagination .select-trigger::after { right:11px; }
.list-pagination .select-menu { left:auto; right:0; width:112px; }
.list-pagination .select-option { min-height:32px; padding:6px 30px 6px 10px; white-space:nowrap; }
.list-pagination .select-option[aria-selected=true]::after { right:10px; }
.has-inline-list-tools { flex-wrap:wrap; gap:12px 22px; }
.has-inline-list-tools>.list-toolbar { flex:1 1 530px; margin-left:auto; padding:0; border:0; }
.has-column-choices { min-width:0; max-width:100%; overflow:visible; }
.table-columns { flex:0 0 auto; }
.table-columns-standalone { display:flex; justify-content:flex-end; padding:8px 12px; }
.table-columns-trigger { width:auto; min-height:32px; padding:5px 10px; font-size:var(--font-caption); white-space:nowrap; }
.table-columns-trigger::after { display:inline-block; width:6px; height:6px; margin:0 2px 3px 8px; border-right:1px solid currentColor; border-bottom:1px solid currentColor; content:""; transform:rotate(45deg); }
.table-columns-trigger[aria-expanded=true] { border-color:var(--accent); }
.table-columns-panel { position:fixed; inset:auto; width:340px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow:auto; margin:0; padding:14px; border:1px solid #424d55; border-radius:9px; background:#11171b; color:var(--text); box-shadow:0 18px 44px #0007; }
.table-columns-panel::backdrop { background:transparent; }
.table-columns-panel fieldset { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 14px; border:0; padding:0; margin:0; min-width:0; }
.table-columns-panel legend { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
.table-columns-panel label { display:flex; align-items:center; gap:8px; min-width:0; font-size:13px; cursor:pointer; }
.table-columns-panel input[type=checkbox] { width:16px; height:16px; min-height:0; padding:0; margin:0; flex:0 0 16px; accent-color:var(--accent); }
.table-columns-footer { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px; margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.table-columns-footer small { color:var(--muted); font-size:11px; }
.table-columns-footer small[hidden] { display:none; }
.table-columns-footer button { width:auto; min-height:28px; padding:4px 9px; font-size:12px; }
.audit-time-trigger { min-width:0; height:40px; padding:0 10px; }
.audit-time-trigger span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.coupon-time-dialog { max-height:calc(100dvh - 40px); overflow-y:auto; }
@media(min-width:901px) and (max-width:1100px) {
  .list-toolbar { gap:10px; padding:10px 12px; }
  .list-toolbar>.manage-tools { flex:1 1 135px; }
  .list-toolbar>.list-pagination { flex:3 1 530px; gap:6px; }
  .list-pagination>span { font-size:11px; }
}
@media(max-width:720px) {
  .list-toolbar { padding:10px; gap:10px; }
  .list-toolbar>.manage-tools { flex-basis:100%; }
  .list-toolbar .user-search { max-width:none; }
  .list-toolbar>.list-pagination { flex-basis:100%; gap:6px; }
  .list-pagination>span { flex-basis:100%; }
  .has-inline-list-tools>.list-toolbar { flex-basis:100%; }
}
.has-column-choices>.table-wrap { max-width:100%; overflow:auto; }
.has-column-choices table.customizable-table { width:100%; min-width:0!important; table-layout:fixed; }
.has-column-choices .customizable-table th,.has-column-choices .customizable-table td { white-space:normal; overflow-wrap:anywhere; vertical-align:middle; }
.customizable-table th[hidden],.customizable-table td[hidden] { display:none!important; }
.has-column-choices .customizable-table .product-identity { min-width:0; max-width:100%; }
.has-column-choices .customizable-table .product-identity strong,.has-column-choices .customizable-table .product-identity small { white-space:normal; overflow-wrap:anywhere; }
.has-column-choices .customizable-table .product-type-label,.has-column-choices .customizable-table .product-validity-label { max-width:100%; white-space:normal; }
.has-column-choices .customizable-table .product-actions { min-width:0; flex-wrap:wrap; }
.has-column-choices .customizable-table button { max-width:100%; white-space:normal; }
.product-list-panel .panel-heading>.table-columns { justify-self:end; }
#product-table th,#product-table td,#coupon-table th,#coupon-table td { padding:10px; }
#products-view .product-management-grid { grid-template-columns:minmax(0,1fr) 380px; }
@media(max-width:1600px) {
  .product-management-grid,#products-view .product-management-grid { grid-template-columns:minmax(0,1fr); }
  .product-management-grid>.product-list-panel { grid-column:1; grid-row:1; }
  .product-management-grid>#product-form { grid-column:1; grid-row:2; }
}
@container(max-width:760px) {
  .product-list-panel .panel-heading { grid-template-columns:minmax(0,1fr) auto; }
  .product-list-panel .panel-heading>.compact-tabs { grid-column:1/-1; grid-row:2; justify-self:start; }
  .product-list-panel .panel-heading>.table-columns { grid-column:2; grid-row:1; }
}
@media(max-width:900px) {
  .has-column-choices table.customizable-table { min-width:var(--table-mobile-width)!important; }
}
