/* Member deactivation UI: compact state badge, two-up admin actions and confirmation sheet. */
.member-name-state-line{display:flex!important;align-items:center!important;gap:7px!important;min-width:0!important}
.member-name-state-line>b{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.member-name-state-icon{width:18px!important;height:18px!important;flex:0 0 18px!important;border-radius:50%!important;display:grid!important;place-items:center!important;font:900 11px/1 Inter,sans-serif!important;border:1px solid transparent!important;box-sizing:border-box!important}
.member-name-state-icon.is-active{color:#fff!important;background:#35b94a!important;border-color:#35b94a!important;box-shadow:0 3px 8px rgba(36,154,63,.24),inset 0 1px 0 rgba(255,255,255,.24)!important}
.member-name-state-icon.is-inactive{color:#fff!important;background:#ef3038!important;border-color:#ef3038!important;box-shadow:0 3px 8px rgba(221,37,46,.22),inset 0 1px 0 rgba(255,255,255,.22)!important}
.member-clean-card.is-member-inactive{background:linear-gradient(145deg,rgba(255,255,255,.97),rgba(250,248,246,.98))!important}
.member-clean-card.is-member-inactive .member-photo{filter:saturate(.8)}

.member-admin-actions.member-admin-actions-cutoff{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;min-width:206px!important;flex:0 0 206px!important}
.member-admin-primary-row{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;align-items:stretch!important}
.member-admin-primary-row>.btn,.member-admin-primary-row>.member-self-badge{width:100%!important;min-width:0!important;min-height:44px!important;display:grid!important;place-items:center!important;margin:0!important;padding:9px 10px!important;border-radius:14px!important;font-size:12px!important}
.member-admin-primary-row>.member-self-badge{grid-column:2!important}
.member-state-toggle{width:100%!important;min-height:44px!important;border-radius:14px!important;font-size:12px!important;font-weight:850!important;letter-spacing:.01em!important}
.member-state-toggle.is-deactivate{color:#9b5b12!important;background:linear-gradient(135deg,#fff7e8,#fff0d4)!important;border-color:#f0d5a6!important}
.member-state-toggle.is-activate{color:#087657!important;background:linear-gradient(135deg,#eaf9f3,#dff5eb)!important;border-color:#c6e9db!important}
.member-state-toggle:disabled{opacity:.68!important}

.member-state-modal-title{background:transparent!important;border:0!important;padding:0!important}
.member-state-confirm{margin-top:18px!important}
.member-state-person{display:flex!important;align-items:center!important;gap:13px!important;padding:13px 14px!important;border:1px solid #dce6f1!important;border-radius:18px!important;background:linear-gradient(135deg,#f7faff,#f2f7fd)!important}
.member-state-person .member-photo,.member-state-person .member-photo.fallback{width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important;max-width:50px!important;max-height:50px!important;flex:0 0 50px!important;border-radius:15px!important;object-fit:cover!important;display:grid!important;place-items:center!important}
.member-state-person>div{min-width:0!important}
.member-state-person b,.member-state-person span{display:block!important}
.member-state-person b{font-size:16px!important;color:#18304f!important}
.member-state-person span{margin-top:3px!important;color:#77879c!important;font-size:11px!important}
.member-state-note{display:flex!important;gap:12px!important;margin-top:12px!important;padding:14px!important;border:1px solid #f0d7ae!important;border-radius:18px!important;background:linear-gradient(135deg,#fff9ed,#fff5e4)!important}
.member-state-note-icon{width:31px!important;height:31px!important;flex:0 0 31px!important;border-radius:11px!important;display:grid!important;place-items:center!important;background:#ffe5b6!important;color:#9b5b12!important;font-weight:900!important}
.member-state-note>div{min-width:0!important;flex:1!important}
.member-state-note b{display:block!important;font-size:13px!important;color:#6d4514!important}
.member-state-note ul{margin:7px 0 0!important;padding-left:17px!important;color:#76654f!important;font-size:11px!important;line-height:1.55!important}
.member-state-note li+li{margin-top:3px!important}
.member-state-actions{display:grid!important;grid-template-columns:1fr 1.08fr!important;gap:9px!important;margin-top:15px!important}
.member-state-actions .btn{min-height:48px!important;border-radius:15px!important}
.member-deactivate-confirm{color:#fff!important;background:linear-gradient(135deg,#df8b2f,#bd6514)!important;border:0!important;box-shadow:0 10px 22px rgba(189,101,20,.18)!important}

html[data-theme="dark"] .member-name-state-icon.is-active{color:#fff!important;background:#35b94a!important;border-color:#35b94a!important;box-shadow:0 3px 8px rgba(53,185,74,.22)!important}
html[data-theme="dark"] .member-name-state-icon.is-inactive{color:#fff!important;background:#ef3038!important;border-color:#ef3038!important;box-shadow:0 3px 8px rgba(239,48,56,.2)!important}
html[data-theme="dark"] .member-clean-card.is-member-inactive{background:linear-gradient(145deg,#102234,#151f28)!important;border-color:#314459!important}
html[data-theme="dark"] .member-state-toggle.is-deactivate{color:#ffc77f!important;background:linear-gradient(135deg,#3a2a1d,#302217)!important;border-color:#62462d!important}
html[data-theme="dark"] .member-state-toggle.is-activate{color:#7ce0bd!important;background:linear-gradient(135deg,#173b33,#133129)!important;border-color:#2a5b4c!important}
html[data-theme="dark"] .member-state-person{background:linear-gradient(135deg,#11283c,#102335)!important;border-color:#2b465d!important}
html[data-theme="dark"] .member-state-person b{color:#eef6ff!important}
html[data-theme="dark"] .member-state-person span{color:#9db0c3!important}
html[data-theme="dark"] .member-state-note{background:linear-gradient(135deg,#34291d,#2d2319)!important;border-color:#5a432c!important}
html[data-theme="dark"] .member-state-note-icon{background:#513a22!important;color:#ffc178!important}
html[data-theme="dark"] .member-state-note b{color:#ffd09a!important}
html[data-theme="dark"] .member-state-note ul{color:#c5b49e!important}

@media(max-width:700px){
  .member-clean-card{align-items:center!important}
  .member-admin-actions.member-admin-actions-cutoff{min-width:174px!important;flex-basis:174px!important;gap:7px!important}
  .member-admin-primary-row{gap:7px!important}
  .member-admin-primary-row>.btn,.member-admin-primary-row>.member-self-badge,.member-state-toggle{min-height:42px!important;border-radius:13px!important;font-size:11px!important;padding:8px 7px!important}
}
@media(max-width:460px){
  .member-clean-card{gap:8px!important;padding:13px 12px!important}
  .member-identity{gap:9px!important;min-width:0!important}
  .member-identity>span{min-width:0!important}
  .member-admin-actions.member-admin-actions-cutoff{min-width:154px!important;flex-basis:154px!important}
  .member-admin-primary-row>.btn,.member-admin-primary-row>.member-self-badge,.member-state-toggle{min-height:40px!important;font-size:10.5px!important}
  .member-name-state-icon{width:16px!important;height:16px!important;flex-basis:16px!important;font-size:10px!important}
  .member-state-actions{grid-template-columns:1fr 1fr!important}
}

/* Final compact Members UI polish. UI only; calculation/state behavior unchanged. */
.member-admin-actions.member-admin-actions-cutoff{min-width:150px!important;flex:0 0 150px!important;gap:6px!important}
.member-admin-primary-row{gap:6px!important}
.member-admin-primary-row>.btn,.member-admin-primary-row>.member-self-badge,.member-state-toggle{min-height:36px!important;height:36px!important;padding:0 8px!important;border-radius:12px!important;font-size:10.5px!important;line-height:1!important}
.member-state-toggle{font-weight:820!important}
.member-admin-primary-row>.member-self-badge{display:inline-flex!important;align-items:center!important;justify-content:center!important;grid-column:auto!important;gap:4px!important;min-width:0!important;max-width:100%!important;padding:0 5px!important;font-size:8.25px!important;font-weight:800!important;letter-spacing:-.01em!important;white-space:nowrap!important;overflow:hidden!important}
.member-admin-primary-row>.member-self-badge::before{width:14px!important;height:14px!important;flex:0 0 14px!important;border-radius:5px!important;font-size:8px!important}

/* Self-admin row needs more room for the status label than the Edit button. */
.member-admin-primary-row:has(.member-self-badge){grid-template-columns:minmax(50px,.72fr) minmax(88px,1.28fr)!important}
.member-admin-primary-row:has(.member-self-badge)>.member-self-badge{font-size:8.6px!important;overflow:visible!important;text-overflow:clip!important}

/* Member profile and Deactivate confirmation follow the same bottom-sheet pattern
   as utility detail sheets: anchored to the phone bottom, content-height only. */
@media(max-width:760px){
  .modal-wrap:has(.member-state-confirm),
  .modal-wrap:has(.profile-popup){
    align-items:flex-end!important;
    justify-content:center!important;
    padding:0!important;
  }
  .modal:has(.member-state-confirm),
  .modal:has(.profile-popup){
    position:relative!important;
    width:100%!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    max-height:88dvh!important;
    margin:0!important;
    overflow:auto!important;
    padding:30px 20px calc(18px + env(safe-area-inset-bottom))!important;
    border-radius:28px 28px 0 0!important;
  }
  .modal:has(.member-state-confirm)::before,
  .modal:has(.profile-popup)::before{
    content:"";
    position:absolute!important;
    top:9px!important;
    left:50%!important;
    width:74px!important;
    height:5px!important;
    transform:translateX(-50%)!important;
    border-radius:999px!important;
    background:#d9e2ee!important;
  }
  .modal:has(.member-state-confirm) .member-state-confirm{margin-top:10px!important}
  .modal:has(.member-state-confirm) .member-state-person{padding:11px 12px!important}
  .modal:has(.member-state-confirm) .member-state-note{margin-top:10px!important;padding:12px!important}
  .modal:has(.member-state-confirm) .member-state-actions{margin-top:12px!important}
  .modal:has(.member-state-confirm) .member-state-actions .btn{min-height:44px!important;height:44px!important}
  .modal:has(.profile-popup) .profile-popup{margin-top:10px!important;gap:14px!important;align-items:start!important}
  .modal:has(.profile-popup) .profile-info{gap:8px!important}
  .modal:has(.profile-popup) .profile-info>div{padding:9px 11px!important}
  html[data-theme="dark"] .modal:has(.member-state-confirm)::before,
  html[data-theme="dark"] .modal:has(.profile-popup)::before{background:#465c70!important}
}
@media(max-width:520px){
  .member-admin-actions.member-admin-actions-cutoff{min-width:148px!important;flex-basis:148px!important;gap:5px!important}
  .member-admin-primary-row{gap:5px!important}
  .member-admin-primary-row>.btn,.member-admin-primary-row>.member-self-badge,.member-state-toggle{min-height:35px!important;height:35px!important;border-radius:11px!important;font-size:10px!important}
  .member-admin-primary-row:has(.member-self-badge){grid-template-columns:minmax(50px,.68fr) minmax(91px,1.32fr)!important}
  .member-admin-primary-row>.member-self-badge{font-size:8.2px!important;padding:0 4px!important;gap:3px!important}
  .member-admin-primary-row>.member-self-badge::before{width:13px!important;height:13px!important;flex-basis:13px!important}
}
@media(max-width:390px){
  .member-admin-actions.member-admin-actions-cutoff{min-width:142px!important;flex-basis:142px!important}
  .member-admin-primary-row>.btn,.member-state-toggle{font-size:9.5px!important}
  .member-admin-primary-row:has(.member-self-badge){grid-template-columns:48px minmax(88px,1fr)!important}
  .member-admin-primary-row>.member-self-badge{font-size:7.9px!important}
}
