/* People and growth screens (customers, programs, marketing, users, roles, requests, settings, sign-in).
   Loaded after admin-ui.css; keeps the console's rounded, card-based look. */

/* ---- shared by these screens ---- */
/* An empty table inside a card keeps the card's side padding. */
:is(#ov_people, #ov_merchants, #ov_programs, #ov_analytics, #ov_segments, #ov_campaigns, #ov_marketing-reports) .panel .table-wrap > .empty-state { padding: var(--space-3) var(--space-4); }

/* ---- customers: list ---- */
#ovPeopleResults td:first-child .row-action-btn { height: auto; max-width: 34ch; padding: 4px 0; border: 0; background: none; white-space: normal; text-align: left; line-height: 18px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--edge); }
#ovPeopleResults td:first-child .row-action-btn:hover { text-decoration-color: var(--ink); }

/* ---- customers: one person ---- */
:is(#ov_people, #ov_merchants) .ov-headcard :is(h1, h2) { word-break: normal; overflow-wrap: anywhere; }
:is(#ov_people, #ov_merchants) div.ov-check { overflow-wrap: anywhere; }
:is(#ov_people, #ov_merchants) div.ov-check .row-action-btn { margin-left: var(--space-2); }
/* Two columns only where both tables fit; text cells wrap before anything scrolls out of sight. */
:is(#ov_people, #ov_merchants) .dash-grid :is(td, th) { white-space: normal; }
:is(#ov_people, #ov_merchants) .dash-grid td .mono { white-space: nowrap; }
:is(#ov_people, #ov_merchants) .dash-grid td { padding-top: 6px; padding-bottom: 6px; }
@media (max-width: 1500px) { :is(#ov_people, #ov_merchants) .dash-grid { grid-template-columns: minmax(0, 1fr); } }
#ov_people .ov-month, #ov_merchants .ov-month { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
:is(#ov_people, #ov_merchants) .ov-risk-head .btn-row { align-items: center; }
:is(#ov_people, #ov_merchants) .ov-risk-head .seg { margin: 0; }
:is(#ov_people, #ov_merchants) .ov-timeline li.empty-note { display: block; }
@media (max-width: 640px), (pointer: coarse) {
  :is(#ov_people, #ov_merchants) :is(.ov-reveal, .row-action-btn, .view-all) { min-height: 44px; height: auto; }
  :is(#ov_people, #ov_merchants) .ov-risk-signal a, :is(#ov_people, #ov_merchants) td a { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 640px) {
  #ovPeopleResults td:first-child .row-action-btn { display: inline-flex; align-items: center; justify-content: flex-end; text-align: right; }
  :is(#ov_people, #ov_merchants) table.stack td { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
  :is(#ov_people, #ov_merchants) .ov-kv .mono { overflow-wrap: anywhere; }
}

/* ---- marketing ---- */
:is(#ov_analytics, #ov_segments, #ov_campaigns, #ov_marketing-reports, #ov_bonus-campaign) .ov-chip { text-transform: none; }
:is(#ov_analytics, #ov_segments, #ov_campaigns, #ov_marketing-reports) table td { white-space: normal; overflow-wrap: break-word; }
:is(#ov_analytics, #ov_segments, #ov_campaigns, #ov_marketing-reports) table td.num, :is(#ov_segments, #ov_campaigns, #ov_marketing-reports) table td .mono, .mk-actions { white-space: nowrap; }
.mk-name, .mk-link { overflow-wrap: anywhere; }
.mk-who, .mk-snippet, .mk-text { display: block; line-height: 18px; }
.mk-actions { display: inline-flex; gap: var(--space-2); }
.mk-barcell { display: inline-flex; align-items: center; gap: var(--space-2); }
@media (min-width: 641px) {
  :is(#ov_segments, #ov_campaigns, #ov_marketing-reports, #ov_analytics) table td { padding-top: 6px; padding-bottom: 6px; }
  .mk-name { display: block; min-width: 24ch; }
  .mk-who { min-width: 32ch; max-width: 56ch; }
  .mk-snippet { max-width: 64ch; }
  .mk-text { min-width: 36ch; max-width: 56ch; }
  .mk-link { display: inline-block; min-width: 18ch; max-width: 36ch; }
}
/* The audience figure stays in view while filters change; its sample scrolls inside it instead of covering them. */
#ov_segments #mkSample .table-wrap { max-height: 220px; overflow: auto; }
:is(#ov_campaigns, #ov_bonus-campaign) .ov-headcard :is(h1, h2) { word-break: normal; overflow-wrap: anywhere; }
:is(#ov_campaigns, #ov_bonus-campaign) .ov-headcard { justify-content: space-between; }
:is(#ov_campaigns, #ov_bonus-campaign) .ov-headcard > div:first-child { min-width: 0; flex: 1 1 320px; }
.mk-message, .mk-sms-text { overflow-wrap: anywhere; }
@media (max-width: 640px), (pointer: coarse) {
  :is(#ov_analytics, #ov_campaigns, #ov_marketing-reports) .mk-link { display: inline-flex; align-items: center; min-height: 44px; }
  .mk-actions .btn { min-height: 44px; }
  #ov_segments #mkSample summary, .help summary { min-height: 44px; }
  #ov_segments .mk-audience { position: static; }
  .mk-actions { flex-wrap: wrap; justify-content: flex-end; }
}
#ov_campaigns .ov-headcard .ov-chip { height: auto; min-height: 22px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* ---- users, roles, activity, approvals, requests, reports ---- */
:is(#usersView, #userDetailView, #rolesView, #rolesMatrixPanel, #approvalsView) .role-pill { text-transform: none; }
.account-kv th { width: 12rem; padding-right: var(--space-4); text-align: left; font-weight: 500; color: var(--ink-muted); white-space: nowrap; }
.account-kv td { white-space: normal; overflow-wrap: anywhere; }
:is(#userDetailView, #mineView, #reportsView) td.reason-cell { white-space: normal; overflow-wrap: anywhere; }
@media (min-width: 641px) {
  :is(#userDetailView, #mineView, #reportsView) td { white-space: normal; }
  :is(#userDetailView, #mineView, #reportsView) td.reason-cell { min-width: 26ch; max-width: 56ch; padding-top: 6px; padding-bottom: 6px; line-height: 18px; }
  /* the username and email line up under the name, not under the avatar */
  #usersView .user-cell { max-width: 420px; }
  #usersView .user-cell .sub-line { padding-left: 34px; }
}
/* The table's own "Export CSV" does the same job as this second button in the filters. */
#reportsView #downloadCsvBtn { display: none; }
#detailsForm [aria-invalid="true"] { border-color: var(--critical); }
.warn-banner .temp-password-box { margin: 8px 0; overflow-wrap: anywhere; }

/* ---- settings ---- */
#smsProviderStatus .ring-stat-row { justify-content: flex-start; }
@media (max-width: 640px), (pointer: coarse) {
  /* the switch keeps its size; the area that takes the tap is 44px tall */
  #usersView .toggle::before { content: ""; position: absolute; inset: -10px -2px; }
  .dp .rl-row label { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
}

/* ---- sign-in ---- */
@media (max-width: 640px), (pointer: coarse) {
  .login-links button { display: inline-flex; align-items: center; min-height: 44px; }
}
:is(#ov_programs, #ov_people, #ov_merchants, #ov_segments) summary { min-height: 24px; }
@media (max-width: 640px) {
  :is(#ov_segments, #ov_campaigns, #ov_marketing-reports) table.stack td > div { min-width: 0; text-align: right; }
  #ov_campaigns .ov-headcard .btn-row { width: 100%; }
  #ov_campaigns .ov-headcard .btn-row .btn { flex: 1 1 100%; }
}
