/* Company users (Users.razor) and the user editor modals (UserEditor.razor): account and permissions. */

/* ── User cards ──────────────────────────────────────────────────────────── */
.ish-users-filterbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.ish-users-empty { min-height: 160px; border: 0; }

.ish-user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }

.ish-user-card { display: flex; min-width: 0; padding: 12px 14px; flex-direction: column; }

.ish-user-card.is-inactive { background: var(--surface-2); }

.ish-user-card.is-inactive .ish-user-avatar { background: var(--surface); color: var(--faint); }

.ish-user-card.is-inactive h2 { color: var(--muted); }

.ish-user-card .ish-card-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }

.ish-user-identity { display: flex; min-width: 0; align-items: center; gap: 10px; }

.ish-user-avatar { font-size: .95rem; }

.ish-user-identity > div { min-width: 0; }

.ish-user-identity h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ish-user-identity .ish-muted { display: block; margin-top: 3px; font-size: .72rem; }

.ish-user-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.ish-user-actions { display: flex; align-items: center; gap: 6px; }

.ish-user-editor { display: inline-flex; flex: none; align-items: center; }

/* ── Account modal ───────────────────────────────────────────────────────── */
.fl-modal.fl-modal--compact.ish-account-modal { max-width: 420px; }

.ish-password-row { display: flex; align-items: center; gap: 6px; }

.ish-password-row > :first-child { min-width: 0; flex: 1; }

.ish-password-row .fl-ref-iconbtn.is-copied { border-color: var(--success); background: var(--success-bg); color: var(--success); }

.ish-password-rule { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; color: var(--faint); font-size: .74rem; }

.ish-password-rule .msr { font-size: 16px; }

.ish-password-rule.is-met { color: var(--success); }

.ish-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--surface-2); cursor: pointer; }

.ish-switch-row > span { display: flex; flex-direction: column; gap: 2px; }

.ish-switch-row strong { color: var(--ink); font-size: .82rem; }

.ish-switch-row small { color: var(--muted); font-size: .72rem; }

.ish-switch-row input[role="switch"] { position: relative; width: 38px; height: 22px; flex: none; margin: 0; border-radius: 999px; background: var(--disabled-border); cursor: pointer; appearance: none; transition: background-color .15s ease; }

.ish-switch-row input[role="switch"]::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: inset-inline-start .15s ease; }

.ish-switch-row input[role="switch"]:checked { background: var(--success); }

.ish-switch-row input[role="switch"]:checked::after { inset-inline-start: 19px; }

.ish-switch-row input[role="switch"]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-tint); }

/* ── Permissions modal ───────────────────────────────────────────────────── */
.fl-modal.ish-user-permission-modal.fl-modal--lg { max-width: 640px; }

.ish-user-permission-modal .fl-modal-body { display: flex; flex-direction: column; gap: 12px; }

.ish-perm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.ish-perm-user { display: inline-flex; min-width: 0; align-items: center; gap: 10px; color: var(--ink); font-size: .9rem; font-weight: 800; }

.ish-perm-user .ish-contact-avatar { width: 34px; height: 34px; font-size: .9rem; }

.ish-perm-presets { display: flex; gap: 6px; flex-wrap: wrap; }

.ish-perm-presets .fl-btn { height: 32px; padding: 0 11px; font-size: .78rem; }

.ish-perm-presets .fl-btn .msr { font-size: 17px; color: var(--muted); }

.ish-perm-special { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }

.ish-perm-special:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--brand-tint-2); }

.ish-perm-special > .msr { color: var(--brand); font-size: 22px; }

.ish-perm-special > span:last-child { display: flex; flex-direction: column; gap: 1px; }

.ish-perm-special strong { color: var(--ink); font-size: .84rem; }

.ish-perm-special small { color: var(--muted); font-size: .72rem; }

.ish-perm-tablewrap { overflow: auto; max-height: 52vh; border: 1px solid var(--line-soft); border-radius: 10px; }

.ish-perm-table { width: 100%; border-collapse: collapse; font-size: .82rem; }

.ish-perm-table thead th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 700; text-align: center; white-space: nowrap; }

.ish-perm-table thead th:first-child { text-align: start; }

.ish-perm-table tbody th { padding: 9px 12px; color: var(--ink); font-weight: 700; text-align: start; white-space: nowrap; }

.ish-perm-section { display: inline-flex; align-items: center; gap: 8px; }

.ish-perm-table tbody th .msr { color: var(--faint); font-size: 18px; }

.ish-perm-table tbody tr + tr > * { border-top: 1px solid var(--line-soft); }

.ish-perm-table tbody tr.has-access th .msr { color: var(--brand); }

.ish-perm-table tbody tr:hover { background: var(--brand-tint-2); }

.ish-perm-table td { width: 22%; padding: 9px 12px; text-align: center; }

.ish-perm-table input, .ish-perm-special input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); cursor: pointer; }

@media (max-width: 620px) {
  .ish-user-grid { grid-template-columns: 1fr; }

  .ish-user-editor, .ish-user-editor > .fl-ref-add { width: 100%; }

  .ish-user-editor > .fl-ref-add { justify-content: center; }

  .ish-user-card .ish-card-foot { align-items: stretch; flex-direction: column; }

  .ish-user-actions { align-self: flex-end; }

  /* Tighter cells so the permission matrix fits the phone-width modal without a sideways scroll. */
  .ish-perm-table thead th, .ish-perm-table tbody th, .ish-perm-table td { padding-inline: 8px; }
}
