/* ============================================================
 * shareAdmin.css — Phase 1.6 営業所管理 (招待 / メンバー / 改名) modal
 * 共通カラー: TORIAI accent #4f46e5 (master 指示で確定)
 * ============================================================ */

.sa-modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 24, 27, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1300;
  padding: 16px;
}

.sa-modal-card {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.sa-modal-card.sa-modal-wide { max-width: 560px; }

.sa-modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid #e4e4e7;
  font-weight: 600;
  font-size: 15px;
}

.sa-modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
  overflow-y: auto;
}

.sa-modal-foot {
  padding: 12px 18px;
  border-top: 1px solid #e4e4e7;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.sa-fieldset {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fafafa;
}

.sa-help {
  font-size: 12px;
  color: #71717a;
}

.sa-capacity {
  padding: 8px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: #1d4ed8;
  font-size: 12px;
}
.sa-capacity strong { color: #1e40af; }
.sa-capacity-warn {
  background: #fef3c7;
  border-color: #fde68a;
  color: #78350f;
}
.sa-capacity-warn strong { color: #b45309; }

.sa-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sa-field > span {
  flex: 0 0 100px;
  font-size: 12px;
  color: #52525b;
  font-weight: 500;
}
.sa-field input,
.sa-field select {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  font-size: 13px;
  background: #ffffff;
}
.sa-field input:focus,
.sa-field select:focus {
  outline: 2px solid #4f46e5;
  outline-offset: -1px;
  border-color: #4f46e5;
}
.sa-field small {
  flex: 0 0 auto;
  font-size: 11px;
  color: #71717a;
}

.sa-divider {
  margin-top: 4px;
  padding: 6px 0 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #71717a;
  border-bottom: 1px solid #e4e4e7;
}

.sa-empty {
  text-align: center;
  color: #a1a1aa;
  padding: 24px 8px;
  font-size: 13px;
}

.sa-error {
  padding: 8px 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #b91c1c;
  font-size: 12px;
}

.sa-info {
  padding: 8px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: #1d4ed8;
  font-size: 12px;
}

/* master 仕様 (2026-05-10): 背景を白に統一 (枠の indigo は維持) */
.sa-issued {
  margin-top: 10px;
  padding: 12px;
  border: 2px solid #4f46e5;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}
.sa-issued-label {
  font-size: 11px;
  color: #4f46e5;
  font-weight: 600;
  margin-bottom: 6px;
}
.sa-issued-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  font-weight: 700;
  color: #18181b;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  user-select: all;
}
.sa-issued-meta {
  font-size: 11px;
  color: #71717a;
  margin-bottom: 10px;
}
.sa-issued-actions {
  display: inline-flex;
  gap: 6px;
}

/* ── 招待コードリスト ──────────────────────────────────── */

.sa-invite-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sa-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: #ffffff;
}
.sa-invite-row.is-disabled {
  background: #fafafa;
  opacity: 0.7;
}

.sa-invite-row-main { flex: 1; min-width: 0; }
.sa-invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 600;
  color: #18181b;
  letter-spacing: 0.04em;
}

.sa-invite-code-active {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  color: #4f46e5;
  letter-spacing: 0.08em;
  user-select: all;
}
.sa-invite-meta {
  font-size: 11px;
  color: #71717a;
  margin-top: 2px;
}
.sa-invite-row-actions {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ── メンバーリスト ────────────────────────────────────── */

.sa-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sa-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
}

.sa-member-info { flex: 1; min-width: 0; }
.sa-member-name {
  font-weight: 600;
  font-size: 14px;
  color: #18181b;
}
.sa-member-meta {
  font-size: 11px;
  color: #71717a;
  margin-top: 2px;
}
.sa-tag {
  display: inline-block;
  padding: 1px 6px;
  background: #4f46e5;
  color: #ffffff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  margin-left: 4px;
}

/* ── buttons (.sa-btn は modal 内専用) ─────────────────── */

.sa-modal .sa-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  background: #ffffff;
  color: #18181b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.sa-modal .sa-btn:hover { background: #f4f4f5; }
.sa-modal .sa-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sa-modal .sa-btn-primary {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}
.sa-modal .sa-btn-primary:hover:not(:disabled) {
  background: #4338ca;
  border-color: #4338ca;
}
/* master 指示 (2026-05-09): disabled でも TORIAI indigo を保持 (= 薄紫に
   抜けて見えないように。 cursor で disable 状態を示す) */
.sa-modal .sa-btn-primary:disabled {
  background: #6366f1;
  border-color: #6366f1;
  opacity: 1;
  cursor: not-allowed;
}

.sa-modal .sa-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #52525b;
  padding: 4px 8px;
}
.sa-modal .sa-btn-ghost:hover { background: #f4f4f5; color: #18181b; }
.sa-modal .sa-btn-danger { color: #b91c1c; }
.sa-modal .sa-btn-danger:hover { background: #fef2f2; color: #991b1b; }

@media (max-width: 480px) {
  .sa-modal-card { max-width: 96vw; }
  .sa-field {
    flex-direction: column;
    align-items: stretch;
  }
  .sa-field > span { flex: none; }
}
