[hidden] { display: none !important; }
.admin-page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.admin-main { width: 100%; max-width: 1440px; flex: 1; padding-block: 32px 38px; }
.admin-brand { color: var(--ink); text-decoration: none; }
.admin-brand > span:last-child { min-width: 0; }
.admin-topnav { display: flex; align-items: center; justify-content: flex-end; gap: 12px 22px; flex-wrap: wrap; }
.admin-topnav a { color: var(--green); font-size: 12px; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.admin-topnav a:hover { text-decoration: underline; }
.admin-role { display: inline-block; padding: 4px 10px; background: var(--mint); color: var(--green); border-radius: 20px; font-size: 11px; max-width: 250px; overflow-wrap: anywhere; }
.admin-skip { position: absolute; left: 12px; top: -100px; padding: 12px 20px; background: var(--ink); color: white; border-radius: 8px; z-index: 10; }
.admin-skip:focus { top: 12px; }
.admin-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.admin-intro p { color: var(--muted); }
.admin-refresh { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.admin-refresh button { min-height: 44px; }
.admin-refresh .hint { text-align: right; }
.admin-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-metrics strong { min-height: 1.45em; }
.admin-gate { text-align: center; max-width: 600px; margin: clamp(24px, 7vh, 80px) auto; padding: 40px 26px; }
.gate-symbol { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 20px; background: var(--mint); color: var(--green); font-size: 30px; font-weight: 600; }
.admin-gate .eyebrow { display: block; }
.admin-gate h1 { font-size: 25px; margin: 8px 0 12px; }
.admin-gate p { color: var(--muted); font-size: 14px; line-height: 1.9; }
.gate-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.gate-actions:empty { display: none; }
.admin-link-button { padding: 10px 18px; border-radius: 9px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 600; }
.package-summary { margin-bottom: 24px; }
.package-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.package-count { padding: 17px 18px; background: #f7faf7; border: 1px solid var(--line); border-radius: 11px; min-width: 0; }
.package-count h3 { font-size: 14px; overflow-wrap: anywhere; }
.package-count-total { color: var(--green); font-size: 26px; font-weight: 600; line-height: 1.5; margin: 8px 0; }
.package-count-total small { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 6px; }
.package-statuses { display: flex; gap: 5px 11px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.package-statuses > span { display: inline-flex; gap: 5px; }
.package-statuses strong { color: var(--ink); font-weight: 600; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.admin-tabs button { position: relative; background: transparent; color: var(--muted); min-height: 48px; border-radius: 7px 7px 0 0; font-size: 13px; white-space: nowrap; padding-inline: 20px; flex-shrink: 0; }
.admin-tabs button[aria-selected="true"] { color: var(--green); background: #edf6ef; }
.admin-tabs button[aria-selected="true"]::after { position: absolute; content: ""; bottom: -1px; left: 15px; right: 15px; height: 3px; background: var(--green); border-radius: 3px 3px 0 0; }
.admin-filters { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(130px, 190px) auto auto; gap: 12px; align-items: end; }
.admin-filters label { font-size: 12px; font-weight: 600; min-width: 0; }
.admin-filters input, .admin-filters select { display: block; margin-top: 6px; min-height: 44px; font-weight: 400; font-size: 14px; }
.admin-filters button { min-height: 44px; font-size: 13px; }
.admin-feedback { min-height: 1.8em; color: var(--muted); font-size: 12px; margin-top: 17px; overflow-wrap: anywhere; }
.admin-feedback.failed { color: var(--red); }
.admin-list { margin-top: 10px; min-width: 0; }
.admin-list[aria-busy="true"] { opacity: .6; }
.admin-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.admin-table thead { background: #f5f8f4; }
.admin-table th { font-size: 11px; color: var(--muted); text-align: left; font-weight: 400; padding: 11px 12px; }
.admin-table td { vertical-align: top; border-bottom: 1px solid var(--line); padding: 15px 12px; overflow-wrap: anywhere; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table th:first-child { border-radius: 7px 0 0 7px; }
.admin-table th:last-child { border-radius: 0 7px 7px 0; }
.admin-table .main-cell { width: 25%; }
.admin-table .action-cell { width: 98px; }
.admin-table td > strong, .admin-table td > small { display: block; }
.admin-table td > small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.admin-table .record-open { color: var(--green); font-size: 12px; min-height: 44px; background: #edf4ef; padding: 9px 11px; white-space: normal; }
.admin-table .record-open:hover { background: var(--mint); }
.admin-status { display: inline-flex; border-radius: 5px; padding: 3px 7px; font-size: 11px; line-height: 1.6; color: #5c7065; background: #edf1ee; }
.admin-status.active, .admin-status.trialing, .admin-status.completed { color: #216546; background: #e5f4ea; }
.admin-status.pending, .admin-status.pending_review, .admin-status.pending_payment { color: #8a642d; background: #fff1d7; }
.admin-status.disabled, .admin-status.suspended, .admin-status.failed { color: #a3433a; background: #fff0eb; }
.admin-empty { grid-column: 1 / -1; padding: 32px 16px; text-align: center; color: var(--muted); font-size: 13px; background: #f7faf7; border: 1px dashed #dfe7e0; border-radius: 10px; }
.admin-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.admin-pagination:empty { border: 0; padding: 0; margin: 0; }
.admin-page-label { color: var(--muted); font-size: 12px; }
.admin-page-controls { display: flex; flex-wrap: wrap; gap: 7px; }
.admin-page-controls button { min-height: 44px; background: #edf4ef; color: var(--green); font-size: 12px; }
.admin-dialog { width: min(720px, calc(100vw - 24px)); }
.admin-dialog .section-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.admin-dialog .section-head h2 { overflow-wrap: anywhere; }
.admin-dialog .section-head > button { min-height: 44px; min-width: 44px; }
.record-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 24px; margin: 0; }
.record-fields > div { min-width: 0; }
.record-fields dt { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.record-fields dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.record-section { margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); }
.record-section h3 { font-size: 14px; margin-bottom: 12px; }
.record-related { list-style: none; display: grid; gap: 9px; padding: 0; margin: 0; }
.record-related li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.record-related li small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.record-history { list-style: none; display: grid; gap: 0; padding: 0; margin: 0; }
.record-history li { position: relative; padding: 0 0 20px 22px; border-left: 1px solid #dbe6de; margin-left: 5px; font-size: 13px; overflow-wrap: anywhere; }
.record-history li::before { content: ""; position: absolute; width: 9px; height: 9px; background: #78ae93; border-radius: 50%; left: -5px; top: 5px; }
.record-history li:last-child { border-left-color: transparent; padding-bottom: 0; }
.record-history li small { display: block; font-size: 11px; color: var(--muted); margin: 3px 0; }
.record-history li p { font-size: 12px; color: #52685d; white-space: pre-wrap; }
.admin-lifecycle { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.admin-lifecycle h3 { font-size: 17px; margin-bottom: 8px; }
.admin-lifecycle .field { display: block; font-size: 13px; margin-top: 18px; }
.admin-lifecycle textarea { display: block; width: 100%; min-height: 96px; margin-top: 7px; font: inherit; font-size: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.admin-lifecycle-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 13px; line-height: 1.8; }
.admin-lifecycle-check input { width: 22px; height: 22px; flex: 0 0 22px; margin-top: 2px; accent-color: var(--green); }
.admin-lifecycle :is(button, .admin-danger-button) { min-height: 48px; white-space: normal; }
.admin-danger-button { background: #983e36; color: #fff; border: 1px solid #983e36; }
.admin-danger-button:hover { background: #7f322c; }
.admin-danger-button:focus-visible { outline: 3px solid #da9b94; outline-offset: 3px; }
.admin-danger-button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 1050px) {
  .admin-topnav { gap: 6px 16px; }
  .package-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-filters input, .admin-filters select { font-size: 16px; }
}
@media (max-width: 760px) {
  .admin-main { padding-top: 22px; }
  .admin-topnav { margin-left: auto; }
  .admin-role { max-width: 180px; }
  .admin-intro { align-items: flex-start; flex-direction: column; gap: 16px; }
  .admin-intro p { font-size: 14px; }
  .admin-refresh { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
  .admin-refresh .hint { text-align: left; }
  .admin-records { padding-inline: 16px; }
  .admin-tabs { margin-inline: -4px; }
  .admin-tabs button { font-size: 14px; padding-inline: 16px; }
  .admin-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .admin-filters label:first-child { grid-column: 1 / -1; }
  .admin-filters label:nth-child(2) { grid-column: 1 / -1; }
  .admin-filters label { font-size: 13px; }
  .admin-table, .admin-table tbody { display: block; width: 100%; }
  .admin-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .admin-table tbody { display: grid; gap: 12px; }
  .admin-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 11px; padding: 16px; gap: 13px; }
  .admin-table td, .admin-table .main-cell, .admin-table .action-cell { display: block; width: auto; border: 0; padding: 0; font-size: 13px; min-width: 0; }
  .admin-table td:first-child { grid-column: 1 / -1; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .admin-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-bottom: 4px; }
  .admin-table td:first-child::before, .admin-table .action-cell::before { display: none; }
  .admin-table td > strong { font-size: 15px; }
  .admin-table td > small { font-size: 12px; }
  .admin-table .action-cell { grid-column: 1 / -1; }
  .admin-table .record-open { width: 100%; font-size: 14px; }
  .admin-status { font-size: 12px; }
  .admin-feedback { font-size: 13px; }
  .admin-page-label { font-size: 12px; }
  .admin-page-controls { width: 100%; }
  .admin-page-controls button { flex: 1; font-size: 14px; }
  .admin-gate { padding: 30px 18px; margin-block: 24px; }
  .admin-gate h1 { font-size: 23px; }
  .package-summary { margin-bottom: 18px; }
}
@media (max-width: 480px) {
  .admin-topnav { width: 100%; justify-content: flex-start; gap: 4px 20px; padding-left: 44px; }
  .admin-role { display: none; }
  .admin-metrics article { padding: 15px 11px; }
  .admin-metrics article > span { font-size: 12px; }
  .admin-metrics strong { font-size: clamp(25px, 7vw, 31px); }
  .admin-metrics small { font-size: 11px; }
  .package-counts { grid-template-columns: minmax(0, 1fr); }
  .package-count-total { font-size: 26px; }
  .package-statuses { font-size: 12px; }
  .record-fields { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .admin-dialog { padding: 18px; }
}

#merchant-review-link { column-gap: 12px; }
.admin-review-pending { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; box-sizing: border-box; width: 1.7rem; height: 1.7rem; padding: 0; border: 0; border-radius: 50%; font-size: .75rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; background: #c92a3b; color: #fff; }
.admin-review-pending[hidden] { display: none; }
