.admin-page { min-height: 100vh; background: #f1eee5; }
.admin-header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px max(24px, calc((100vw - 1180px) / 2)); background: var(--deep); color: var(--white); }
.admin-brand { margin: 0; }
.admin-user { display: flex; align-items: center; gap: 20px; }
.admin-user form { margin: 0; }
.admin-user button { border: 1px solid rgba(255,255,255,.55); background: transparent; color: var(--white); padding: 9px 14px; cursor: pointer; }
.admin-content { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 90px; }
.admin-title { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.admin-title h1, .admin-auth h1 { margin: 0; font: 600 42px/1.1 "Playfair Display", serif; }
.admin-section { margin: 26px 0; padding: 28px; background: var(--white); border: 1px solid var(--line); }
.admin-section h2 { margin: 0 0 22px; font: 600 30px/1.2 "Playfair Display", serif; }
.admin-form { display: grid; gap: 15px; padding: 22px; background: #f7f5ef; }
.admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-form h3 { margin: 0; font: 600 23px/1.2 "Playfair Display", serif; }
.admin-form label { display: flex; flex-direction: column; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 600; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font: inherit; }
.admin-form input[type="checkbox"] { width: 18px; min-height: 18px; }
.admin-form .admin-check { flex-direction: row; align-items: center; }
.admin-form .full { grid-column: 1 / -1; }
.admin-form .button { width: 100%; }
.admin-record-list { display: grid; gap: 10px; margin-top: 18px; }
.admin-record { border: 1px solid var(--line); background: var(--white); }
.admin-record summary { padding: 16px; cursor: pointer; font-weight: 700; }
.admin-record summary span { float: right; color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; }
.admin-record > .admin-form { margin: 0 14px 14px; }
.admin-delete-form { margin: 0 14px 14px; }
.button-danger { background: #8e352c; color: #fff; }
.admin-message { min-height: 24px; color: var(--ink); }
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.admin-stat-grid > div { display: grid; gap: 5px; padding: 18px; background: var(--white); border: 1px solid var(--line); }
.admin-stat-grid strong { font: 600 28px/1.1 "Playfair Display", serif; }
.admin-stat-grid span, .notification-row small { color: var(--muted); font-size: 12px; }
.notification-row { padding: 15px; }
.admin-success-notice { display: inline-block; padding: 10px 14px; border: 1px solid #9ec9aa; background: #e8f5eb; color: #245c32; font-size: 14px; }
.notification-row p { margin: 8px 0; }
.notification-row form { margin-top: 10px; }
.admin-alert { padding: 12px; background: #f5d6d1; color: #71261f; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th, .admin-table td { padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.customer-search, .report-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 18px; background: var(--white); border: 1px solid var(--line); }
.customer-search label, .report-filter label { display: grid; gap: 6px; min-width: 180px; font-size: 13px; font-weight: 600; }
.customer-search input, .report-filter input, .report-filter select { min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font: inherit; }
.report-filter .button-outline { border: 1px solid var(--deep); color: var(--deep); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-auth { width: min(460px, calc(100% - 32px)); margin: 10vh auto; padding: 36px; background: var(--white); }
.admin-auth h1 { margin: 32px 0 24px; font-size: 32px; }
.admin-auth .admin-form { padding: 0; background: transparent; }
.admin-auth > p:last-child { margin-top: 24px; }
.associate-auth { max-width: 760px; }
.associate-auth .section-kicker { margin: 30px 0 10px; }
.associate-auth h1 { margin: 0 0 12px; }
.associate-auth .associate-registration-form { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 22px; background: #f7f5ef; }
.associate-phone-input { display: flex; align-items: stretch; }
.associate-phone-input > span { display: grid; min-width: 58px; place-items: center; border: 1px solid var(--line); border-right: 0; background: #eeeae0; }
.associate-phone-input input { min-width: 0; }
.associate-review-details { padding: 0 16px 16px; }
.associate-masked-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; margin: 0; border-top: 1px solid var(--line); }
.associate-masked-details > div { display: grid; grid-template-columns: minmax(100px, .75fr) 1.25fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.associate-masked-details dt { color: var(--muted); font-size: 12px; }
.associate-masked-details dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.associate-status { display: inline-block; padding: 4px 8px; border-radius: 2px; background: #eeeae0; color: var(--ink); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.associate-status-pending { background: #f5e8c9; color: #715416; }
.associate-status-approved { background: #dcebe1; color: #285d41; }
.associate-status-rejected, .associate-status-blocked { background: #f2dcd7; color: #7d3028; }
.associate-reveal-form { margin: 16px 0; }
.associate-reveal-form button { min-height: 42px; padding: 8px 14px; border: 1px solid var(--deep); background: var(--white); color: var(--deep); font: inherit; font-weight: 700; cursor: pointer; }
.sensitive-output { margin-top: 10px; }
.sensitive-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin: 0; padding: 12px; background: #f7f5ef; }
.sensitive-detail-list > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.sensitive-detail-list dt { color: var(--muted); font-size: 12px; }
.sensitive-detail-list dd { margin: 4px 0 0; overflow-wrap: anywhere; font-weight: 700; }
.associate-review-form { grid-template-columns: 1fr 1fr; }
.associate-review-form > label:first-of-type { grid-column: 1 / -1; }
.associate-portal-note { padding: 16px; background: #e6efe8; color: #285d41; line-height: 1.6; }
.associate-workspace { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: start; gap: 24px; }
.associate-sidebar { position: sticky; top: 20px; display: grid; gap: 6px; padding: 14px; background: var(--deep); }
.associate-sidebar a { display: block; padding: 12px; color: var(--white); font-weight: 700; text-decoration: none; }
.associate-sidebar a:hover, .associate-sidebar a:focus-visible { background: rgba(255,255,255,.12); }
.associate-main { min-width: 0; }
.associate-main > .associate-dashboard-heading:first-child { margin-bottom: 18px; }
.associate-avatar { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; object-fit: cover; background: #e6efe8; }
.associate-avatar-placeholder { display: inline-grid; place-items: center; color: #285d41; font-weight: 700; }
.associate-record-heading { display: inline-flex; align-items: center; gap: 12px; }
.admin-record summary .associate-record-heading span { float: none; color: inherit; font-size: inherit; font-weight: 700; text-transform: none; }
.associate-photo-preview { display: block; width: 112px; height: 112px; margin-top: 10px; border-radius: 50%; object-fit: cover; background: #e6efe8; }
.associate-dashboard-heading { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 24px; padding: 24px; background: var(--white); border: 1px solid var(--line); }
.associate-dashboard-heading h1 { margin: 0 0 10px; font: 600 38px/1.1 "Playfair Display", serif; }
.associate-dashboard-heading p { margin: 7px 0; }
.associate-dashboard-photo { display: block; width: 120px; height: 120px; border-radius: 50%; object-fit: cover; background: #e6efe8; }
.associate-stat-grid { margin: 18px 0; }
.associate-stat-grid strong { font-size: 24px; overflow-wrap: anywhere; }
.wallet-summary-grid { margin: 18px 0; }
.associate-profile-form input[readonly] { background: #eeece6; }
.associate-review-details > p .button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; }
.associate-admin-photo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: #e6efe8; }
.wallet-action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.wallet-action-row form { margin: 0; }
.wallet-action-row label { display: grid; gap: 4px; font-size: 12px; }
.wallet-reversal-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 1fr) auto; gap: 10px; align-items: end; margin-top: 14px; }
.withdrawal-action-form { display: grid; gap: 8px; min-width: 190px; }
.withdrawal-action-form textarea, .withdrawal-action-form input { width: 100%; }
.withdrawal-bank-details { display: block; margin-top: 8px; overflow-wrap: anywhere; }
.associate-photo-preview[hidden] { display: none; }
.admin-header nav.admin-user a { color: var(--white); }
.admin-header nav.admin-user a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .admin-header { padding: 14px 16px; }
  .admin-user { gap: 10px; font-size: 13px; }
  .admin-content { width: min(100% - 24px, 1180px); padding-top: 32px; }
  .admin-title { align-items: flex-start; flex-direction: column; }
  .admin-title h1 { font-size: 34px; }
  .admin-section { padding: 18px 12px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-form .full { grid-column: 1; }
  .associate-auth .associate-registration-form, .associate-review-form { grid-template-columns: 1fr; }
  .associate-registration-form .full, .associate-review-form > label:first-of-type { grid-column: 1; }
  .associate-masked-details, .sensitive-detail-list { grid-template-columns: 1fr; }
  .associate-masked-details > div { grid-template-columns: 120px minmax(0, 1fr); }
  .associate-dashboard-heading { grid-template-columns: 1fr; justify-items: start; padding: 18px; }
  .associate-dashboard-heading h1 { font-size: 32px; }
  .associate-dashboard-photo { width: 92px; height: 92px; }
  .associate-workspace { grid-template-columns: 1fr; gap: 12px; }
  .associate-sidebar { position: sticky; top: 0; z-index: 4; display: flex; overflow-x: auto; padding: 6px; }
  .associate-sidebar a { flex: 0 0 auto; padding: 10px 12px; }
  .admin-user { flex-wrap: wrap; justify-content: flex-end; }
  .wallet-reversal-form { grid-template-columns: 1fr; }
}
