/**
 * Propzora — Admin Panels Stylesheet
 * Shared across: admin-escrow, admin-disputes, admin-documents,
 *                admin-finance, admin-kyc, admin-staff
 *
 * Relies on /css/design-system.css being loaded first.
 * Theme: white background · #0f172a ink · #1e3a8a blue actions
 */

/* ─── Shell layout ──────────────────────────────────────────── */
.ap-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 64px 1fr;
  min-height: 100vh;
  background: var(--pz-surface);
  font-family: var(--pz-font);
  color: var(--pz-ink);
  -webkit-font-smoothing: antialiased;
}

/* ─── Top bar ───────────────────────────────────────────────── */
.ap-topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 0;
  background: var(--pz-white);
  border-bottom: 1px solid var(--pz-line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.ap-topbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  height: 64px;
  text-decoration: none;
  border-right: 1px solid var(--pz-line);
  flex-shrink: 0;
  width: 240px;
}

.ap-topbar__logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--pz-blue-mist);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ap-topbar__logo-mark img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.ap-topbar__logo-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--pz-ink);
  letter-spacing: -0.02em;
}

.ap-topbar__logo-tag {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pz-blue);
  background: var(--pz-blue-mist);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 2px;
}

.ap-topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ap-topbar__admin-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pz-ink-secondary);
}

.ap-topbar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pz-blue);
  color: var(--pz-white);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.ap-topbar__logout {
  font-size: 0.8125rem;
  color: var(--pz-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--pz-font);
  padding: 8px 12px;
  border-radius: var(--pz-radius-sm);
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ap-topbar__logout:hover {
  color: var(--pz-danger);
  background: var(--pz-danger-soft);
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.ap-sidebar {
  grid-column: 1;
  grid-row: 2;
  background: var(--pz-white);
  border-right: 1px solid var(--pz-line);
  display: flex;
  flex-direction: column;
  padding: 24px 12px 24px 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.ap-sidebar__section-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pz-faint);
  padding: 0 20px;
  margin: 20px 0 8px;
}

.ap-sidebar__section-label:first-child {
  margin-top: 0;
}

.ap-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pz-muted);
  text-decoration: none;
  border-radius: 0;
  transition: color 0.15s, background 0.15s;
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--pz-font);
}

.ap-nav-item:hover {
  color: var(--pz-ink);
  background: var(--pz-surface);
}

.ap-nav-item.is-active {
  color: var(--pz-blue);
  background: var(--pz-blue-mist);
  font-weight: 600;
}

.ap-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--pz-blue);
  border-radius: 0 3px 3px 0;
}

.ap-nav-item__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.ap-nav-item.is-active .ap-nav-item__icon {
  opacity: 1;
}

.ap-nav-item__badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--pz-blue);
  color: var(--pz-white);
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ap-nav-item__badge--warn {
  background: #d97706;
}

.ap-nav-item__badge--danger {
  background: var(--pz-danger);
}

/* ─── Main content area ─────────────────────────────────────── */
.ap-main {
  grid-column: 2;
  grid-row: 2;
  padding: 32px;
  min-width: 0;
}

/* ─── Page header ───────────────────────────────────────────── */
.ap-page-header {
  margin-bottom: 28px;
}

.ap-page-header__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pz-blue);
  margin-bottom: 8px;
}

.ap-page-header__eyebrow::before {
  content: '';
  width: 16px;
  height: 1.5px;
  background: var(--pz-blue);
  border-radius: 99px;
}

.ap-page-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pz-ink);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
  font-family: var(--pz-font-display);
}

.ap-page-header__sub {
  font-size: 0.875rem;
  color: var(--pz-muted);
}

.ap-page-header__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ─── Stat cards row ────────────────────────────────────────── */
.ap-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.ap-stat {
  background: var(--pz-white);
  border: 1px solid var(--pz-line-soft);
  border-radius: var(--pz-radius-lg);
  padding: 20px 24px;
  box-shadow: var(--pz-shadow-xs);
}

.ap-stat__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pz-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.ap-stat__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--pz-ink);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 4px;
  font-family: var(--pz-font-display);
}

.ap-stat__sub {
  font-size: 0.75rem;
  color: var(--pz-faint);
}

.ap-stat--blue  { border-top: 3px solid var(--pz-blue); }
.ap-stat--green { border-top: 3px solid var(--pz-green-bright); }
.ap-stat--gold  { border-top: 3px solid var(--pz-gold-line); }
.ap-stat--red   { border-top: 3px solid var(--pz-danger); }

/* ─── Queue / Task cards ────────────────────────────────────── */
.ap-queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ap-task {
  background: var(--pz-white);
  border: 1px solid var(--pz-line-soft);
  border-radius: var(--pz-radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--pz-shadow-xs);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.ap-task:hover {
  box-shadow: var(--pz-shadow-sm);
  border-color: var(--pz-line);
}

.ap-task__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--pz-radius);
  background: var(--pz-blue-mist);
  color: var(--pz-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ap-task__icon--green  { background: var(--pz-green-soft);  color: var(--pz-green); }
.ap-task__icon--gold   { background: var(--pz-gold-soft);   color: var(--pz-gold); }
.ap-task__icon--red    { background: var(--pz-danger-soft); color: var(--pz-danger); }

.ap-task__body {
  flex: 1;
  min-width: 0;
}

.ap-task__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--pz-ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-task__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.ap-task__meta-item {
  font-size: 0.75rem;
  color: var(--pz-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ap-task__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Table ─────────────────────────────────────────────────── */
.ap-table-wrap {
  background: var(--pz-white);
  border: 1px solid var(--pz-line-soft);
  border-radius: var(--pz-radius-lg);
  box-shadow: var(--pz-shadow-xs);
  overflow: hidden;
}

/* Row action buttons (edit/suspend/reset/set-pin etc.) can outgrow the
   visible width on narrower screens or rows with many actions. The wrap
   above clips at its border-radius, so it can't scroll — give the table
   body itself a horizontal scroll instead of letting extra buttons get
   silently cut off with no way to reach them. */
#tableBody {
  overflow-x: auto;
}

/* Row action kebab menu — used on Staff & Roles and any other admin
   table where a row can have more actions than fit inline. */
.ap-row-menu {
  position: relative;
  display: inline-block;
}
.ap-row-menu__dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--pz-white);
  border: 1px solid var(--pz-line);
  border-radius: var(--pz-radius-sm);
  box-shadow: var(--pz-shadow-md);
  z-index: 20;
  min-width: 170px;
  overflow: hidden;
}
.ap-row-menu__dropdown.is-open {
  display: block;
}
.ap-row-menu__dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 0.8125rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--pz-ink);
}
.ap-row-menu__dropdown button:hover {
  background: var(--pz-surface);
}

.ap-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--pz-line-soft);
  flex-wrap: wrap;
}

.ap-table-toolbar__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--pz-ink);
}

.ap-table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--pz-surface);
  border: 1px solid var(--pz-line);
  border-radius: var(--pz-radius-sm);
  padding: 8px 14px;
  min-width: 220px;
}

.ap-table-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 0.875rem;
  font-family: var(--pz-font);
  color: var(--pz-ink);
  width: 100%;
}

/* ─── Leaderboard rows (admin-affiliates.html) ─────────────────── */
.ap-leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--pz-line-soft);
}

.ap-leaderboard-row:last-child {
  border-bottom: none;
}

.ap-leaderboard-row__rank {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--pz-surface);
  color: var(--pz-ink-secondary);
  font-size: 0.75rem;
  font-weight: 700;
}

.ap-leaderboard-row__name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pz-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ap-leaderboard-row__name small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--pz-ink-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ap-leaderboard-row__value {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--pz-navy);
}

.ap-table-search input::placeholder {
  color: var(--pz-faint);
}

.ap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.ap-table thead th {
  text-align: left;
  padding: 12px 20px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--pz-muted);
  background: var(--pz-surface);
  border-bottom: 1px solid var(--pz-line-soft);
  white-space: nowrap;
}

.ap-table tbody tr {
  border-bottom: 1px solid var(--pz-line-soft);
  transition: background 0.1s;
}

.ap-table tbody tr:last-child {
  border-bottom: none;
}

.ap-table tbody tr:hover {
  background: var(--pz-surface);
}

.ap-table tbody td {
  padding: 14px 20px;
  color: var(--pz-ink-secondary);
  vertical-align: middle;
}

.ap-table .ap-table__primary {
  font-weight: 600;
  color: var(--pz-ink);
}

.ap-table__empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--pz-faint);
  font-size: 0.875rem;
}

/* ─── Status pills ──────────────────────────────────────────── */
.ap-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.ap-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ap-pill--pending  { background: #fffbeb; color: #92400e; }
.ap-pill--active   { background: var(--pz-green-soft); color: var(--pz-green); }
.ap-pill--verified { background: var(--pz-green-soft); color: var(--pz-green); }
.ap-pill--rejected { background: var(--pz-danger-soft); color: var(--pz-danger); }
.ap-pill--cancelled{ background: var(--pz-surface-2); color: var(--pz-muted); }
.ap-pill--held     { background: var(--pz-blue-mist); color: var(--pz-blue); }
.ap-pill--disputed { background: #fff7ed; color: #c2410c; }
.ap-pill--released { background: var(--pz-green-soft); color: var(--pz-green); }
.ap-pill--applied  { background: var(--pz-green-soft); color: var(--pz-green); }

/* ─── Panel buttons (compact, for table rows) ───────────────── */
.ap-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--pz-font);
  border-radius: var(--pz-radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.ap-btn--primary {
  background: var(--pz-blue);
  color: var(--pz-white);
}

.ap-btn--primary:hover {
  background: var(--pz-blue-hover);
  box-shadow: 0 2px 8px rgba(30,58,138,0.2);
}

.ap-btn--secondary {
  background: var(--pz-white);
  color: var(--pz-ink-secondary);
  border: 1px solid var(--pz-line);
}

.ap-btn--secondary:hover {
  background: var(--pz-surface);
  border-color: #cbd5e1;
}

.ap-btn--danger {
  background: var(--pz-danger-soft);
  color: var(--pz-danger);
}

.ap-btn--danger:hover {
  background: #fecaca;
}

.ap-btn--success {
  background: var(--pz-green-soft);
  color: var(--pz-green);
}

.ap-btn--success:hover {
  background: #a7f3d0;
}

.ap-btn--warn {
  background: #fffbeb;
  color: #92400e;
}

.ap-btn--warn:hover {
  background: #fef3c7;
}

.ap-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ap-btn .ap-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: ap-spin 0.65s linear infinite;
}

@keyframes ap-spin {
  to { transform: rotate(360deg); }
}

/* ─── Modal / Drawer overlay ────────────────────────────────── */
.ap-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ap-overlay.is-open {
  display: flex;
}

.ap-modal {
  background: var(--pz-white);
  border-radius: var(--pz-radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--pz-shadow-lg);
  overflow: hidden;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.ap-modal--wide {
  max-width: 760px;
}

.ap-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--pz-line-soft);
  flex-shrink: 0;
}

.ap-modal__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pz-ink);
  letter-spacing: -0.02em;
}

.ap-modal__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pz-surface);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pz-muted);
  transition: background 0.15s, color 0.15s;
}

.ap-modal__close:hover {
  background: var(--pz-line);
  color: var(--pz-ink);
}

.ap-modal__body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.ap-modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--pz-line-soft);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: var(--pz-surface);
}

/* ─── Form groups inside modals ─────────────────────────────── */
.ap-field {
  margin-bottom: 16px;
}

.ap-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pz-ink-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.ap-field .pz-input {
  padding: 12px 16px;
  font-size: 0.9375rem;
}

.ap-field textarea.pz-input {
  height: 96px;
  resize: vertical;
}

/* ─── Alert / notice banners ────────────────────────────────── */
.ap-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--pz-radius);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.ap-notice--info    { background: var(--pz-blue-mist);   color: var(--pz-blue-hover); border: 1px solid var(--pz-blue-soft); }
.ap-notice--warn    { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.ap-notice--success { background: var(--pz-green-soft);  color: var(--pz-green); border: 1px solid #6ee7b7; }
.ap-notice--danger  { background: var(--pz-danger-soft); color: var(--pz-danger); border: 1px solid #fca5a5; }

.ap-notice__icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── Loading skeleton ──────────────────────────────────────── */
.ap-skeleton {
  background: linear-gradient(90deg, var(--pz-line-soft) 25%, var(--pz-line) 50%, var(--pz-line-soft) 75%);
  background-size: 200% 100%;
  animation: ap-shimmer 1.4s ease infinite;
  border-radius: var(--pz-radius-sm);
}

@keyframes ap-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Pagination ────────────────────────────────────────────── */
.ap-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--pz-line-soft);
  font-size: 0.8125rem;
  color: var(--pz-muted);
}

.ap-pagination__pages {
  display: flex;
  gap: 4px;
}

.ap-page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pz-radius-sm);
  border: 1px solid var(--pz-line);
  background: var(--pz-white);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pz-muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s;
  font-family: var(--pz-font);
}

.ap-page-btn:hover {
  border-color: var(--pz-blue);
  color: var(--pz-blue);
}

.ap-page-btn.is-active {
  background: var(--pz-blue);
  border-color: var(--pz-blue);
  color: var(--pz-white);
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .ap-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 64px auto 1fr;
  }

  .ap-topbar {
    grid-column: 1;
  }

  .ap-topbar__logo {
    width: auto;
    border-right: none;
  }

  .ap-sidebar {
    grid-column: 1;
    grid-row: 2;
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 0 12px;
    border-right: none;
    border-bottom: 1px solid var(--pz-line);
    gap: 4px;
  }

  .ap-sidebar__section-label {
    display: none;
  }

  .ap-nav-item {
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    font-size: 0.6875rem;
    white-space: nowrap;
    border-radius: var(--pz-radius-sm);
  }

  .ap-nav-item.is-active::before {
    top: auto;
    bottom: 0;
    left: 8px;
    right: 8px;
    width: auto;
    height: 2px;
    border-radius: 2px 2px 0 0;
  }

  .ap-nav-item__badge {
    margin-left: 0;
  }

  .ap-main {
    grid-column: 1;
    grid-row: 3;
    padding: 20px 16px;
  }
}
/* ─── Session lock screen ───────────────────────────────────── */
.ap-lock-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ap-lock-screen.is-locked {
  display: flex;
}

.ap-lock-card {
  background: var(--pz-white);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}

.ap-lock-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--pz-blue-mist);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.ap-lock-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pz-ink);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.ap-lock-sub {
  font-size: 0.875rem;
  color: var(--pz-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.ap-lock-btn {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--pz-ink);
  color: var(--pz-white);
  border: none;
  border-radius: var(--pz-radius);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--pz-font);
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: -0.01em;
}

.ap-lock-btn:hover  { background: #1e293b; }
.ap-lock-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.ap-lock-warning {
  margin-top: 16px;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--pz-radius-sm);
  font-size: 0.8125rem;
  color: #92400e;
  line-height: 1.5;
}

/* ─── Session timeout warning banner ────────────────────────── */
.ap-timeout-banner {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8000;
  background: #1e293b;
  color: white;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--pz-font);
  box-shadow: 0 8px 32px rgba(15,23,42,0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.ap-timeout-banner.is-visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.ap-timeout-banner__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  flex-shrink: 0;
  animation: ap-pulse 1.5s ease infinite;
}

@keyframes ap-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

.ap-timeout-banner__dismiss {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--pz-font);
  transition: background 0.15s;
  margin-left: 4px;
}

.ap-timeout-banner__dismiss:hover { background: rgba(255,255,255,0.25); }

/* ─── Transaction PIN overlay ───────────────────────────────── */
.ap-pin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8500;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ap-pin-overlay.is-open {
  display: flex;
}

.ap-pin-card {
  background: var(--pz-white);
  border-radius: 20px;
  padding: 36px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}

.ap-pin-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--pz-blue-mist);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.ap-pin-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--pz-ink);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.ap-pin-sub {
  font-size: 0.875rem;
  color: var(--pz-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.ap-pin-action-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pz-surface);
  border: 1px solid var(--pz-line-soft);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pz-ink-secondary);
  margin-bottom: 20px;
}

.ap-pin-input {
  width: 100%;
  height: 60px;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
  border: 1.5px solid var(--pz-line);
  border-radius: var(--pz-radius);
  outline: none;
  font-family: var(--pz-font);
  color: var(--pz-ink);
  margin-bottom: 16px;
  -webkit-text-security: disc;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--pz-white);
}

.ap-pin-input:focus {
  border-color: var(--pz-blue);
  box-shadow: 0 0 0 3px rgba(30,58,138,0.1);
}

.ap-pin-input.is-error {
  border-color: var(--pz-danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
  animation: ap-shake 0.35s ease;
}

@keyframes ap-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.ap-pin-msg {
  font-size: 0.8125rem;
  min-height: 18px;
  margin-bottom: 12px;
  color: var(--pz-danger);
  line-height: 1.4;
}

.ap-pin-attempts {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}

.ap-pin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pz-line);
  transition: background 0.15s;
}

.ap-pin-dot.is-used { background: var(--pz-danger); }

.ap-pin-cancel {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--pz-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--pz-font);
  transition: color 0.15s;
  padding: 4px 8px;
}

.ap-pin-cancel:hover { color: var(--pz-ink); }

/* ─── Pending credits — vertical card list ──────────────────────
   Used on Finance Control instead of a wide table, since this panel
   sits in a half-width column and a multi-column table with a long
   reference string forces horizontal scrolling. Each credit stacks
   its fields vertically instead. */
.pc-card {
  padding: 16px 20px;
  border-bottom: 1px solid var(--pz-line-soft);
}
.pc-card:last-child {
  border-bottom: none;
}
.pc-card__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.pc-card__field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px dashed var(--pz-line-soft);
}
.pc-card__label {
  font-size: 0.75rem;
  color: var(--pz-muted);
  flex-shrink: 0;
}
.pc-card__value {
  font-size: 0.8125rem;
  color: var(--pz-ink-secondary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}