:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #18212b;
  --muted: #647181;
  --line: #dfe5ea;
  --blue: #0b6bcb;
  --blue-dark: #084d92;
  --green: #147d4f;
  --amber: #a66500;
  --red: #b42318;
  --shadow: 0 16px 40px rgba(22, 33, 44, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(11, 107, 203, .08), transparent 34rem),
    linear-gradient(45deg, rgba(20, 125, 79, .08), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Aptos", "Helvetica Neue", sans-serif;
  font-size: 15px;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #102033;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand,
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  justify-content: center;
  min-height: 148px;
}

.brand-logo {
  display: block;
  width: 150px;
  max-width: 100%;
  max-height: 150px;
  height: auto;
  object-fit: contain;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #f2c94c;
  color: #102033;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand span,
.login-brand span,
.sidebar-footer span {
  display: block;
  color: rgba(255, 255, 255, .68);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  color: rgba(255, 255, 255, .8);
  padding: 11px 12px;
  border-radius: 8px;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  text-decoration: none;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}

.sidebar-footer a {
  color: #fff;
  font-size: 13px;
  display: inline-block;
  margin: 7px 12px 0 0;
}

.main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
  color: var(--ink);
}

.metric:hover {
  border-color: #bfd9f7;
  text-decoration: none;
}

.metric span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric strong {
  font-size: 32px;
}

.panel {
  padding: 18px;
}

.panel.narrow {
  max-width: 880px;
}

.panel-separator {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.chart-panel {
  min-height: 320px;
}

.donut-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.donut-chart {
  width: min(280px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 4px auto;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}

.donut-chart::after {
  content: "";
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut-chart > div {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
}

.donut-chart strong {
  font-size: 34px;
  line-height: 1;
}

.donut-chart span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.legend-list,
.progress-list {
  display: grid;
  gap: 10px;
}

.legend-list a,
.progress-list a,
.access-card {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}

.legend-list a {
  min-height: 54px;
  padding: 12px;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.legend-list a:hover,
.progress-list a:hover,
.access-card:hover {
  border-color: #bfd9f7;
  background: #f8fbff;
  text-decoration: none;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
}

.legend-dot.is-paid {
  background: var(--green);
}

.legend-dot.is-active {
  background: var(--blue);
}

.legend-dot.is-expired {
  background: var(--amber);
}

.legend-dot.is-other {
  background: #94a3b8;
}

.legend-list strong,
.access-card strong {
  overflow-wrap: anywhere;
}

.legend-list em,
.progress-list em,
.access-card em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.progress-list a {
  min-height: 68px;
  padding: 13px;
  display: grid;
  gap: 10px;
}

.progress-list span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.progress-list i {
  display: block;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8edf2;
}

.progress-list b {
  display: block;
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.progress-list b.is-active {
  background: var(--blue);
}

.progress-list b.is-expired {
  background: var(--amber);
}

.progress-list b.is-other {
  background: #94a3b8;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.access-card {
  min-height: 132px;
  padding: 18px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 6px 14px;
  align-items: center;
  box-shadow: var(--shadow);
}

.access-card .access-icon {
  grid-row: 1 / 3;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #075fb8;
}

.access-card:nth-child(2) .access-icon {
  background: #147d4f;
}

.access-card .icon {
  width: 22px;
  height: 22px;
}

.panel-heading,
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.toolbar {
  margin-bottom: 18px;
}

.quick-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: -4px 0 18px;
}

.quick-filters a {
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow);
}

.quick-filters span {
  display: block;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
}

.quick-filters a.active,
.quick-filters a:hover {
  background: #e8f2ff;
  border-color: #bfd9f7;
  color: var(--blue-dark);
  text-decoration: none;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 18px rgba(22, 33, 44, .12);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(22, 33, 44, .16);
}

.button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
  box-shadow: none;
}

.button:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(11, 107, 203, .24);
  outline-offset: 2px;
}

.icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.button.primary,
button.primary {
  background: #075fb8;
  color: #fff;
}

.button.primary:hover,
button.primary:hover {
  background: #034a93;
  text-decoration: none;
}

.button.secondary,
button.secondary {
  background: #fff;
  border: 1px solid #b8c7d8;
  color: #0b4f92;
}

.button.secondary:hover,
button.secondary:hover {
  background: #e8f2ff;
  border-color: #8cb8e8;
  text-decoration: none;
}

.button.danger,
button.danger {
  background: #c92a1f;
  border: 1px solid #c92a1f;
  color: #fff;
}

.button.danger:hover,
button.danger:hover {
  background: #a91f16;
  border-color: #a91f16;
  text-decoration: none;
}

.button.ghost,
button.ghost {
  background: #f2f5f8;
  border: 1px solid var(--line);
  color: var(--red);
}

.button.ghost:hover,
button.ghost:hover {
  background: #fdeceb;
  border-color: #f0b4af;
  text-decoration: none;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.filters input {
  min-width: 280px;
}

.filters select {
  width: 160px;
}

.form {
  display: grid;
  gap: 16px;
}

.grid-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-section {
  grid-column: 1 / -1;
}

.form-section {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.form-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.form-left {
  grid-column: 1;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

table.is-loading {
  opacity: .58;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.status.is-paid {
  background: #e7f6ee;
  color: var(--green);
}

.status.is-pending {
  background: #fff4dc;
  color: var(--amber);
}

.status.is-cancelled {
  background: #fdeceb;
  color: var(--red);
}

.status.is-refunded {
  background: #eef0ff;
  color: #4f46a5;
}

.status.is-valid {
  background: #e8f2ff;
  color: var(--blue-dark);
}

.status.is-expired {
  background: #f1f4f7;
  color: var(--muted);
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 18px;
}

.address-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.payment-summary {
  margin-bottom: 14px;
}

.summary-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.summary-title span:not(.status) {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-metrics div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.summary-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.summary-metrics strong {
  display: block;
  overflow-wrap: anywhere;
}

.summary-metrics .is-paid {
  color: var(--green);
}

.summary-metrics .is-valid {
  color: var(--blue-dark);
}

.summary-metrics .is-expired {
  color: var(--amber);
}

.action-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.action-group,
.action-danger {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.action-bar form {
  margin: 0;
}

.details {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 18px 0;
}

.compact-details {
  grid-template-columns: 120px minmax(0, 1fr);
}

.details dt {
  color: var(--muted);
  font-weight: 700;
}

.details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.copy-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow-wrap: anywhere;
}

.copy-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copy-line a {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.button.compact,
button.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.copy-box span,
.file-meta {
  color: var(--muted);
  font-size: 13px;
}

.copy-box.expired {
  background: #f8fafc;
  border-style: solid;
}

.copy-box.expired strong {
  font-size: 14px;
}

.copy-box.completed {
  background: #e7f6ee;
  border-style: solid;
  border-color: #bfe7cf;
}

.copy-box.completed strong {
  color: var(--green);
  font-size: 14px;
}

.refund-box {
  margin-top: 12px;
}

.refund-box.available {
  background: #fff;
  border-style: solid;
}

.refund-box.blocked {
  background: #f8fafc;
  border-style: solid;
}

.refund-box.blocked strong {
  color: var(--muted);
  font-size: 14px;
}

.up2pay-diagnostic {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  color: #7a4d00;
  background: #fff8e7;
  border: 1px solid #f1d395;
  border-radius: 8px;
  font-size: 13px;
}

.up2pay-diagnostic strong {
  color: #7a4d00;
}

.up2pay-diagnostic ul {
  margin: 0;
  padding-left: 18px;
}

.up2pay-diagnostic p {
  margin: 0;
}

.up2pay-callback-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 0;
}

.up2pay-callback-details div {
  min-width: 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid #efd79f;
  border-radius: 6px;
}

.up2pay-callback-details dt {
  color: #7a4d00;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.up2pay-callback-details dd {
  margin: 4px 0 0;
  color: #18212b;
  overflow-wrap: anywhere;
}

.up2pay-return-log {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .52);
  border: 1px solid #efd79f;
  border-radius: 8px;
}

.up2pay-diagnostic code {
  display: block;
  padding: 10px;
  color: #18212b;
  background: #fff;
  border: 1px solid #efd79f;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.up2pay-id-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid #f1d395;
}

.up2pay-id-form label {
  color: #7a4d00;
  gap: 5px;
}

.up2pay-id-form input {
  min-height: 36px;
  border-color: #efd79f;
}

.up2pay-id-form button {
  align-self: end;
}

.inline-form {
  margin-top: 14px;
}

.mail-panel {
  margin-bottom: 18px;
}

.mail-template {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #000;
}

.visually-hidden-copy {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.flash {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  font-weight: 700;
}

.flash.success {
  background: #e7f6ee;
  color: var(--green);
}

.flash.error {
  background: #fdeceb;
  color: var(--red);
}

.flash.warning {
  background: #fff4db;
  color: #8a5a00;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.diagnostic-list {
  display: inline-grid;
  gap: 6px;
  margin: 10px auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.settings-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.settings-list div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.settings-list strong {
  overflow-wrap: anywhere;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.settings-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.muted-text {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.api-result {
  margin-bottom: 18px;
}

.api-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.api-kv div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.api-kv strong,
.api-kv span {
  display: block;
  overflow-wrap: anywhere;
}

.api-kv strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.api-kv span {
  margin-top: 5px;
}

.api-debug {
  margin-top: 14px;
}

.api-debug summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 800;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 16, 28, .58);
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-dialog {
  position: relative;
  width: min(820px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.modal-dialog.is-frame {
  padding: 0;
  overflow: hidden;
}

.modal-dialog.is-payment-frame {
  width: min(1180px, 100%);
  height: min(900px, calc(100vh - 24px));
}

.modal-dialog.is-create-frame {
  width: min(1040px, calc(100vw - 64px));
  height: min(700px, calc(100vh - 64px));
}

.modal-dialog.is-user-create-frame,
.modal-dialog.is-user-edit-frame {
  width: min(900px, calc(100vw - 64px));
  height: min(620px, calc(100vh - 64px));
}

.modal-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #f5f7f8;
}

.modal-frame-page {
  min-height: 100vh;
  background: #f5f7f8;
  font-size: 14px;
}

.modal-frame-main {
  min-height: 100vh;
  padding: 18px;
}

.create-payment-frame .modal-frame-main {
  display: grid;
  place-items: center;
}

.user-frame .modal-frame-main {
  display: grid;
  align-items: stretch;
  justify-items: stretch;
  padding: 16px;
}

.modal-frame-page .payment-create-panel {
  width: min(980px, 100%);
  margin: 0 auto;
}

.modal-frame-page .user-modal-panel {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 32px);
  margin: 0;
  display: flex;
  flex-direction: column;
}

.modal-frame-page .payment-create-panel .grid-form {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.modal-frame-page .user-modal-panel .grid-form {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.modal-frame-page .user-modal-panel .form {
  gap: 12px 14px;
}

.modal-frame-page .user-modal-panel input,
.modal-frame-page .user-modal-panel select {
  min-height: 36px;
  background: #fbfcfd;
}

.modal-frame-page .user-modal-panel label {
  color: #5d6978;
  font-size: 13px;
}

.modal-frame-page .user-modal-panel .form-actions {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.modal-form-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.modal-form-heading h2 {
  font-size: 20px;
}

.modal-frame-page .payment-create-panel .form-section {
  padding: 12px 0 2px;
  border-top: 1px solid var(--line);
}

.modal-frame-page .payment-create-panel .form-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.modal-frame-page .payment-create-panel .form-section h2 {
  color: var(--ink);
  font-size: 15px;
}

.modal-frame-page .panel,
.modal-frame-page .payment-summary {
  box-shadow: none;
  padding: 12px;
}

.modal-frame-page .topbar,
.modal-frame-page .action-bar {
  margin-bottom: 10px;
}

.modal-frame-page h2 {
  font-size: 16px;
}

.modal-frame-page .summary-title {
  margin-bottom: 10px;
}

.modal-frame-page .summary-metrics {
  gap: 8px;
}

.modal-frame-page .summary-metrics div {
  padding: 8px 10px;
}

.modal-frame-page .summary-metrics span {
  margin-bottom: 4px;
  font-size: 11px;
}

.modal-frame-page .details-grid,
.modal-frame-page .address-grid {
  gap: 10px;
}

.modal-frame-page .address-grid {
  margin-top: 10px;
}

.modal-frame-page .details {
  margin: 10px 0;
  gap: 6px 12px;
}

.modal-frame-page .copy-box {
  padding: 10px;
}

.modal-frame-page .button,
.modal-frame-page button {
  min-height: 34px;
  padding: 0 12px;
}

.modal-frame-page .button.compact,
.modal-frame-page button.compact {
  min-height: 30px;
}

.modal-frame-page .status {
  min-height: 22px;
  padding: 0 8px;
  font-size: 12px;
}

.modal-frame-page .mail-panel {
  margin-bottom: 10px;
}

.modal-frame-page .mail-template {
  padding: 10px;
}

.modal-frame-page .payment-create-panel .form {
  gap: 12px 14px;
}

.modal-frame-page .payment-create-panel input {
  min-height: 36px;
  background: #fbfcfd;
}

.modal-frame-page .payment-create-panel label {
  color: #5d6978;
  font-size: 13px;
}

.modal-frame-page .payment-create-panel .form-actions {
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  background: #f2f5f8;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  box-shadow: none;
}

.modal-close:hover {
  background: #e8edf2;
}

.error-panel {
  display: grid;
  gap: 14px;
}

.error-panel p {
  margin: 0;
  color: var(--muted);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-brand {
  margin-bottom: 22px;
}

.login-brand span {
  color: var(--muted);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .main {
    padding: 18px;
  }

  .metrics,
  .dashboard-grid,
  .donut-layout,
  .access-grid,
  .settings-grid,
  .details-grid,
  .address-grid,
  .summary-metrics,
  .up2pay-id-form,
  .compact-form,
  .grid-form {
    grid-template-columns: 1fr;
  }

  .filters,
  .toolbar,
  .panel-heading,
  .summary-title,
  .action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filters input,
  .filters select {
    min-width: 0;
    width: 100%;
  }
}
