/* Phone admin shell. Every layout change is inside max-width: 768px.
   At 769px and up these rules do not apply, so the desktop header,
   sidebar, and tables stay as they are. New pieces are hidden by default. */

.rdp-tabbar,
.rdp-m-filter-open,
.rdp-m-desk-note,
.rdp-filter-scrim {
  display: none;
}

.rdp-a2hs[hidden] { display: none; }
.rdp-a2hs:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f5f7;
  color: #1c2323;
  font-size: 13px;
  line-height: 1.4;
}
.rdp-a2hs p { margin: 0; flex: 1 1 auto; }
.rdp-a2hs .rdp-btn-ghost { min-height: 44px; flex: 0 0 auto; }

@media screen and (max-width: 768px) {
  body.rdp-desk .rdp-menu { display: none; }

  body.rdp-desk .rdp-main-top {
    min-height: 52px;
  }
  body.rdp-desk .rdp-main-title {
    font-size: 16px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.rdp-desk .rdp-content {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .rdp-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    gap: 2px;
    margin: 0;
    padding: 4px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: #1c2323;
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.08);
  }
  a.rdp-tab,
  button.rdp-tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 6px 2px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    color: #c5cece;
    font: 700 11px/1.15 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    text-align: center;
    text-decoration: none;
    white-space: normal;
  }
  a.rdp-tab.is-on,
  button.rdp-tab.is-on,
  a.rdp-tab[aria-current="page"] {
    background: #f4f5f7;
    color: #1c2323;
  }
  a.rdp-tab:focus-visible,
  button.rdp-tab:focus-visible {
    outline: 2px solid #c4472a;
    outline-offset: 2px;
  }

  body.rdp-desk .rdp-support {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .rdp-m-filter-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    width: auto;
  }
  .rdp-m-filter-when-open { display: none; }
  form.rdp-m-filter-form.is-sheet .rdp-m-filter-when-closed { display: none; }
  form.rdp-m-filter-form.is-sheet .rdp-m-filter-when-open { display: inline; }

  form.rdp-m-filter-form {
    position: sticky;
    top: 0;
    z-index: 28;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: #f4f5f7;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
  }
  form.rdp-m-filter-form:not(.is-sheet) {
    flex-direction: row;
    flex-wrap: wrap;
  }
  form.rdp-m-filter-form:not(.is-sheet) > :not(.rdp-m-filter-open):not(:has(input[name="q"])):not(.rdp-find[data-name="appId"]):not(button[type="submit"]) {
    display: none;
  }
  form.rdp-m-filter-form:not(.is-sheet) > label:has(input[name="q"]) {
    flex: 1 1 100%;
    min-width: 0;
    margin: 0;
  }
  form.rdp-m-filter-form:not(.is-sheet) > label:has(input[name="q"]) input {
    width: 100%;
  }
  form.rdp-m-filter-form:not(.is-sheet) > .rdp-find[data-name="appId"] {
    flex: 1 1 160px;
    min-width: 0;
  }
  form.rdp-m-filter-form:not(.is-sheet) > button[type="submit"] {
    width: auto;
    min-height: 44px;
    flex: 0 0 auto;
  }

  .rdp-filter-scrim:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(28, 35, 35, 0.45);
  }
  form.rdp-m-filter-form.is-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-height: min(85dvh, 680px);
    overflow: auto;
    margin: 0;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px rgba(28, 35, 35, 0.22);
  }
  form.rdp-m-filter-form.is-sheet > label,
  form.rdp-m-filter-form.is-sheet > .rdp-find,
  form.rdp-m-filter-form.is-sheet > button,
  form.rdp-m-filter-form.is-sheet > .rdp-export,
  form.rdp-m-filter-form.is-sheet > details {
    display: block;
    width: 100%;
    max-width: none;
  }
  form.rdp-m-filter-form.is-sheet > button,
  form.rdp-m-filter-form.is-sheet .rdp-export summary,
  form.rdp-m-filter-form.is-sheet .rdp-export-menu a,
  form.rdp-m-filter-form.is-sheet .rdp-export-menu button {
    min-height: 44px;
  }
  form.rdp-m-filter-form.is-sheet .rdp-export-menu {
    position: static;
    width: 100%;
    box-shadow: none;
  }
  form.rdp-m-filter-form .rdp-find,
  form.rdp-m-filter-form .rdp-find-summary {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 44px;
  }
  form.rdp-m-filter-form:not(.is-sheet) .rdp-find-drop[open] .rdp-find-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: none;
    max-height: min(70dvh, 520px);
    border-radius: 16px 16px 0 0;
    z-index: 80;
  }
  form.rdp-m-filter-form:not(.is-sheet) .rdp-find-list {
    max-height: min(52dvh, 380px);
  }
  form.rdp-m-filter-form.is-sheet .rdp-find-panel {
    position: static;
    width: 100%;
    max-width: none;
    box-shadow: none;
  }
  form.rdp-m-filter-form .rdp-find-opt {
    min-height: 44px;
  }

  .rdp-m-desk-note {
    display: block;
    margin: 8px 0 12px;
    padding: 14px 16px;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #fff;
    color: #5c6767;
    font-size: 14px;
    line-height: 1.4;
  }
  .rdp-ledger.rdp-m-desk-only { display: none; }

  .rdp-ledger.rdp-m-cards .rdp-col-picker { display: none; }
  .rdp-ledger.rdp-m-cards .rdp-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table,
  .rdp-ledger.rdp-m-cards .rdp-grid-table tbody {
    display: block;
    width: 100%;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table tr.rdp-click-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    position: relative;
    width: auto;
    max-width: none;
    margin: 0 0 10px;
    padding: 14px 28px 12px 14px;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
    cursor: pointer;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table tr.rdp-click-row::after {
    content: "›";
    position: absolute;
    top: 14px;
    inset-inline-end: 12px;
    color: #7b8686;
    font-size: 22px;
    line-height: 1;
  }
  html[dir="rtl"] .rdp-ledger.rdp-m-cards .rdp-grid-table tr.rdp-click-row::after {
    content: "‹";
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table tr[data-empty] {
    display: block;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    background: #fff;
    padding: 8px 12px;
    margin: 0 0 10px;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table td {
    position: static;
    left: auto;
    display: block;
    width: auto;
    max-width: none;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table td::before { content: none; }
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="amount"] {
    order: 1;
    flex: 1 1 auto;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="status"] {
    order: 2;
    flex: 0 0 auto;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="merchantCell"] {
    order: 3;
    flex: 1 0 100%;
    font-weight: 650;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="CREATE_DATE"] {
    order: 4;
    flex: 1 1 auto;
    color: #5c6767;
    font-size: 13px;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="CARD_MASK"] {
    order: 5;
    flex: 0 0 auto;
    color: #1c2323;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="action"] {
    order: 6;
    flex: 1 0 100%;
    margin-top: 4px;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="reason"] {
    order: 7;
    flex: 1 0 100%;
    color: #5c6767;
    font-size: 13px;
  }
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="TXN_ID"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="ORDER_ID"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="customer"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="email"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="currency"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="txnType"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="acquirer"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="commission"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="vat"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="totalFee"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="settled"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="mid"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="lane"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="fixed"],
  .rdp-ledger.rdp-m-cards .rdp-grid-table td[data-col="settleDate"] {
    display: none;
  }
  .rdp-ledger.rdp-m-cards .rdp-text-link,
  .rdp-ledger.rdp-m-cards .rdp-link-btn,
  .rdp-ledger.rdp-m-cards .rdp-pager button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .rdp-ledger.rdp-m-cards .rdp-pager button { justify-content: center; }
}

@media print {
  .rdp-tabbar,
  .rdp-m-filter-open,
  .rdp-a2hs,
  .rdp-m-desk-note,
  .rdp-filter-scrim { display: none !important; }
  .rdp-ledger.rdp-m-desk-only { display: block !important; }
}
